/* ═══════════════════════════════════════════════════════════════
   CONION CORE - MAIN STYLESHEET
   Dark Mysterious Theme with Maximum Security
   ═══════════════════════════════════════════════════════════════ */

/* ─────────────────────────────────────────────────────────────────
   CSS VARIABLES (Easy to customize colors)
   ───────────────────────────────────────────────────────────────── */
:root {
    /* Primary Colors */
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-tertiary: #1a1a25;
    
    /* Accent Colors */
    --accent-primary: #6366f1;
    --accent-secondary: #818cf8;
    --accent-glow: rgba(99, 102, 241, 0.4);
    
    /* Text Colors */
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    /* Border Colors */
    --border-primary: #2d2d3a;
    --border-glow: rgba(99, 102, 241, 0.3);
    
    /* Gradients */
    --gradient-dark: linear-gradient(180deg, #0a0a0f 0%, #12121a 100%);
    --gradient-glow: radial-gradient(ellipse at center, rgba(99, 102, 241, 0.15) 0%, transparent 70%);
    
    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 30px rgba(99, 102, 241, 0.3);
    
    /* Sizing */
    --max-width: 900px;
    --border-radius: 8px;
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* ─────────────────────────────────────────────────────────────────
   RESET & BASE STYLES
   ───────────────────────────────────────────────────────────────── */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Segoe UI', 'SF Pro Display', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Disable text selection on puzzle (anti-copy) */
.puzzle-image {
       user-select: none;
       -webkit-user-select: none;
       -moz-user-select: none;
       -ms-user-select: none;
       cursor: pointer;
   }

/* But allow download button to work */
.puzzle-container {
    pointer-events: auto;
}

/* ─────────────────────────────────────────────────────────────────
   BACKGROUND EFFECTS
   ───────────────────────────────────────────────────────────────── */
.bg-effects {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
}

.bg-grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(99, 102, 241, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(99, 102, 241, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: gridMove 20s linear infinite;
}

@keyframes gridMove {
    0% { transform: translate(0, 0); }
    100% { transform: translate(50px, 50px); }
}

.bg-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 800px;
    height: 800px;
    transform: translate(-50%, -50%);
    background: var(--gradient-glow);
    animation: glowPulse 8s ease-in-out infinite;
}

@keyframes glowPulse {
    0%, 100% { opacity: 0.5; transform: translate(-50%, -50%) scale(1); }
    50% { opacity: 0.8; transform: translate(-50%, -50%) scale(1.1); }
}

/* ─────────────────────────────────────────────────────────────────
   CONTAINER
   ───────────────────────────────────────────────────────────────── */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 2rem 1.5rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
}

/* ─────────────────────────────────────────────────────────────────
   HEADER
   ───────────────────────────────────────────────────────────────── */
.header {
    text-align: center;
    padding: 2rem 0 3rem;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.logo-symbol {
    font-size: 1.5rem;
    color: var(--accent-primary);
    animation: symbolPulse 3s ease-in-out infinite;
}

@keyframes symbolPulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

.logo-text {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 40px var(--accent-glow);
}

.tagline {
    font-size: 1rem;
    color: var(--text-secondary);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    font-weight: 300;
}

/* ─────────────────────────────────────────────────────────────────
   MAIN CONTENT
   ───────────────────────────────────────────────────────────────── */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* ─────────────────────────────────────────────────────────────────
   PUZZLE SECTION
   ───────────────────────────────────────────────────────────────── */
.puzzle-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.puzzle-frame {
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    position: relative;
    overflow: hidden;
}

.puzzle-frame::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--accent-primary), transparent);
}

.puzzle-container {
    position: relative;
    background: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.puzzle-image {
    display: block;
    max-width: 100%;
    height: auto;
    min-height: 300px;
    object-fit: contain;
    background: var(--bg-tertiary);
}

/* Scan Line Effect */
.scan-line {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent-glow), transparent);
    animation: scanLine 3s linear infinite;
    opacity: 0.5;
}

@keyframes scanLine {
    0% { top: 0; }
    100% { top: 100%; }
}

/* ─────────────────────────────────────────────────────────────────
   DOWNLOAD BUTTON
   ───────────────────────────────────────────────────────────────── */
.download-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, var(--accent-primary) 0%, #4f46e5 100%);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.download-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left var(--transition-slow);
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.4);
}

.download-btn:hover::before {
    left: 100%;
}

.download-btn:active {
    transform: translateY(0);
}

.btn-icon {
    font-size: 1.25rem;
    animation: bounceDown 2s ease-in-out infinite;
}

@keyframes bounceDown {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(3px); }
}

/* ─────────────────────────────────────────────────────────────────
   INSTRUCTIONS
   ───────────────────────────────────────────────────────────────── */
.instructions {
    text-align: center;
    padding: 1rem;
}

.instruction-text {
    color: var(--text-secondary);
    font-size: 0.95rem;
    letter-spacing: 0.05em;
}

.highlight {
    color: var(--accent-primary);
}

/* ─────────────────────────────────────────────────────────────────
   HINT SECTION
   ───────────────────────────────────────────────────────────────── */
.hint-section {
    display: flex;
    justify-content: center;
}

.hint-box {
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-left: 3px solid var(--accent-primary);
    padding: 1.25rem 1.5rem;
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
    max-width: 500px;
}

.hint-text {
    color: var(--text-secondary);
    font-style: italic;
    font-size: 1rem;
    text-align: center;
}

/* ─────────────────────────────────────────────────────────────────
   AD SECTION
   ───────────────────────────────────────────────────────────────── */
.ad-section {
    display: flex;
    justify-content: center;
    padding: 1.5rem 0;
}

.ad-container {
    width: 100%;
    max-width: 728px;
    min-height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ad-placeholder {
    width: 100%;
    height: 90px;
    background: var(--bg-secondary);
    border: 1px dashed var(--border-primary);
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ─────────────────────────────────────────────────────────────────
   FOOTER
   ───────────────────────────────────────────────────────────────── */
.footer {
    margin-top: auto;
    padding-top: 2rem;
    text-align: center;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.copyright {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.footer-nav {
    display: flex;
    gap: 1.5rem;
}

.footer-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    transition: color var(--transition-fast);
}

.footer-link:hover {
    color: var(--accent-primary);
}

.footer-decoration {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.decoration-line {
    width: 80px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-primary), transparent);
}

.decoration-symbol {
    color: var(--accent-primary);
    font-size: 0.75rem;
    opacity: 0.5;
}

/* ─────────────────────────────────────────────────────────────────
   RESPONSIVE DESIGN
   ───────────────────────────────────────────────────────────────── */

/* Tablet */
@media (max-width: 768px) {
    :root {
        font-size: 15px;
    }
    
    .container {
        padding: 1.5rem 1rem;
    }
    
    .logo-text {
        font-size: 1.8rem;
        letter-spacing: 0.2em;
    }
    
    .logo-symbol {
        font-size: 1.2rem;
    }
    
    .tagline {
        font-size: 0.85rem;
    }
    
    .puzzle-frame {
        padding: 1rem;
    }
    
    .puzzle-image {
        min-height: 250px;
    }
}

/* Mobile */
@media (max-width: 480px) {
    :root {
        font-size: 14px;
    }
    
    .container {
        padding: 1rem 0.75rem;
    }
    
    .logo {
        flex-wrap: wrap;
    }
    
    .logo-text {
        font-size: 1.5rem;
        letter-spacing: 0.15em;
    }
    
    .logo-symbol {
        display: none;
    }
    
    .tagline {
        font-size: 0.75rem;
    }
    
    .puzzle-frame {
        padding: 0.75rem;
        border-radius: 6px;
    }
    
    .puzzle-image {
        min-height: 200px;
    }
    
    .download-btn {
        padding: 0.875rem 1.5rem;
        font-size: 0.9rem;
    }
    
    .instruction-text {
        font-size: 0.85rem;
    }
    
    .hint-box {
        padding: 1rem;
    }
    
    .hint-text {
        font-size: 0.9rem;
    }
    
    .ad-placeholder {
        height: 70px;
    }
}

/* ─────────────────────────────────────────────────────────────────
   ACCESSIBILITY
   ───────────────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation: none !important;
        transition: none !important;
    }
}

/* Focus States */
.download-btn:focus,
.footer-link:focus {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

/* ─────────────────────────────────────────────────────────────────
   PRINT STYLES (Hide unnecessary elements)
   ───────────────────────────────────────────────────────────────── */
@media print {
    .bg-effects,
    .ad-section,
    .download-btn,
    .scan-line {
        display: none !important;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .puzzle-image {
        max-width: 100%;
    }
}