/* Custom CSS for CyberShield Security Website */

/* Mobile-First Base Styles */
* {
    box-sizing: border-box;
}

/* Improve touch targets for mobile */
button, a, [role="button"] {
    min-height: 44px;
    min-width: 44px;
}

/* Responsive spacing utilities */
.section-padding {
    padding-top: 4rem;
    padding-bottom: 4rem;
}

@media (min-width: 640px) {
    .section-padding {
        padding-top: 5rem;
        padding-bottom: 5rem;
    }
}

@media (min-width: 1024px) {
    .section-padding {
        padding-top: 6rem;
        padding-bottom: 6rem;
    }
}

/* Improved container padding */
.container-padding {
    padding-left: 1rem;
    padding-right: 1rem;
}

@media (min-width: 640px) {
    .container-padding {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
}

/* Navigation spacing fix */
.navbar-height {
    height: 72px; /* Default mobile height */
}

@media (min-width: 768px) {
    .navbar-height {
        height: 80px; /* Desktop height */
    }
}

/* Content padding to account for fixed navbar */
.content-padding-top {
    padding-top: 80px;
}

@media (min-width: 768px) {
    .content-padding-top {
        padding-top: 96px;
    }
}

/* Keyframe Animations */
@keyframes glitch {
    0% { transform: translate(0); }
    20% { transform: translate(-2px, 2px); }
    40% { transform: translate(-2px, -2px); }
    60% { transform: translate(2px, 2px); }
    80% { transform: translate(2px, -2px); }
    100% { transform: translate(0); }
}

@keyframes pulse-neon {
    0%, 100% { 
        opacity: 1;
        text-shadow: 0 0 5px currentColor, 0 0 10px currentColor, 0 0 15px currentColor;
    }
    50% { 
        opacity: 0.8;
        text-shadow: 0 0 2px currentColor, 0 0 5px currentColor, 0 0 8px currentColor;
    }
}

@keyframes scan {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

@keyframes typewriter {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes matrix {
    0% { transform: translateY(-100%); }
    100% { transform: translateY(100vh); }
}

@keyframes slide-up {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes scale-in {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes gradient-x {
    0%, 100% {
        background-size: 200% 200%;
        background-position: left center;
    }
    50% {
        background-size: 200% 200%;
        background-position: right center;
    }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-2px); }
    20%, 40%, 60%, 80% { transform: translateX(2px); }
}

/* Custom Utilities */
.animate-glitch {
    animation: glitch 2s ease-in-out infinite;
}

.animate-pulse-neon {
    animation: pulse-neon 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.animate-scan {
    animation: scan 6s linear infinite;
}

.animate-float {
    animation: float 6s ease-in-out infinite;
}

.animate-typewriter {
    animation: typewriter 2s ease-out forwards;
}

.animate-matrix {
    animation: matrix 20s linear infinite;
}

.animate-slide-up {
    animation: slide-up 0.5s ease-out forwards;
}

.animate-fade-in {
    animation: fade-in 0.6s ease-out forwards;
}

.animate-scale-in {
    animation: scale-in 0.5s ease-out forwards;
}

.animate-gradient-x {
    animation: gradient-x 15s ease infinite;
}

.animate-shake {
    animation: shake 0.5s ease-in-out;
}

/* Animation Delays */
.animation-delay-100 { animation-delay: 100ms; }
.animation-delay-200 { animation-delay: 200ms; }
.animation-delay-300 { animation-delay: 300ms; }
.animation-delay-500 { animation-delay: 500ms; }
.animation-delay-1000 { animation-delay: 1000ms; }
.animation-delay-2000 { animation-delay: 2000ms; }

/* Improved Mobile Typography */
.responsive-text-xs {
    font-size: 0.75rem;
    line-height: 1rem;
}

.responsive-text-sm {
    font-size: 0.875rem;
    line-height: 1.25rem;
}

.responsive-text-base {
    font-size: 1rem;
    line-height: 1.5rem;
}

@media (min-width: 640px) {
    .responsive-text-xs { font-size: 0.875rem; line-height: 1.25rem; }
    .responsive-text-sm { font-size: 1rem; line-height: 1.5rem; }
    .responsive-text-base { font-size: 1.125rem; line-height: 1.75rem; }
}

/* Custom Cursor */
.cursor-cyber {
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="%2300ffff" stroke-width="2"><path d="M12 2L2 22h20L12 2z"/></svg>'), auto;
}

/* Glitch Text Effect */
.text-glitch {
    position: relative;
    color: #00ffff;
}

.text-glitch::before,
.text-glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.text-glitch::before {
    color: #ff0000;
    z-index: -1;
    animation: glitch 1s infinite;
    clip-path: polygon(0 0, 100% 0, 100% 45%, 0 45%);
}

.text-glitch::after {
    color: #00ff00;
    z-index: -2;
    animation: glitch 1s infinite reverse;
    clip-path: polygon(0 55%, 100% 55%, 100% 100%, 0 100%);
}

/* Neon Glow Effects */
.glow-neon-blue {
    box-shadow: 0 0 5px #00ffff, 0 0 10px #00ffff, 0 0 15px #00ffff;
}

.glow-neon-green {
    box-shadow: 0 0 5px #39ff14, 0 0 10px #39ff14, 0 0 15px #39ff14;
}

.glow-neon-purple {
    box-shadow: 0 0 5px #bf00ff, 0 0 10px #bf00ff, 0 0 15px #bf00ff;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #0a0a0a;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(to bottom, #06b6d4, #0891b2);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(to bottom, #22d3ee, #06b6d4);
}

/* Matrix Rain Effect */
.matrix-rain {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
}

.matrix-char {
    position: absolute;
    color: #00ff00;
    font-family: 'Fira Code', monospace;
    font-size: 14px;
    animation: matrix 10s linear infinite;
    opacity: 0.7;
}

/* Circuit Pattern */
.circuit-pattern {
    background-image: 
        radial-gradient(circle at 25% 25%, #06b6d4 2px, transparent 2px),
        radial-gradient(circle at 75% 75%, #06b6d4 2px, transparent 2px),
        linear-gradient(90deg, transparent 24%, rgba(6, 182, 212, 0.1) 25%, rgba(6, 182, 212, 0.1) 26%, transparent 27%, transparent 74%, rgba(6, 182, 212, 0.1) 75%, rgba(6, 182, 212, 0.1) 76%, transparent 77%),
        linear-gradient(transparent 24%, rgba(6, 182, 212, 0.1) 25%, rgba(6, 182, 212, 0.1) 26%, transparent 27%, transparent 74%, rgba(6, 182, 212, 0.1) 75%, rgba(6, 182, 212, 0.1) 76%, transparent 77%);
    background-size: 50px 50px;
}

/* Loading Screen */
#loading-screen {
    transition: opacity 0.5s ease-in-out, visibility 0.5s ease-in-out;
}

#loading-screen.fade-out {
    opacity: 0;
    visibility: hidden;
}

/* Terminal Style */
.terminal {
    background: #000;
    color: #00ff00;
    font-family: 'Fira Code', monospace;
    padding: 20px;
    border-radius: 8px;
    position: relative;
    overflow: hidden;
}

.terminal::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 30px;
    background: linear-gradient(90deg, #333, #666, #333);
    border-radius: 8px 8px 0 0;
}

.terminal-line {
    margin: 5px 0;
}

.terminal-prompt {
    color: #00ffff;
}

.terminal-command {
    color: #ffffff;
}

.terminal-output {
    color: #00ff00;
    margin-left: 20px;
}

/* Holographic Effect */
.holographic {
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.1) 50%, transparent 70%);
    background-size: 200% 200%;
    animation: holographic 3s ease-in-out infinite;
}

@keyframes holographic {
    0% { background-position: 0% 0%; }
    50% { background-position: 100% 100%; }
    100% { background-position: 0% 0%; }
}

/* Scan Line Effect */
.scan-lines::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(transparent 50%, rgba(0, 255, 255, 0.03) 50%);
    background-size: 100% 4px;
    pointer-events: none;
}

/* Cyber Grid Background */
.cyber-grid-bg {
    background-image: 
        linear-gradient(rgba(6, 182, 212, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(6, 182, 212, 0.1) 1px, transparent 1px);
    background-size: 60px 60px;
}

/* Text Selection */
::selection {
    background: rgba(6, 182, 212, 0.3);
    color: #ffffff;
}

::-moz-selection {
    background: rgba(6, 182, 212, 0.3);
    color: #ffffff;
}

/* Focus Styles */
*:focus {
    outline: 2px solid #06b6d4;
    outline-offset: 2px;
}

/* Improved Mobile Spacing */
@media (max-width: 640px) {
    .mobile-spacing {
        margin-bottom: 1rem !important;
    }
    
    .mobile-padding {
        padding: 1rem !important;
    }
    
    /* Disable heavy animations on mobile for performance */
    .animate-float {
        animation: none !important;
    }
    
    .matrix-rain {
        display: none !important;
    }
    
    /* Better mobile typography */
    .mobile-text-scaling {
        font-size: clamp(1rem, 4vw, 1.5rem);
    }
    
    /* Improve button spacing on mobile */
    .mobile-button-spacing > * + * {
        margin-top: 0.75rem;
    }
}

/* Tablet Optimizations */
@media (min-width: 641px) and (max-width: 1023px) {
    .tablet-grid-cols-2 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .tablet-spacing {
        padding: 1.5rem;
    }
}

/* Desktop Enhancements */
@media (min-width: 1024px) {
    .desktop-hover-effects:hover {
        transform: translateY(-2px);
        transition: transform 0.3s ease;
    }
    
    .desktop-large-spacing {
        padding: 2rem;
    }
}

/* Interactive Elements */
.interactive-element {
    transition: all 0.3s ease;
    cursor: pointer;
}

.interactive-element:hover {
    transform: translateY(-2px);
}

.interactive-element:active {
    transform: translateY(0);
}

/* Card Improvements */
.card-hover {
    transition: all 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(6, 182, 212, 0.15);
}

/* Form Element Improvements */
input, textarea, select {
    transition: all 0.3s ease;
}

input:focus, textarea:focus, select:focus {
    transform: scale(1.02);
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.1);
}

/* Print Styles */
@media print {
    .animate-pulse-neon,
    .animate-glitch,
    .animate-scan,
    .animate-float,
    .animate-matrix {
        animation: none !important;
    }
    
    .glow-neon-blue,
    .glow-neon-green,
    .glow-neon-purple {
        box-shadow: none !important;
    }
    
    /* Hide interactive elements when printing */
    button, .mobile-menu-toggle, nav {
        display: none !important;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .text-gray-400 {
        color: #ffffff !important;
    }
    
    .text-gray-500 {
        color: #cccccc !important;
    }
    
    .border-dark-border {
        border-color: #ffffff !important;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    /* Already dark theme by default */
}

/* Light Mode Support (if needed) */
@media (prefers-color-scheme: light) {
    /* Keep dark theme regardless for cybersecurity aesthetic */
}

/* Utility Classes for Consistent Spacing */
.section-spacing {
    margin-bottom: 4rem;
}

@media (min-width: 640px) {
    .section-spacing {
        margin-bottom: 5rem;
    }
}

@media (min-width: 1024px) {
    .section-spacing {
        margin-bottom: 6rem;
    }
}

/* Button Consistency */
.btn-primary {
    @apply px-6 py-3 bg-gradient-to-r from-cyber-600 to-cyber-700 hover:from-cyber-700 hover:to-cyber-800 text-white font-semibold rounded-lg transition-all duration-300 shadow-lg shadow-cyber-500/20 hover:shadow-cyber-500/40 transform hover:scale-105;
}

.btn-secondary {
    @apply px-6 py-3 bg-transparent border-2 border-cyber-500 text-cyber-400 font-semibold rounded-lg hover:bg-cyber-500/10 hover:border-neon-blue hover:text-neon-blue transition-all duration-300;
} 