/* static/css/styles.css */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;700&family=Space+Mono:wght@400;700&display=swap');

:root {
    /* Quantum Palette */
    --bg-color: transparent;
    /* Allow Canvas to show */
    /* --bg-gradient: ... Removed to let Canvas handle background */

    --card-bg: rgba(13, 20, 31, 0.75);
    --card-border: rgba(0, 243, 255, 0.15);

    --primary-color: #00f3ff;
    /* Cyan Neon */
    --primary-glow: rgba(0, 243, 255, 0.4);

    --secondary-color: #7000ff;
    /* Deep Neon Purple */
    --text-color: #e0e6ed;
    --text-muted: #94a3b8;

    --success-color: #00ff9d;
    --error-color: #ff0055;

    --font-main: 'Outfit', sans-serif;
    --font-mono: 'Space Mono', monospace;

    --glass-blur: blur(12px);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-color);
    /* Transparent */
    /* background-image: var(--bg-gradient); Removed */
    background-attachment: fixed;
    color: var(--text-color);
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #0a0e17;
}

::-webkit-scrollbar-thumb {
    background: #1e3a5f;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

/* Typography */
h1,
h2,
h3 {
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #fff;
}

h1 {
    text-align: center;
    font-size: 2.5rem;
    background: linear-gradient(135deg, #fff 0%, var(--primary-color) 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 20px rgba(0, 243, 255, 0.3);
    margin: 40px 0 10px;
}

h2 {
    font-size: 1.4rem;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--card-border);
    padding-bottom: 10px;
    display: flex;
    align-items: center;
    word-spacing: 0.25em;
    /* Increase space visibility */
}

h2::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    background: var(--primary-color);
    margin-right: 10px;
    box-shadow: 0 0 10px var(--primary-color);
    border-radius: 50%;
}

h2::after {
    content: none;
    /* Remove bracket style */
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    text-shadow: 0 0 8px var(--primary-glow);
}

p {
    line-height: 1.6;
    color: var(--text-muted);
}

/* Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 25px;
    padding-bottom: 40px;
}

@media (max-width: 768px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

/* Glassmorphism Cards (Restored) */
.glass-panel {
    background: var(--card-bg);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

/* Remove corner decorations */
.glass-panel::before,
.glass-panel::after {
    display: none;
}


/* Dashboard Grid Layout */
.dashboard-grid-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    width: 100%;
}

@media (max-width: 900px) {
    .dashboard-grid-container {
        grid-template-columns: 1fr;
    }
}

/* Utility to span full width in grid */
.grid-full-width {
    grid-column: 1 / -1;
}

.glass-panel:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0, 243, 255, 0.1);
    border-color: rgba(0, 243, 255, 0.3);
}

.glass-panel::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
    opacity: 0.5;
}

/* Navbar */
.navbar {
    background: rgba(3, 5, 8, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--card-border);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--primary-color);
    letter-spacing: -0.05em;
    white-space: nowrap;
    /* Prevent "QUANTUM GEM" from stacking */
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 15px;
    /* Reduced gap slightly since links have padding now */
}

.nav-links a {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;

    /* Pill Style (Same as auth-status) */
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.2s ease;
}

.nav-links a:hover,
.nav-links a.active {
    color: #fff;
    border-color: var(--primary-color);
    background: rgba(0, 243, 255, 0.1);
    box-shadow: 0 0 10px rgba(0, 243, 255, 0.2);
}


/* Auth Status Badge */
.auth-status {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    /* Slightly tighter */
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    font-size: 0.85rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    white-space: nowrap;
}

.auth-status span {
    color: #fff;
    font-weight: 600;
    margin-left: 5px;
}

/* Mobile Toggle - Hidden on Desktop */
.mobile-toggle {
    display: none;
    background: var(--primary-color);
    /* Cyan Background */
    color: #000;
    /* Black Icon */
    border: none;
    border-radius: 8px;
    /* Matching screenshot button shape */
    font-size: 1.2rem;
    padding: 8px 12px;
    cursor: pointer;
    z-index: 101;
    box-shadow: 0 0 15px var(--primary-glow);
}

/* --- RESPONSIVE DESIGN UPDATES --- */

/* Mobile (Tablet & Phone) */
@media (max-width: 768px) {
    .nav-content {
        /* Keep horizontal row for Logo + Toggle */
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        position: relative;
        padding-left: 10px;
        /* Override container padding */
        padding-right: 10px;
        /* Override container padding */
        width: 100%;
        /* Ensure full width usage */
    }

    /* Override generic container padding ensuring wider reach */
    .navbar .container {
        padding: 0 10px;
    }

    /* Show Toggle */
    .mobile-toggle {
        display: block;
    }

    .brand {
        font-size: 1.3rem;
        margin-bottom: 0;
    }

    /* Mobile Menu - Initially Hidden/Collapsed */
    .nav-links {
        display: none;
        /* Hidden by default */
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: rgba(5, 5, 5, 0.98);
        flex-direction: column;
        align-items: center;
        padding: 20px;
        border-bottom: 1px solid var(--card-border);
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
        gap: 20px;
        z-index: 100;
        backdrop-filter: blur(10px);
    }

    /* Active State (Toggled via JS) */
    .nav-links.active {
        display: flex;
        animation: slideDown 0.3s ease forwards;
    }

    .nav-links a {
        font-size: 1.1rem;
        padding: 12px 20px;
        /* Bigger touch target */
        width: 100%;
        max-width: 300px;
        /* Prevent full-width stretch */
        text-align: center;
        justify-content: center;
        border-radius: 50px;
        /* FORCE PILL SHAPE */
        border: 1px solid rgba(255, 255, 255, 0.1);
        background: rgba(255, 255, 255, 0.05);
        margin-bottom: 0px;
        /* Gap handles spacing */
    }

    .auth-status {
        order: -1;
        width: 100%;
        justify-content: center;
        margin-bottom: 10px;
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--primary-color);
}

input[type="text"],
input[type="password"],
textarea {
    width: 100%;
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.05);
    /* Lighter background */
    border: 1px solid rgba(0, 255, 157, 0.2);
    /* Teal hint border */
    border-radius: 8px;
    color: #fff;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    transition: var(--transition);
}

input:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 15px rgba(0, 243, 255, 0.1);
    background: rgba(0, 0, 0, 0.5);
    border-bottom: 1px solid rgba(0, 255, 157, 0.2);
    /* Reset terminal style */
}

/* Checkbox */
input[type="checkbox"] {
    accent-color: var(--primary-color);
    width: 16px;
    height: 16px;
    margin-right: 10px;
    vertical-align: middle;
}

/* Buttons */
button {
    background: rgba(0, 243, 255, 0.1);
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    padding: 12px 24px;
    border-radius: 8px;
    font-family: var(--font-main);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

button:hover {
    background: var(--primary-color);
    color: #000;
    box-shadow: 0 0 20px var(--primary-glow);
}

button.btn-danger {
    color: var(--error-color);
    border-color: var(--error-color);
    background: rgba(255, 0, 85, 0.1);
}

button.btn-danger:hover {
    background: var(--error-color);
    color: #fff;
    box-shadow: 0 0 20px rgba(255, 0, 85, 0.4);
}

/* Response Box */
.response-box {
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid #333;
    border-radius: 8px;
    /* Restore radius */
    border-left: 1px solid #333;
    /* Restore border */
    padding: 15px;
    margin-top: 15px;
    font-family: 'Space Mono', monospace;
    font-size: 0.85rem;
    color: #0f0;
    overflow-x: auto;
    min-height: 60px;

    /* Expandable Logic */
    max-height: 150px;
    overflow-y: auto;
    /* Scrollable if content exceeds */
    cursor: pointer;
    transition: max-height 0.3s ease-in-out;
    position: relative;
    box-shadow: none;
}

.response-box.expanded {
    max-height: 1000px;
    /* Large enough to show full JSON */
}

/* Optional: Scrollbar styling specific to this box */
.response-box::-webkit-scrollbar {
    width: 6px;
}

.response-box::-webkit-scrollbar-thumb {
    background: #333;
}

/* Utility */
.text-center {
    text-align: center;
}

.mt-4 {
    margin-top: 1rem;
}


/* Footer */
footer {
    margin-top: auto;
    padding: 20px;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.3);
}

/* Messages */
.messages li {
    padding: 10px;
    margin-bottom: 20px;
    border-radius: 8px;
    text-align: center;
}

.messages .success {
    background: rgba(0, 255, 157, 0.1);
    color: var(--success-color);
    border: 1px solid var(--success-color);
}

.messages .error {
    background: rgba(255, 0, 85, 0.1);
    color: var(--error-color);
    border: 1px solid var(--error-color);
}

/* =========================================
   About Page Profile Card
   ========================================= */
.profile-card {
    padding: 0;
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    overflow: hidden;
    border: 1px solid var(--card-border);
    text-align: left;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 16px;
}

.profile-image-section {
    flex: 1;
    min-width: 300px;
    position: relative;
}

.profile-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    min-height: 400px;
    border-right: 1px solid var(--card-border);
    display: block;
}

.social-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.8);
    padding: 15px;
    display: flex;
    justify-content: center;
    gap: 20px;
    backdrop-filter: blur(5px);
}

.social-overlay a {
    transition: transform 0.2s ease, opacity 0.2s;
}

.social-overlay a:hover {
    transform: translateY(-3px);
    opacity: 0.8;
}

.profile-info-section {
    flex: 1.5;
    padding: 40px;
    min-width: 300px;
}

.profile-name {
    font-size: 2rem;
    margin: 0 0 5px;
    border: none;
    padding: 0;
}

.profile-title {
    color: var(--primary-color);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 25px;
}

.profile-intro {
    background: rgba(255, 255, 255, 0.05);
    border-left: 3px solid var(--primary-color);
    padding: 15px;
    margin-bottom: 25px;
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.6;
    border-radius: 0 8px 8px 0;
}

.contact-row {
    display: flex;
    align-items: center;
    gap: 15px;
    color: var(--text-muted);
}

.contact-icon {
    width: 20px;
    color: var(--primary-color);
    text-align: center;
}

.contact-link {
    color: #fff;
    text-decoration: none;
    transition: color 0.2s;
}

.contact-link:hover {
    color: var(--primary-color);
}

.resume-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--primary-color);
    color: #000;
    padding: 12px 25px;
    border-radius: 50px;
    font-weight: 700;
    text-transform: uppercase;
    text-decoration: none;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.resume-btn:hover {
    box-shadow: 0 0 20px var(--primary-glow);
    transform: translateY(-2px);
}

/* Responsive Mobile Fixes */
@media (max-width: 768px) {
    .profile-card {
        flex-direction: column;
        margin: 0;
        border-radius: 12px;
    }

    .profile-image-section {
        min-width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--card-border);
    }

    .profile-image {
        min-height: 350px;
        max-height: 450px;
    }

    .profile-info-section {
        padding: 20px;
        /* Reduced from 25px */
        min-width: 0;
        /* Override 300px min-width to prevent overflow */
        width: 100%;
    }

    .profile-name {
        font-size: 1.8rem;
    }

    .profile-title {
        font-size: 0.9rem;
    }
}

/* Custom Wrapper for About Page */
.about-panel {
    text-align: center;
    padding: 40px;
}

@media (max-width: 600px) {
    .about-panel {
        padding: 15px;
        /* Drastically reduce padding on mobile */
    }
}

/* Threat Toggle Button */
.btn-toggle-threat {
    /* Inherit standard button styles (Cyan/Glass) */
    /* Only specific overrides below */
    transition: all 0.3s ease;
}

.btn-toggle-threat:hover {
    /* Standard hover effect applies automatically */
    box-shadow: 0 0 15px var(--primary-glow);
}

.btn-toggle-threat.active {
    background: rgba(255, 0, 85, 0.2);
    border-color: var(--error-color);
    color: var(--error-color);
    box-shadow: 0 0 20px rgba(255, 0, 85, 0.4);
    animation: pulse-red 2s infinite;
}

.btn-toggle-threat.active:hover {
    background: var(--error-color);
    color: #fff;
}

@keyframes pulse-red {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 0, 85, 0.4);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(255, 0, 85, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(255, 0, 85, 0);
    }
}

/* =========================================
   Toast Notifications
   ========================================= */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: rgba(13, 20, 31, 0.95);
    backdrop-filter: var(--glass-blur);
    border-left: 4px solid var(--primary-color);
    border-radius: 8px;
    padding: 15px 20px;
    color: var(--text-color);
    font-family: var(--font-main);
    font-size: 0.95rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    min-width: 250px;
    max-width: 400px;
    transform: translateX(120%);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.4s ease;
    display: flex;
    align-items: center;
    gap: 12px;
}

.toast.show {
    transform: translateX(0);
    opacity: 1;
}

.toast.toast-error {
    border-left-color: var(--error-color);
    box-shadow: 0 4px 15px rgba(255, 0, 85, 0.2);
}

.toast.toast-success {
    border-left-color: var(--success-color);
    box-shadow: 0 4px 15px rgba(0, 255, 157, 0.2);
}

.toast.toast-warning {
    border-left-color: #ffcc00;
}

.toast-icon {
    font-size: 1.2rem;
}

.toast-error .toast-icon {
    color: var(--error-color);
}

.toast-success .toast-icon {
    color: var(--success-color);
}

.toast-warning .toast-icon {
    color: #ffcc00;
}

.toast-message {
    flex-grow: 1;
    line-height: 1.4;
}

.toast-close {
    cursor: pointer;
    color: var(--text-muted);
    transition: color 0.2s;
}

.toast-close:hover {
    color: #fff;
}