/* ======================================================
   NeoScan — Premium Design System
   ====================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

:root {
    --primary: #147efb;
    --primary-light: #54a0ff;
    --primary-dark: #0054b4;
    --accent: #00b894;
    --accent-light: #55efc4;
    --bg-dark: #090e1b;
    --bg-header: rgba(9, 14, 27, 0.8);
    --bg-card: rgba(255, 255, 255, 0.03);
    --bg-card-hover: rgba(255, 255, 255, 0.06);
    --bg-input: rgba(255, 255, 255, 0.03);
    --bg-dropzone: rgba(255, 255, 255, 0.005);
    --border: rgba(20, 126, 251, 0.12);
    --border-hover: rgba(20, 126, 251, 0.25);
    --text: #f3f4f6;
    --text-muted: #9ca3af;
    --text-dim: #5a6578;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    --radius: 16px;
    --radius-sm: 10px;
    --transition: 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

:root[data-theme="light"] {
    --primary: #147efb;
    --primary-light: #388af6;
    --primary-dark: #095bbd;
    --accent: #00b894;
    --accent-light: #55efc4;
    --bg-dark: #f0f4f8;
    --bg-header: rgba(255, 255, 255, 0.85);
    --bg-card: #ffffff;
    --bg-card-hover: #e6eef5;
    --bg-input: #f8fafc;
    --bg-dropzone: rgba(0, 0, 0, 0.005);
    --border: #d2e1f0;
    --border-hover: #b0cbdc;
    --text: #0f172a;
    --text-muted: #475569;
    --text-dim: #94a3b8;
    --shadow: 0 8px 30px rgba(15, 23, 42, 0.06);
}

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-dark);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
    background-image:
        radial-gradient(ellipse 80% 60% at 10% 0%, rgba(20, 126, 251, 0.14) 0%, transparent 60%),
        radial-gradient(ellipse 60% 50% at 90% 100%, rgba(0, 184, 148, 0.08) 0%, transparent 60%);
}

/* ── Container ── */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ── Header / Navigation ── */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg-header);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 1rem 0;
}

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

.logo {
    font-size: 1.4rem;
    font-weight: 900;
    text-decoration: none;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, var(--primary-light), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo-img {
    height: 60px;
    width: auto;
    display: block;
    transition: transform var(--transition);
}

.logo-img:hover {
    transform: scale(1.03);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color var(--transition);
}

.nav-links a:hover {
    color: var(--text);
}

.nav-user {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.nav-user strong {
    color: var(--accent);
}

/* ── Premium Nav Buttons ── */
.nav-btn-icon {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    outline: none;
}

.nav-btn-icon:hover {
    background: var(--bg-card-hover);
    color: var(--text);
    border-color: var(--border-hover);
    transform: translateY(-1px);
}

.nav-btn-lang {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 0 0.9rem;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    gap: 0.3rem;
    outline: none;
}

.nav-btn-lang:hover {
    background: var(--bg-card-hover);
    color: var(--text);
    border-color: var(--border-hover);
    transform: translateY(-1px);
}

.nav-link-login {
    color: var(--text-muted) !important;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 0.5rem 1.3rem;
    font-size: 0.85rem !important;
    font-weight: 600 !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 38px;
    transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
}

.nav-link-login:hover {
    background: var(--bg-card-hover);
    color: var(--text) !important;
    border-color: var(--border-hover);
    transform: translateY(-1px);
}

.nav-btn-register {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark)) !important;
    color: white !important;
    border-radius: 20px !important;
    padding: 0.5rem 1.5rem;
    font-size: 0.85rem !important;
    font-weight: 700 !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 38px;
    box-shadow: 0 4px 12px rgba(20, 126, 251, 0.2);
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
}

.nav-btn-register:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(20, 126, 251, 0.35);
    background: linear-gradient(135deg, var(--primary-light), var(--primary)) !important;
}

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.7rem 1.8rem;
    border: none;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all var(--transition);
    line-height: 1.4;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    box-shadow: 0 4px 15px rgba(20, 126, 251, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(20, 126, 251, 0.45);
}

.btn-primary:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-outline {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.btn-outline:hover {
    border-color: var(--border-hover);
    color: var(--text);
    background: var(--bg-card);
}

.btn-accent {
    background: linear-gradient(135deg, var(--accent), #00a884);
    color: white;
    box-shadow: 0 4px 15px rgba(0, 184, 148, 0.3);
}

.btn-accent:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(0, 184, 148, 0.45);
}

.btn-sm {
    padding: 0.5rem 1.2rem;
    font-size: 0.8rem;
}

.btn-lg {
    padding: 1rem 2.5rem;
    font-size: 1rem;
}

/* ── Cards ── */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2.5rem;
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
}

.card-compact {
    padding: 2rem;
}

/* ── Hero ── */
.hero {
    text-align: center;
    padding: 4rem 0 2rem;
}

.hero-title {
    font-size: 3rem;
    font-weight: 900;
    letter-spacing: -1.5px;
    line-height: 1.15;
    margin-bottom: 0.8rem;
}

.hero-title .gradient {
    background: linear-gradient(135deg, var(--primary-light), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 500px;
    margin: 0 auto;
}

/* ── Drop Zone ── */
.drop-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 3.5rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition);
    background: var(--bg-dropzone);
    position: relative;
}

.drop-zone:hover,
.drop-zone.dragover {
    border-color: var(--primary);
    background: rgba(20, 126, 251, 0.04);
}

.drop-zone-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    display: block;
}

.drop-zone h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
}

.drop-zone p {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.file-info {
    margin-top: 1rem;
    color: var(--accent);
    font-weight: 600;
    font-size: 0.9rem;
    display: none;
}

.file-info.visible {
    display: block;
}

/* ── Forms ── */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.4rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
}

.form-input {
    width: 100%;
    padding: 0.8rem 1rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: inherit;
    font-size: 0.95rem;
    transition: border-color var(--transition);
    outline: none;
}

.form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(20, 126, 251, 0.15);
}

.form-input::placeholder {
    color: var(--text-dim);
}

textarea.form-input {
    min-height: 100px;
    resize: vertical;
}

/* ── Alerts / Flash Messages ── */
.alert {
    padding: 0.8rem 1.2rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    border: 1px solid transparent;
}

.alert-error {
    background: rgba(20, 126, 251, 0.1);
    color: var(--primary-light);
    border-color: rgba(20, 126, 251, 0.2);
}

.alert-success {
    background: rgba(0, 184, 148, 0.1);
    color: var(--accent-light);
    border-color: rgba(0, 184, 148, 0.2);
}

/* ── Star Rating ── */
.star-rating {
    display: flex;
    flex-direction: row-reverse;
    justify-content: center;
    gap: 0.2rem;
}

.star-rating input {
    display: none;
}

.star-rating label {
    font-size: 2rem;
    color: var(--text-dim);
    cursor: pointer;
    transition: color var(--transition), transform 0.15s;
}

.star-rating label:hover,
.star-rating label:hover~label,
.star-rating input:checked~label {
    color: var(--primary);
}

.star-rating label:hover {
    transform: scale(1.2);
}

/* ── Success Page ── */
.success-icon {
    font-size: 4rem;
    color: var(--accent);
    margin-bottom: 1rem;
}

.detected-badge {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    background: rgba(0, 184, 148, 0.15);
    color: var(--accent);
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

/* ── Remaining Counter ── */
.remaining-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.remaining-badge.ok {
    background: rgba(0, 184, 148, 0.12);
    color: var(--accent);
}

.remaining-badge.low {
    background: rgba(20, 126, 251, 0.1);
    color: var(--primary-light);
}

.remaining-badge.none {
    background: rgba(20, 126, 251, 0.12);
    color: var(--primary-light);
}

/* ── File Counter Badge ── */
.file-counter-badge {
    background: rgba(20, 126, 251, 0.1);
    color: var(--primary-light);
    border: 1px solid rgba(20, 126, 251, 0.2);
    padding: 0.25rem 0.6rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    transition: all 0.3s ease;
}

.file-counter-badge.limit-reached {
    background: rgba(0, 184, 148, 0.1);
    color: var(--accent);
    border-color: rgba(0, 184, 148, 0.3);
    box-shadow: 0 0 8px rgba(0, 184, 148, 0.15);
}

/* ── Divider ── */
.divider {
    border: 0;
    border-top: 1px solid var(--border);
    margin: 2rem 0;
}

/* ── Footer ── */
.footer {
    text-align: center;
    padding: 3rem 0;
    color: var(--text-dim);
    font-size: 0.8rem;
}

/* ── Auth Link ── */
.auth-link {
    color: var(--primary-light);
    text-decoration: none;
    font-weight: 600;
    transition: color var(--transition);
}

.auth-link:hover {
    color: white;
}

/* ── Animations ── */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }

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

.animate {
    animation: fadeInUp 0.6s ease forwards;
}

.animate-delay-1 {
    animation-delay: 0.1s;
    opacity: 0;
}

.animate-delay-2 {
    animation-delay: 0.2s;
    opacity: 0;
}

.animate-delay-3 {
    animation-delay: 0.3s;
    opacity: 0;
}

/* ── Responsive Utilities ── */
.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-top: 2rem;
}

.admin-charts-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

/* ── Responsive ── */
@media (max-width: 992px) {
    .admin-charts-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 2.2rem;
    }

    .hero-subtitle {
        font-size: 0.95rem;
    }

    .card {
        padding: 1.8rem;
    }

    .drop-zone {
        padding: 2.5rem 1.5rem;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .header {
        padding: 0.6rem 0;
    }

    .nav {
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
        gap: 0 !important;
    }

    .logo {
        font-size: 1.15rem !important;
    }

    .logo-img {
        height: 40px !important;
    }

    .nav-links {
        gap: 0.35rem !important;
        width: auto !important;
        justify-content: flex-end !important;
        flex-wrap: nowrap !important;
    }

    .nav-user {
        display: none !important;
    }

    /* Sleek compact sizes for buttons on mobile */
    .nav-btn-icon {
        width: 32px !important;
        height: 32px !important;
        font-size: 0.75rem !important;
    }

    .nav-btn-lang {
        height: 32px !important;
        padding: 0 0.45rem !important;
        font-size: 0.65rem !important;
        border-radius: 16px !important;
        gap: 0.15rem !important;
    }

    .nav-link-login {
        height: 32px !important;
        padding: 0 0.7rem !important;
        font-size: 0.7rem !important;
        border-radius: 16px !important;
    }

    .nav-btn-register {
        height: 32px !important;
        padding: 0 0.8rem !important;
        font-size: 0.7rem !important;
        border-radius: 16px !important;
    }

    .hero-title {
        font-size: 1.8rem;
    }

    .card {
        padding: 1.2rem;
    }

    .card-compact {
        padding: 1rem;
    }
}

/* ── Spinner ── */
.spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.btn.loading .spinner {
    display: inline-block;
}

.btn.loading .btn-text {
    display: none;
}
