/* 
   Gemini Project - Cyberpunk Minimalist Design System 
   Aesthetic: High-Tech, Dark Mode, Neon Accents, Glassmorphism
*/

/* Google Fonts - Using system fonts for better performance */
/* @import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=JetBrains+Mono:wght@400;500&family=Outfit:wght@300;400;500;600;700&display=swap'); */

:root {
    /* Color Palette */
    --bg-dark: #050507;
    --bg-panel: #0f1014;
    --bg-card: rgba(22, 23, 28, 0.6);

    --primary: #00f3ff;
    /* Electric Cyan */
    --primary-dim: rgba(0, 243, 255, 0.1);
    --secondary: #bc13fe;
    /* Deep Purple */
    --secondary-dim: rgba(188, 19, 254, 0.1);
    --accent: #ff0055;
    /* Cyber Red */

    --text-main: #e0e0e0;
    --text-muted: #8a8b98;
    --text-highlight: #ffffff;

    --border-color: rgba(255, 255, 255, 0.08);
    --border-focus: rgba(0, 243, 255, 0.5);

    --glass-bg: rgba(255, 255, 255, 0.02);
    --glass-border: 1px solid rgba(255, 255, 255, 0.05);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);

    /* Spacing & Layout */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 16px;

    --font-heading: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    --font-mono: 'Consolas', 'Monaco', 'Courier New', monospace;
}

[data-theme="light"] {
    /* Light Mode Palette */
    --bg-dark: #f0f2f5;
    --bg-panel: #ffffff;
    --bg-card: rgba(255, 255, 255, 0.8);

    --primary: #0088cc;
    /* Darker Cyan/Blue for visibility on white */
    --primary-dim: rgba(0, 136, 204, 0.1);
    --secondary: #9c27b0;
    --secondary-dim: rgba(156, 39, 176, 0.1);
    --accent: #d81b60;

    --text-main: #333333;
    --text-muted: #666666;
    --text-highlight: #000000;

    --border-color: rgba(0, 0, 0, 0.1);
    --border-focus: rgba(0, 136, 204, 0.5);

    --glass-bg: rgba(255, 255, 255, 0.6);
    --glass-border: 1px solid rgba(0, 0, 0, 0.05);
    --glass-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

/* Reset & Base */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    background-image:
        radial-gradient(circle at 15% 50%, rgba(188, 19, 254, 0.05) 0%, transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(0, 243, 255, 0.05) 0%, transparent 25%);
    background-attachment: fixed;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    color: var(--text-highlight);
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-bottom: 1rem;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: all 0.2s ease;
}

a:hover {
    color: #fff;
    text-shadow: 0 0 8px var(--primary);
}

/* Utilities */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--glass-shadow);
}

.text-gradient {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Components: Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-family: var(--font-heading);
    font-weight: 500;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.85rem;
}

.btn-primary {
    background: linear-gradient(135deg, rgba(0, 243, 255, 0.1) 0%, rgba(0, 243, 255, 0.05) 100%);
    border-color: rgba(0, 243, 255, 0.3);
    color: var(--primary);
    box-shadow: 0 0 15px rgba(0, 243, 255, 0.1);
}

.btn-primary:hover {
    background: linear-gradient(135deg, rgba(0, 243, 255, 0.2) 0%, rgba(0, 243, 255, 0.1) 100%);
    border-color: var(--primary);
    box-shadow: 0 0 25px rgba(0, 243, 255, 0.3);
    color: #fff;
    transform: translateY(-1px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.15);
    color: var(--text-main);
}

[data-theme="light"] .btn-secondary {
    background: white;
    border-color: var(--border-color);
    color: var(--text-muted);
}

.btn-secondary:hover {
    border-color: var(--text-muted);
    color: var(--text-highlight);
    background: rgba(255, 255, 255, 0.1);
}

[data-theme="light"] .btn-secondary:hover {
    background: #f5f5f5;
    color: var(--text-main);
}

/* Components: Forms */
.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    font-family: var(--font-heading);
}

input,
select,
textarea {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    padding: 0.8rem 1rem;
    border-radius: var(--radius-md);
    color: var(--text-highlight);
    font-family: var(--font-body);
    transition: all 0.2s ease;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-dim);
    background: rgba(0, 0, 0, 0.4);
}

/* Layouts */
.landing-wrapper {
    display: flex;
    min-height: 100vh;
    width: 100%;
    background-color: var(--bg-dark);
}

.info-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 4rem;
    position: relative;
    background-size: cover;
    background-position: center;
    overflow: hidden;
}

.info-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(5, 5, 7, 0.9) 0%, rgba(5, 5, 7, 0.4) 100%);
    z-index: 1;
}

[data-theme="light"] .info-section::before {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.8) 100%);
}

.info-content {
    position: relative;
    z-index: 2;
    max-width: 600px;
}

.info-content h1 {
    font-size: 3.5rem;
    line-height: 1.1;
    margin-bottom: 1.5rem;
}

.feature-list {
    list-style: none;
    margin: 2.5rem 0;
}

.feature-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.feature-item i {
    font-size: 1.5rem;
    color: var(--primary);
    margin-top: 0.2rem;
}

.feature-text h3 {
    font-size: 1.1rem;
    margin-bottom: 0.2rem;
}

.feature-text p {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.auth-section {
    width: 480px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: var(--bg-panel);
    border-left: 1px solid var(--border-color);
    position: relative;
    z-index: 10;
}

@media (max-width: 1024px) {
    .info-content h1 {
        font-size: 2.5rem;
    }
}

@media (max-width: 900px) {
    .landing-wrapper {
        flex-direction: column;
    }

    .info-section {
        padding: 3rem 2rem;
        min-height: auto;
    }

    .auth-section {
        width: 100%;
        border-left: none;
        border-top: 1px solid var(--border-color);
        padding: 3rem 1.5rem;
    }

    .auth-card {
        width: 100%;
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .info-content h1 {
        font-size: 2rem;
    }

    .info-section {
        padding: 2rem 1.5rem;
    }
}

.auth-wrapper {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    position: relative;
}

@media (max-width: 1024px) {
    .landing-wrapper {
        flex-direction: column;
    }

    .info-section {
        padding: 3rem 2rem;
        min-height: 40vh;
    }

    .auth-section {
        width: 100%;
        border-left: none;
        border-top: 1px solid var(--border-color);
        padding: 4rem 2rem;
    }

    .info-content h1 {
        font-size: 2.5rem;
    }
}

.auth-card {
    width: 100%;
    max-width: 400px;
    padding: 2.5rem;
    position: relative;
    z-index: 10;
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-header h2 {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}

.auth-header p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Main App Layout */
.app-container {
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: 100vh;
}

.sidebar {
    background: var(--bg-panel);
    border-right: 1px solid var(--border-color);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
}

.main-content {
    padding: 2rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    position: relative;
}

/* Cards & Results */
.result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.5rem;
}

.result-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.result-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary);
    box-shadow: 0 10px 30px -10px rgba(0, 243, 255, 0.15);
}

.result-image {
    width: 100%;
    aspect-ratio: 1;
    background: #050507;
    /* Matches dark bg */
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

[data-theme="light"] .result-image {
    background: #ffffff;
}

.result-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.5s ease;
}

.result-card:hover .result-image img {
    transform: scale(1.05);
}

.result-info {
    padding: 1rem;
    border-top: 1px solid var(--border-color);
}

.result-title {
    font-size: 0.9rem;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.score-badge {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: rgba(0, 0, 0, 0.7);
    color: var(--primary);
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-family: var(--font-mono);
    border: 1px solid var(--primary-dim);
    backdrop-filter: blur(4px);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease forwards;
}

/* Flash Messages */
.flash {
    padding: 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

.flash.success {
    background: rgba(0, 255, 136, 0.1);
    border: 1px solid rgba(0, 255, 136, 0.3);
    color: #00ff88;
}

.flash.error {
    background: rgba(255, 0, 85, 0.1);
    border: 1px solid rgba(255, 0, 85, 0.3);
    color: #ff0055;
}

/* Input File Custom */
.file-upload-wrapper {
    position: relative;
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
    background: var(--bg-card);
    cursor: pointer;
}

.file-upload-wrapper:hover {
    border-color: var(--primary);
    background: rgba(0, 243, 255, 0.02);
}


/* Tables */
.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    font-size: 0.9rem;
}

th,
td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    font-family: var(--font-heading);
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.75rem;
}

td {
    color: var(--text-main);
}

tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

/* Status Tags */
.status-tag {
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    display: inline-block;
}

.status-tag.admin {
    background: rgba(0, 243, 255, 0.1);
    color: var(--primary);
    border: 1px solid rgba(0, 243, 255, 0.2);
}

.status-tag.paid {
    background: rgba(188, 19, 254, 0.1);
    color: var(--secondary);
    border: 1px solid rgba(188, 19, 254, 0.2);
}

.status-tag.free {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.status-tag.approved {
    color: #00ff88;
}

.status-tag.pending {
    color: #ffc107;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: var(--bg-panel);
    margin: 10% auto;
    padding: 2rem;
    border: 1px solid var(--border-color);
    width: 100%;
    max-width: 500px;
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    position: relative;
    animation: fadeIn 0.3s ease;
}

.close {
    color: var(--text-muted);
    float: right;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

.close:hover {
    color: var(--text-highlight);
}

/* Promotional Sections (Landing Page) */
.promo-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 6rem 2rem;
    display: flex;
    flex-direction: column;
    gap: 8rem;
}

.promo-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.promo-text h2 {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.promo-text p {
    font-size: 1.1rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.promo-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.8rem;
    background: var(--primary-dim);
    color: var(--primary);
    border: 1px solid var(--border-focus);
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 1rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.promo-visual {
    position: relative;
}

.promo-visual img {
    width: 100%;
    height: auto;
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    transition: transform 0.4s ease;
    display: block;
}

.promo-visual img:hover {
    transform: translateY(-8px);
}

@media (max-width: 900px) {
    .promo-section {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 2.5rem;
    }

    .promo-section.left-image .promo-visual {
        order: -1;
    }
}

/* ========== Mobile Overrides (Plan A) ========== */
.hamburger-btn {
    display: none;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-main);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    outline: none;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 999;
    backdrop-filter: blur(3px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* Fixed Image Preview Box */
#image-preview {
    text-align: center;
    background: rgba(0, 0, 0, 0.2);
}

#image-preview img {
    width: 200x !important;
    height: 200px !important;
    object-fit: contain;
    margin: 0 auto;
    display: block;
}

/* Sidebar scroll fix wrapper */
.sidebar {
    overflow-y: auto;
    /* enable scrolling internally */
}

@media (max-width: 768px) {
    .hamburger-btn {
        display: flex;
    }

    .app-container {
        display: block;
    }

    .sidebar {
        position: fixed;
        left: -320px;
        top: 0;
        bottom: 0;
        width: 280px;
        z-index: 1000;
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        border-right: 1px solid var(--border-color);
        background: var(--bg-panel);
    }

    .sidebar.active {
        left: 0;
        box-shadow: 10px 0 30px rgba(0, 0, 0, 0.5);
    }

    .main-content {
        padding: 1.5rem 1rem;
    }

    .result-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        gap: 0.8rem;
    }

    .modal-content {
        padding: 1.5rem;
        margin: 5% auto;
    }

    .promo-container {
        padding: 3rem 1.5rem;
        gap: 4rem;
    }

    .mobile-wrap {
        flex-wrap: wrap;
    }

    .mobile-gap-sm {
        gap: 0.25rem !important;
    }
}

/* Instruction Overlay (Desktop only) */
.main-content {
    position: relative;
    /* necessary for absolute overlay */
}

@media (max-width: 768px) {
    .desktop-only {
        display: none !important;
    }
}