/* Base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Rajdhani', 'Share Tech Mono', 'Courier New', monospace;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

@import url('https://fonts.googleapis.com/css2?family=Rajdhani:wght@300;400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;500;600;700;800;900&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Share+Tech+Mono&display=swap');

body {
    background-color: #000;
    color: #0af;
    overflow: hidden;
    height: 100vh;
    position: relative;
    margin: 0;
    padding: 0;
}

/* Background elements */
#grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(ellipse at center, rgba(0, 40, 80, 0.2) 0%, rgba(0, 0, 0, 0.8) 70%),
        linear-gradient(0deg, transparent 50%, rgba(0, 100, 200, 0.05) 50%),
        linear-gradient(90deg, transparent 50%, rgba(0, 100, 200, 0.05) 50%);
    background-size: 100% 100%, 20px 20px, 20px 20px;
    z-index: -2;
    animation: grid-pulse 8s infinite alternate;
}

@keyframes grid-pulse {
    0% { opacity: 0.7; }
    100% { opacity: 1; }
}

#hacking-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: 
        radial-gradient(circle at 10% 20%, rgba(0, 200, 255, 0.1) 0%, transparent 20%),
        radial-gradient(circle at 90% 80%, rgba(0, 150, 255, 0.1) 0%, transparent 20%);
}

#scanlines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        to bottom,
        transparent,
        transparent 2px,
        rgba(0, 100, 255, 0.05) 2px,
        rgba(0, 100, 255, 0.05) 4px
    );
    z-index: -1;
    pointer-events: none;
}

/* Logo styles */
#logo-container {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    z-index: 100;
}

#logo {
    width: 170px;
    height: auto;
    padding: 20px;
    position: relative;
    z-index: 10;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    transform: translateY(0);
    opacity: 0.98;
    /* Neon ring effect */
    background: 
        radial-gradient(circle at center, rgba(0, 40, 80, 0.2) 0%, rgba(0, 20, 40, 0.3) 70%, transparent 100%),
        conic-gradient(from 0deg, #0af, #0ff, #0af, #0af);
    background-origin: border-box;
    background-clip: content-box, border-box;
    border: double 2px transparent;
    box-shadow: 
        0 0 20px rgba(0, 200, 255, 0.5),
        inset 0 0 20px rgba(0, 150, 255, 0.3);
}

#logo:hover {
    transform: scale(1.15) rotate(10deg);
    box-shadow: 
        0 0 40px rgba(0, 255, 255, 0.8),
        inset 0 0 30px rgba(0, 200, 255, 0.5);
    background: 
        radial-gradient(circle at center, rgba(0, 60, 120, 0.3) 0%, rgba(0, 30, 60, 0.4) 70%, transparent 100%),
        conic-gradient(from 0deg, #0ff, #0af, #0ff, #0ff);
    filter: brightness(1.2) saturate(1.3);
}

/* Main content */
#main-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    width: 100%;
    max-width: 800px;
    padding: 20px;
    box-sizing: border-box;
    z-index: 50;
}

/* Text sequence */
#text-sequence p {
    font-size: 2.2rem;
    margin: 25px 0;
    opacity: 0;
    text-shadow: 0 0 15px rgba(0, 255, 255, 0.8);
    font-weight: 600;
    letter-spacing: 1px;
    font-family: 'Orbitron', 'Rajdhani', sans-serif;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
}

#text-sequence p:hover {
    transform: scale(1.02);
    text-shadow: 0 0 25px rgba(0, 255, 255, 1);
    filter: brightness(1.1);
}

.hidden {
    display: none;
}

.glitch {
    position: relative;
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.glitch::before {
    left: 2px;
    text-shadow: -2px 0 #ff00c1;
    clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim 5s infinite linear alternate-reverse;
}

.glitch::after {
    left: -2px;
    text-shadow: -2px 0 #00fff9, 2px 2px #ff00c1;
    clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim2 5s infinite linear alternate-reverse;
}

@keyframes glitch-anim {
    0% { clip: rect(42px, 9999px, 44px, 0); }
    5% { clip: rect(12px, 9999px, 59px, 0); }
    10% { clip: rect(48px, 9999px, 29px, 0); }
    15% { clip: rect(42px, 9999px, 73px, 0); }
    20% { clip: rect(63px, 9999px, 27px, 0); }
    25% { clip: rect(34px, 9999px, 55px, 0); }
    30% { clip: rect(86px, 9999px, 73px, 0); }
    35% { clip: rect(20px, 9999px, 20px, 0); }
    40% { clip: rect(26px, 9999px, 60px, 0); }
    45% { clip: rect(25px, 9999px, 66px, 0); }
    50% { clip: rect(57px, 9999px, 98px, 0); }
    55% { clip: rect(5px, 9999px, 46px, 0); }
    60% { clip: rect(82px, 9999px, 31px, 0); }
    65% { clip: rect(54px, 9999px, 27px, 0); }
    70% { clip: rect(28px, 9999px, 99px, 0); }
    75% { clip: rect(45px, 9999px, 69px, 0); }
    80% { clip: rect(23px, 9999px, 85px, 0); }
    85% { clip: rect(1px, 9999px, 83px, 0); }
    90% { clip: rect(71px, 9999px, 14px, 0); }
    95% { clip: rect(2px, 9999px, 38px, 0); }
    100% { clip: rect(33px, 9999px, 45px, 0); }
}

@keyframes glitch-anim2 {
    0% { clip: rect(65px, 9999px, 100px, 0); }
    5% { clip: rect(52px, 9999px, 74px, 0); }
    10% { clip: rect(79px, 9999px, 85px, 0); }
    15% { clip: rect(75px, 9999px, 5px, 0); }
    20% { clip: rect(67px, 9999px, 61px, 0); }
    25% { clip: rect(14px, 9999px, 79px, 0); }
    30% { clip: rect(1px, 9999px, 66px, 0); }
    35% { clip: rect(86px, 9999px, 30px, 0); }
    40% { clip: rect(23px, 9999px, 98px, 0); }
    45% { clip: rect(85px, 9999px, 72px, 0); }
    50% { clip: rect(71px, 9999px, 75px, 0); }
    55% { clip: rect(2px, 9999px, 48px, 0); }
    60% { clip: rect(30px, 9999px, 16px, 0); }
    65% { clip: rect(59px, 9999px, 50px, 0); }
    70% { clip: rect(41px, 9999px, 62px, 0); }
    75% { clip: rect(2px, 9999px, 82px, 0); }
    80% { clip: rect(47px, 9999px, 73px, 0); }
    85% { clip: rect(3px, 9999px, 27px, 0); }
    90% { clip: rect(26px, 9999px, 55px, 0); }
    95% { clip: rect(42px, 9999px, 97px, 0); }
    100% { clip: rect(38px, 9999px, 49px, 0); }
}

/* Countdown timer */
#countdown-container {
    margin: 50px 0;
}

#timer {
    font-size: 3.5rem;
    letter-spacing: 8px;
    margin-bottom: 25px;
    text-shadow: 0 0 20px rgba(0, 255, 255, 1);
    font-weight: 700;
    background: linear-gradient(to right, #0af, #0ff, #0af);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-transform: uppercase;
    font-family: 'Orbitron', 'Rajdhani', sans-serif;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
}

#timer:hover {
    transform: scale(1.05);
    text-shadow: 0 0 30px rgba(0, 255, 255, 1);
    filter: brightness(1.2);
}

#timer-text {
    font-size: 1.2rem;
    color: #0af;
    opacity: 0.8;
}

/* Buttons */
#buttons {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin: 40px 0;
}

.secure-btn {
    background: linear-gradient(45deg, rgba(0, 0, 0, 0.8), rgba(0, 20, 40, 0.9));
    color: #0ff;
    border: 2px solid;
    border-image: linear-gradient(45deg, #0af, #0ff, #0af) 1;
    padding: 20px 40px;
    font-size: 1.3rem;
    font-weight: 600;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.4s ease;
    text-transform: uppercase;
    letter-spacing: 3px;
    box-shadow: 0 0 15px rgba(0, 170, 255, 0.7);
    backdrop-filter: blur(5px);
    border-radius: 4px;
    min-width: 200px;
}

.secure-btn:hover {
    background: linear-gradient(45deg, rgba(0, 40, 80, 0.9), rgba(0, 80, 160, 0.9));
    box-shadow: 0 0 25px rgba(0, 255, 255, 1);
    transform: translateY(-3px) scale(1.05);
    letter-spacing: 4px;
}

.secure-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 255, 255, 0.6), transparent);
    transition: 0.7s;
    transform: skewX(-25deg);
}

.secure-btn:hover::before {
    left: 100%;
}

.secure-btn::after {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    background: linear-gradient(45deg, #0af, #0ff, #0af);
    z-index: -1;
    filter: blur(20px);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.secure-btn:hover::after {
    opacity: 0.7;
}

/* Final line */
#final-line {
    font-size: 0.9rem;
    color: #0af;
    opacity: 0.3;
    margin-top: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
}

#final-line:hover {
    opacity: 0.6;
    transform: scale(1.05);
}

/* Matrix rain effect */
#matrix-rain {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.3;
}

/* Messages */
.message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: 
        linear-gradient(135deg, rgba(20, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.9) 100%),
        linear-gradient(45deg, rgba(255, 0, 0, 0.2) 0%, transparent 50%, rgba(255, 0, 0, 0.2) 100%);
    border: 2px solid #f00;
    padding: 30px;
    text-align: center;
    z-index: 1000;
    box-shadow: 
        0 0 30px rgba(255, 0, 0, 0.5),
        inset 0 0 20px rgba(255, 0, 0, 0.3);
    backdrop-filter: blur(5px);
    width: 80%;
    max-width: 500px;
    margin: 0;
    box-sizing: border-box;
}

.message h2 {
    color: #f00;
    margin-bottom: 20px;
    text-shadow: 0 0 10px rgba(255, 0, 0, 0.7);
    filter: drop-shadow(0 0 5px rgba(255, 0, 0, 0.8));
}

.message p {
    font-size: 1.2rem;
    margin: 10px 0;
    color: #faa;
    text-shadow: 0 0 5px rgba(255, 0, 0, 0.5);
}



/* Decode overlay */
#decode-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        linear-gradient(rgba(0, 10, 0, 0.9), rgba(0, 5, 0, 0.9)),
        repeating-linear-gradient(
            0deg,
            rgba(0, 20, 0, 0.1),
            rgba(0, 20, 0, 0.1) 1px,
            transparent 1px,
            transparent 2px
        );
    z-index: 1000;
    overflow: hidden;
    backdrop-filter: blur(2px);
    box-sizing: border-box;
}

#decode-content {
    position: relative;
    width: 100%;
    height: 100%;
}

#code-stream {
    color: #0f0;
    font-size: 0.9rem;
    line-height: 1.6;
    white-space: pre;
    overflow: hidden;
    padding: 30px;
    height: 100%;
    text-shadow: 0 0 5px rgba(0, 255, 0, 0.7);
    font-family: 'Courier New', monospace;
    background: 
        linear-gradient(transparent 50%, rgba(0, 30, 0, 0.1) 50%),
        linear-gradient(90deg, rgba(0, 30, 0, 0.1) 50%, transparent 50%);
    background-size: 100% 2px, 2px 100%;
    box-shadow: inset 0 0 20px rgba(0, 255, 0, 0.1);
}

#terminal-log {
    position: absolute;
    top: 0;
    right: 0;
    width: 300px;
    background: rgba(0, 10, 0, 0.8);
    padding: 15px;
    font-size: 0.9rem;
    color: #0f0;
    border-left: 1px solid #0a0;
    min-height: 100%;
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.2);
    overflow-y: auto;
}

/* Animations */
.pulse {
    animation: pulse-animation 2s infinite;
}

@keyframes pulse-animation {
    0% { filter: drop-shadow(0 0 5px rgba(0, 170, 255, 0.7)); }
    50% { filter: drop-shadow(0 0 20px rgba(0, 170, 255, 1)); }
    100% { filter: drop-shadow(0 0 5px rgba(0, 170, 255, 0.7)); }
}

.fade-in {
    animation: fade-in 2s forwards;
}

@keyframes fade-in {
    0% { 
        opacity: 0; 
    }
    100% { 
        opacity: 1; 
    }
}

.fade-out {
    animation: fade-out 2s forwards;
}

@keyframes fade-out {
    from { opacity: 1; }
    to { opacity: 0; }
}

.slide-down {
    animation: slide-down 3s forwards cubic-bezier(0.25, 0.8, 0.25, 1);
}

@keyframes slide-down {
    to {
        transform: translate(-50%, 100vh);
        opacity: 0;
    }
}

.slide-up {
    animation: slide-up 3s forwards cubic-bezier(0.25, 0.8, 0.25, 1);
}

@keyframes slide-up {
    to {
        transform: translateY(-100vh) translateX(-50%);
    }
}

/* Responsive design */
@media (max-width: 768px) {
    #text-sequence p {
        font-size: 1.2rem;
    }
    
    #timer {
        font-size: 2rem;
    }
    
    #buttons {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }
    
    .secure-btn {
        width: 80%;
    }
    
    /* Mobile-specific adjustments */
    #main-content {
        padding: 10px;
        max-width: 95%;
    }
    
    #logo {
        width: 120px;
        padding: 15px;
    }
    
    .message {
        width: 90%;
        padding: 20px;
        font-size: 0.9rem;
    }
    
    #decode-overlay {
        padding: 10px;
    }
    
    #code-stream {
        font-size: 0.7rem;
        padding: 15px;
    }
    
    #terminal-log {
        width: 100%;
        position: relative;
        min-height: 150px;
        max-height: 200px;
        font-size: 0.7rem;
    }
}