/* ===== CSS Variables & Reset ===== */
:root {
    /* Colors */
    --primary: #8b5cf6;
    --primary-dark: #7c3aed;
    --primary-light: #a78bfa;
    --secondary: #06b6d4;
    --secondary-dark: #0891b2;
    --accent: #ec4899;
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;

    /* Background */
    --bg-primary: #0f0f23;
    --bg-secondary: #1a1a2e;
    --bg-tertiary: #16213e;
    --bg-card: rgba(26, 26, 46, 0.6);
    --bg-card-hover: rgba(26, 26, 46, 0.8);

    /* Text */
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;

    /* Border */
    --border-color: rgba(139, 92, 246, 0.2);
    --border-hover: rgba(139, 92, 246, 0.4);

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px rgba(139, 92, 246, 0.3);

    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;

    /* Border Radius */
    --radius-sm: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 350ms ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: radial-gradient(circle at top right, #1e1e3f, #0f0f23), linear-gradient(135deg, #0f0f23 0%, #1a1a2e 50%, #16213e 100%);
    background-attachment: fixed;
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--primary), var(--secondary));
    border-radius: 6px;
    border: 2px solid var(--bg-secondary);
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--primary-light), var(--secondary));
}

/* ===== Container ===== */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

/* ===== Header ===== */
.header {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    padding: var(--spacing-md) 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-md);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--spacing-lg);
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, var(--primary-light), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-transform: uppercase;
}

.logo-icon {
    width: 32px;
    height: 32px;
    color: var(--primary);
    filter: drop-shadow(0 0 8px rgba(139, 92, 246, 0.5));
}

.nav {
    display: flex;
    gap: var(--spacing-sm);
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-sm) var(--spacing-md);
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-base);
}

.nav-btn svg {
    width: 20px;
    height: 20px;
}

.nav-btn:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
    color: var(--text-primary);
    transform: translateY(-2px);
}

.nav-btn.active {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-color: transparent;
    color: white;
    box-shadow: var(--shadow-glow);
}

/* ===== Main Content ===== */
.main {
    padding: var(--spacing-xl) 0;
    min-height: calc(100vh - 200px);
}

.tab-content {
    display: none;
    animation: fadeIn var(--transition-base);
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section-header {
    text-align: center;
    margin-bottom: var(--spacing-xl);
}

.section-title {
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: var(--spacing-sm);
    background: linear-gradient(135deg, #fff 0%, var(--primary-light) 50%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-description {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* ===== Cards ===== */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
}

.card:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.card-header {
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-sm);
    border-bottom: 1px solid var(--border-color);
}

.card-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.card-body {
    color: var(--text-secondary);
}

/* ===== Upload Zone ===== */
.upload-card {
    margin-bottom: var(--spacing-xl);
}

.upload-zone {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-base);
}

.upload-zone:hover {
    border-color: var(--primary);
    background: var(--bg-card-hover);
    box-shadow: var(--shadow-glow);
    transform: scale(1.02);
}

.upload-zone.dragover {
    border-color: var(--secondary);
    background: rgba(6, 182, 212, 0.1);
    box-shadow: 0 0 30px rgba(6, 182, 212, 0.3);
}

.upload-icon {
    width: 64px;
    height: 64px;
    color: var(--primary);
    margin-bottom: var(--spacing-md);
    filter: drop-shadow(0 0 10px rgba(139, 92, 246, 0.4));
}

.upload-zone h3 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: var(--spacing-xs);
    color: var(--text-primary);
    transition: all var(--transition-base);
}

.upload-zone.has-file {
    border-style: solid;
    border-color: var(--success);
    background: rgba(16, 185, 129, 0.05);
}

.upload-zone.has-file .upload-icon {
    color: var(--success);
}

.upload-zone.has-file h3 {
    color: var(--success);
}

.upload-zone p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* ===== Image Preview ===== */
.image-preview {
    width: 100%;
    max-height: 500px;
    object-fit: contain;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
}

/* ===== Properties Grid ===== */
.properties-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: var(--spacing-md);
}

.property-item {
    background: rgba(139, 92, 246, 0.05);
    padding: var(--spacing-sm);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--primary);
}

.property-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
}

.property-value {
    font-size: 1rem;
    color: var(--text-primary);
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
}

/* ===== Map ===== */
.map-container {
    height: 400px;
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-top: var(--spacing-md);
    box-shadow: var(--shadow-md);
}

/* ===== Mode Selector ===== */
.mode-selector {
    display: flex;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-xl);
    justify-content: center;
}

.mode-btn {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-md) var(--spacing-lg);
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    color: var(--text-secondary);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
    min-width: 250px;
    justify-content: center;
}

.mode-btn svg {
    width: 24px;
    height: 24px;
}

.mode-btn:hover {
    border-color: var(--border-hover);
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.mode-btn.active {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-color: transparent;
    color: white;
    box-shadow: var(--shadow-glow);
}

.stego-mode {
    display: none;
}

.stego-mode.active {
    display: block;
    animation: fadeIn var(--transition-base);
}

/* ===== Forms ===== */
.form-group {
    margin-bottom: var(--spacing-md);
}

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: var(--spacing-xs);
    color: var(--text-primary);
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group textarea {
    width: 100%;
    padding: var(--spacing-sm);
    background: rgba(15, 15, 35, 0.5);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.95rem;
    transition: all var(--transition-base);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.form-group small {
    display: block;
    margin-top: var(--spacing-xs);
    color: var(--text-muted);
    font-size: 0.85rem;
}

.form-group input[type="checkbox"] {
    width: auto;
    margin-right: var(--spacing-xs);
    accent-color: var(--primary);
}

.capacity-info {
    margin-top: var(--spacing-md);
    padding: var(--spacing-sm);
    background: rgba(6, 182, 212, 0.1);
    border-left: 3px solid var(--secondary);
    border-radius: var(--radius-sm);
    color: var(--secondary);
    font-weight: 500;
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-sm) var(--spacing-lg);
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all var(--transition-base);
    text-decoration: none;
}

.btn svg {
    width: 20px;
    height: 20px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    box-shadow: var(--shadow-glow);
    transform: translateY(-2px);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
}

.btn-large {
    width: 100%;
    padding: var(--spacing-md) var(--spacing-lg);
    font-size: 1.1rem;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* ===== Progress ===== */
.progress-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-md);
}

.progress-stat {
    background: rgba(139, 92, 246, 0.05);
    padding: var(--spacing-sm);
    border-radius: var(--radius-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.stat-value {
    color: var(--primary-light);
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(15, 15, 35, 0.5);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: var(--spacing-md);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 4px;
    transition: width var(--transition-base);
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.5);
}

/* ===== Analysis Grid ===== */
.analysis-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-lg);
}

.analysis-item {
    text-align: center;
}

.analysis-item h3 {
    font-size: 1rem;
    margin-bottom: var(--spacing-sm);
    color: var(--text-secondary);
}

.analysis-item canvas {
    width: 100%;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
}

/* ===== Results ===== */
.results-container {
    animation: fadeIn var(--transition-slow);
}

#extracted-content {
    background: rgba(15, 15, 35, 0.5);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    font-family: 'JetBrains Mono', monospace;
    white-space: pre-wrap;
    word-break: break-all;
    max-height: 400px;
    overflow-y: auto;
}

/* ===== Footer ===== */
.footer {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border-top: 1px solid var(--border-color);
    padding: var(--spacing-lg) 0;
    text-align: center;
    color: var(--text-muted);
    margin-top: var(--spacing-xl);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: var(--spacing-md);
    }

    .nav {
        width: 100%;
        flex-direction: column;
    }

    .nav-btn {
        width: 100%;
        justify-content: center;
    }

    .mode-selector {
        flex-direction: column;
    }

    .mode-btn {
        width: 100%;
    }

    .section-title {
        font-size: 2rem;
    }

    .properties-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== Animations ===== */
@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.loading {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }

    100% {
        background-position: 1000px 0;
    }
}

.shimmer {
    background: linear-gradient(90deg, transparent, rgba(139, 92, 246, 0.2), transparent);
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
}

/* ===== Toggle Switch ===== */
.toggle-wrapper {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    background: rgba(139, 92, 246, 0.05);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
}

.toggle-wrapper:hover {
    background: rgba(139, 92, 246, 0.1);
    border-color: var(--primary);
}

.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
    flex-shrink: 0;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--bg-tertiary);
    transition: .4s;
    border: 1px solid var(--border-color);
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: var(--text-muted);
    transition: .4s;
    border-radius: 50%;
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

input:checked+.slider {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-color: transparent;
}

input:focus+.slider {
    box-shadow: 0 0 1px var(--primary);
}

input:checked+.slider:before {
    transform: translateX(24px);
    background-color: white;
}

.toggle-label {
    display: flex;
    flex-direction: column;
}

.toggle-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.toggle-badge {
    font-size: 0.7rem;
    padding: 2px 6px;
    background: linear-gradient(135deg, var(--accent), #f43f5e);
    color: white;
    border-radius: 10px;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.toggle-description {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.4;
}

/* ===== Cyber Loader ===== */
.loader-container {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-xl);
    gap: var(--spacing-md);
}

.cyber-spinner {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid transparent;
    border-top-color: var(--primary);
    animation: spin 1.5s linear infinite;
}

.cyber-spinner:before {
    content: "";
    position: absolute;
    top: 5px;
    left: 5px;
    right: 5px;
    bottom: 5px;
    border-radius: 50%;
    border: 3px solid transparent;
    border-top-color: var(--secondary);
    animation: spin 2s linear infinite;
}

.cyber-spinner:after {
    content: "";
    position: absolute;
    top: 15px;
    left: 15px;
    right: 15px;
    bottom: 15px;
    border-radius: 50%;
    border: 3px solid transparent;
    border-top-color: var(--accent);
    animation: spin 1s linear infinite;
}

.loader-text {
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Enhancing Toggle UI to be "Better" */
.switch {
    width: 60px;
    height: 30px;
}

.slider:before {
    height: 22px;
    width: 22px;
    left: 4px;
    bottom: 3px;
}

input:checked+.slider:before {
    transform: translateX(29px);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.slider {
    border-radius: 34px;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.5);
    background-color: #0f172a;
}

input:checked+.slider {
    background: linear-gradient(90deg, #8b5cf6, #06b6d4);
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.4);
}