/* ==========================================================================
   ImageTag AI / Image Analysis & Tagging
   Main Stylesheet — FINAL (Navbar version, no sidebar)
   ==========================================================================
   TABLE OF CONTENTS
   01. CSS Reset & Base
   02. CSS Variables (Design Tokens)
   03. Reusable Components (Buttons, Alerts, Cards, Forms)
   04. Navbar (Public + Logged-in + Profile Dropdown)
   05. Hero Section (index.html — animations preserved)
   06. Features Section
   07. How It Works Section
   08. About Section
   09. Footer
   10. Auth Pages (login.html, signup.html)
   11. Page Container (replaces sidebar layout)
   12. Dashboard Components (stats, cards, upload, recent)
   13. Upload Page
   14. Results Page
   15. History Page
   16. History Detail Page
   17. Profile / Edit Profile / Change Password
   18. Error Pages (404, 500, error.html)
   19. Utilities & Helpers
   20. Responsive Media Queries (Desktop → Tablet → Mobile)
   21. Google Translate Fixes & Extra Utilities
   ========================================================================== */


/* ==========================================================================
   01. CSS RESET & BASE
   ========================================================================== */

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

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: "Inter", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont,
        "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-body);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; transition: color var(--transition-fast); }
button, input, select, textarea { font-family: inherit; font-size: inherit; }
h1, h2, h3, h4, h5, h6 { line-height: 1.25; font-weight: 700; color: var(--text-primary); }
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.1rem; }
ul, ol { list-style: none; }
::selection { background-color: var(--primary); color: #ffffff; }


/* ==========================================================================
   02. CSS VARIABLES (DESIGN TOKENS)
   ========================================================================== */

:root {
    --primary: #4f46e5;
    --primary-dark: #4338ca;
    --primary-light: #eef2ff;
    --primary-soft: #e0e7ff;
    --secondary: #0ea5e9;
    --secondary-dark: #0284c7;

    --success: #16a34a;
    --success-light: #dcfce7;
    --danger: #dc2626;
    --danger-light: #fee2e2;
    --warning: #f59e0b;
    --warning-light: #fef3c7;

    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --text-inverse: #ffffff;

    --bg-body: #f8fafc;
    --bg-card: #ffffff;
    --bg-subtle: #f1f5f9;
    --bg-dark: #0f172a;

    --border: #e2e8f0;
    --border-strong: #cbd5e1;

    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.05);
    --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.08), 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
    --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.1);
    --shadow-lg: 0 16px 40px rgba(15, 23, 42, 0.12);

    --transition-fast: 0.15s ease;
    --transition: 0.25s ease;
    --transition-slow: 0.4s ease;

    --container: 1200px;
    --navbar-height: 72px;
    --bottom-nav-height: 64px;
}


/* ==========================================================================
   03. REUSABLE COMPONENTS
   ========================================================================== */

/* ----- Buttons ----- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 22px;
    border: 2px solid transparent;
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    white-space: nowrap;
    transition: all var(--transition);
    line-height: 1.4;
}

.btn:focus-visible {
    outline: 3px solid var(--primary-soft);
    outline-offset: 2px;
}

.btn-primary {
    background-color: var(--primary);
    color: var(--text-inverse);
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.25);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(79, 70, 229, 0.35);
}

.btn-secondary {
    background-color: transparent;
    color: var(--text-primary);
    border-color: var(--border-strong);
}

.btn-secondary:hover {
    background-color: var(--bg-subtle);
    border-color: var(--primary);
    color: var(--primary);
}

.btn-success {
    background-color: var(--success);
    color: var(--text-inverse);
}

.btn-success:hover {
    background-color: #15803d;
    transform: translateY(-2px);
}

.btn-danger {
    background-color: var(--danger);
    color: var(--text-inverse);
}

.btn-danger:hover {
    background-color: #b91c1c;
    transform: translateY(-2px);
}

.btn-full {
    width: 100%;
}

/* ----- Alerts ----- */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius);
    font-size: 0.92rem;
    font-weight: 500;
    margin-bottom: 18px;
    border-left: 4px solid;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-error, .alert-danger {
    background-color: var(--danger-light);
    color: #991b1b;
    border-color: var(--danger);
}

.alert-success {
    background-color: var(--success-light);
    color: #166534;
    border-color: var(--success);
}

.alert-warning {
    background-color: var(--warning-light);
    color: #92400e;
    border-color: var(--warning);
}

.alert-info {
    background-color: var(--primary-light);
    color: var(--primary-dark);
    border-color: var(--primary);
}

/* ----- Cards ----- */
.card, .dashboard-card, .form-card, .profile-card, .history-card, .result-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

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

.form-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.form-group input, .form-group select, .form-group textarea, .form-control {
    width: 100%;
    padding: 12px 16px;
    font-size: 0.95rem;
    color: var(--text-primary);
    background-color: var(--bg-card);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    transition: all var(--transition-fast);
}

.form-group input::placeholder, .form-control::placeholder {
    color: var(--text-muted);
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus, .form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-light);
}

.form-group input:invalid:not(:placeholder-shown) {
    border-color: var(--danger);
}

.input-help, .password-help {
    display: block;
    margin-top: 6px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.label-row label { margin-bottom: 0; }
.label-row a { font-size: 0.85rem; font-weight: 500; color: var(--primary); }
.label-row a:hover { color: var(--primary-dark); text-decoration: underline; }

/* ----- Section Labels ----- */
.section-label, .card-label, .hero-badge, .welcome-label {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--primary);
}

.hero-badge, .welcome-label {
    padding: 6px 14px;
    background-color: var(--primary-light);
    border-radius: var(--radius-full);
    margin-bottom: 18px;
}


/* ==========================================================================
   04. NAVBAR (PUBLIC + LOGGED-IN + PROFILE DROPDOWN)
   ========================================================================== */

.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

.nav-container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 24px;
    height: var(--navbar-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo, .auth-logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
}

.logo-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #ffffff;
    font-size: 0.85rem;
    font-weight: 800;
    border-radius: var(--radius);
    letter-spacing: 0.02em;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-menu a {
    padding: 8px 14px;
    font-size: 0.92rem;
    font-weight: 500;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.nav-menu a:hover {
    color: var(--primary);
    background-color: var(--primary-light);
}

.nav-menu a.active {
    color: var(--primary);
    font-weight: 600;
}

.nav-menu .nav-login {
    color: var(--text-primary);
    font-weight: 600;
    margin-left: 8px;
}

.nav-menu .nav-signup {
    background-color: var(--primary);
    color: #ffffff;
    font-weight: 600;
    padding: 10px 20px;
    border-radius: var(--radius);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
}

.nav-menu .nav-signup:hover {
    background-color: var(--primary-dark);
    color: #ffffff;
    transform: translateY(-1px);
}

.nav-user {
    padding: 8px 12px;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--primary);
    background-color: var(--primary-light);
    border-radius: var(--radius-full);
}

/* ----- Profile Dropdown (desktop) ----- */
.nav-profile-dropdown {
    position: relative;
    margin-left: 8px;
}

.nav-profile-dropdown > .profile-trigger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px 6px 6px;
    background-color: var(--primary-light);
    border: 1px solid var(--primary-soft);
    border-radius: var(--radius-full);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--primary);
    transition: all var(--transition-fast);
}

.nav-profile-dropdown > .profile-trigger:hover {
    background-color: var(--primary-soft);
}

.profile-trigger .mini-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #ffffff;
    font-size: 0.78rem;
    font-weight: 700;
    border-radius: 50%;
}

.profile-trigger .caret {
    font-size: 0.7rem;
    opacity: 0.7;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 180px;
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    padding: 6px;
    display: none;
    flex-direction: column;
    gap: 2px;
    z-index: 200;
}

.nav-profile-dropdown.open .dropdown-menu {
    display: flex;
}

.dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.dropdown-menu a:hover {
    background-color: var(--primary-light);
    color: var(--primary);
}

.dropdown-menu a.danger-link {
    color: var(--danger);
}

.dropdown-menu a.danger-link:hover {
    background-color: var(--danger-light);
    color: var(--danger);
}

.dropdown-divider {
    height: 1px;
    background-color: var(--border);
    margin: 4px 0;
}

.nav-menu .nav-user {
    margin-left: 6px;
}


/* ==========================================================================
   05. HERO SECTION
   ========================================================================== */
.hero-section {
    padding: 80px 24px 100px;
    background: radial-gradient(circle at 15% 20%, rgba(79, 70, 229, 0.08), transparent 45%),
                radial-gradient(circle at 85% 80%, rgba(14, 165, 233, 0.08), transparent 45%),
                var(--bg-body);
    overflow: hidden;
}

.hero-container {
    max-width: var(--container);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 60px;
    align-items: center;
}

.hero-content h1 {
    font-size: clamp(2.2rem, 5vw, 3.4rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 20px;
}

.hero-content h1 span {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-content > p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 540px;
    margin-bottom: 32px;
}

.hero-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 36px;
}

.hero-features {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.hero-features strong {
    color: var(--success);
    margin-right: 6px;
}

.hero-visual {
    display: flex;
    justify-content: center;
    position: relative;
}

.analysis-card {
    width: 100%;
    max-width: 400px;
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    padding: 24px;
    transform: rotate(1.5deg);
    transition: transform var(--transition-slow);
    position: relative;
    overflow: hidden;
}

.analysis-card:hover {
    transform: rotate(0deg) translateY(-6px);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 18px;
}

.status-dot {
    color: var(--success);
    font-size: 0.7rem;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.35; }
}

.image-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 40px 20px;
    background-color: var(--bg-subtle);
    border: 2px dashed var(--border-strong);
    border-radius: var(--radius-lg);
    margin-bottom: 20px;
}

.image-icon { font-size: 2rem; }
.image-placeholder p { font-weight: 600; color: var(--text-secondary); }
.image-placeholder small { font-size: 0.78rem; color: var(--text-muted); }

.sample-result {
    background-color: var(--bg-subtle);
    border-radius: var(--radius);
    padding: 16px;
}

.result-title {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.tag-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--border);
}

.tag-row:last-child { border-bottom: none; }
.tag-row strong { color: var(--primary); }

.scan-line {
    position: absolute;
    top: -10%;
    left: 0;
    width: 100%;
    height: 4px;
    background: rgba(79, 70, 229, 0.8);
    box-shadow: 0 0 20px 4px rgba(79, 70, 229, 0.6);
    z-index: 1;
    animation: scan 2.5s infinite linear;
    pointer-events: none;
}

@keyframes scan {
    0% { top: -10%; opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { top: 110%; opacity: 0; }
}

.anim-tag-1, .anim-tag-2, .anim-tag-3 {
    opacity: 0;
    animation: slideUp 0.6s ease forwards;
}

.anim-tag-1 { animation-delay: 0.5s; }
.anim-tag-2 { animation-delay: 1.0s; }
.anim-tag-3 { animation-delay: 1.5s; }

@keyframes slideUp {
    0% { opacity: 0; transform: translateY(15px); }
    100% { opacity: 1; transform: translateY(0); }
}


/* ==========================================================================
   06. FEATURES SECTION
   ========================================================================== */
.features-section {
    padding: 90px 24px;
    background-color: var(--bg-card);
}

.section-heading {
    max-width: 640px;
    margin: 0 auto 56px;
    text-align: center;
}

.section-heading h2 {
    font-size: clamp(1.7rem, 3.5vw, 2.3rem);
    font-weight: 800;
    margin: 12px 0 14px;
    letter-spacing: -0.01em;
}

.section-heading p {
    color: var(--text-secondary);
    font-size: 1.02rem;
}

.features-grid {
    max-width: var(--container);
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.feature-card {
    padding: 32px 26px;
    background-color: var(--bg-body);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    transition: all var(--transition);
}

.feature-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-soft);
    background-color: var(--bg-card);
}

.feature-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    background: linear-gradient(135deg, var(--primary-light), var(--primary-soft));
    color: var(--primary);
    font-size: 1.1rem;
    font-weight: 800;
    border-radius: var(--radius);
    margin-bottom: 18px;
}

.feature-card h3 { font-size: 1.1rem; margin-bottom: 10px; }
.feature-card p { font-size: 0.93rem; color: var(--text-secondary); }


/* ==========================================================================
   07. HOW IT WORKS SECTION
   ========================================================================== */
.steps-section {
    padding: 90px 24px;
    background-color: var(--bg-body);
}

.steps-container {
    max-width: var(--container);
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.step-card {
    position: relative;
    padding: 36px 28px;
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xs);
    transition: all var(--transition);
}

.step-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-md);
}

.step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #ffffff;
    font-size: 1.1rem;
    font-weight: 800;
    border-radius: var(--radius);
    margin-bottom: 20px;
}

.step-card h3 { font-size: 1.2rem; margin-bottom: 10px; }
.step-card p { font-size: 0.94rem; color: var(--text-secondary); }


/* ==========================================================================
   08. ABOUT SECTION
   ========================================================================== */
.about-section {
    padding: 90px 24px;
    background-color: var(--bg-card);
    border-top: 1px solid var(--border);
}

.about-container {
    max-width: var(--container);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 60px;
    align-items: center;
}

.about-content h2 {
    font-size: clamp(1.7rem, 3.5vw, 2.3rem);
    font-weight: 800;
    margin: 12px 0 20px;
    letter-spacing: -0.01em;
}

.about-content p {
    color: var(--text-secondary);
    margin-bottom: 16px;
    font-size: 1rem;
}

.about-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
}

.stat-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 28px 16px;
    background-color: var(--bg-body);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    text-align: center;
    transition: all var(--transition);
}

.stat-box:hover {
    border-color: var(--primary-soft);
    box-shadow: var(--shadow-sm);
    transform: translateY(-3px);
}

.stat-box strong {
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-box span { font-size: 0.82rem; color: var(--text-muted); font-weight: 500; }


/* ==========================================================================
   09. FOOTER
   ========================================================================== */
.footer {
    background-color: var(--bg-dark);
    color: #cbd5e1;
    padding: 56px 24px 0;
}

.footer-container {
    max-width: var(--container);
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 32px;
    padding-bottom: 40px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.footer h3 { color: #ffffff; font-size: 1.15rem; margin-bottom: 10px; }
.footer p { font-size: 0.9rem; color: #94a3b8; }

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 22px;
    align-items: center;
}

.footer-links a { font-size: 0.92rem; color: #cbd5e1; }
.footer-links a:hover { color: #ffffff; }

.footer-bottom {
    max-width: var(--container);
    margin: 0 auto;
    padding: 22px 0;
    text-align: center;
}

.footer-bottom p { font-size: 0.85rem; color: #64748b; }


/* ==========================================================================
   10. AUTH PAGES
   ========================================================================== */
.auth-page { background-color: var(--bg-body); }

.auth-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 100vh;
}

.auth-info {
    position: relative;
    padding: 48px;
    background: linear-gradient(150deg, #1e1b4b 0%, #312e81 50%, #4338ca 100%);
    color: #ffffff;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.auth-info::before {
    content: "";
    position: absolute;
    top: -80px; right: -80px;
    width: 320px; height: 320px;
    background: radial-gradient(circle, rgba(14, 165, 233, 0.35), transparent 65%);
    border-radius: 50%;
}

.auth-info::after {
    content: "";
    position: absolute;
    bottom: -100px; left: -60px;
    width: 280px; height: 280px;
    background: radial-gradient(circle, rgba(79, 70, 229, 0.45), transparent 65%);
    border-radius: 50%;
}

.auth-logo {
    position: relative;
    z-index: 1;
    color: #ffffff;
    font-size: 1.2rem;
}

.auth-logo span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px; height: 38px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: var(--radius);
    font-size: 0.85rem;
    font-weight: 800;
}

.auth-info-content {
    position: relative;
    z-index: 1;
    margin: auto 0;
    max-width: 460px;
}

.auth-info-content .hero-badge {
    background-color: rgba(255, 255, 255, 0.15);
    color: #e0e7ff;
}

.auth-info-content h1 {
    color: #ffffff;
    font-size: clamp(1.8rem, 3.2vw, 2.5rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 18px;
}

.auth-info-content > p {
    color: #c7d2fe;
    font-size: 1rem;
    margin-bottom: 36px;
}

.auth-benefit {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 20px;
}

.auth-benefit > span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 26px; height: 26px;
    background-color: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    font-size: 0.8rem;
    font-weight: 700;
    color: #86efac;
}

.auth-benefit strong { display: block; color: #ffffff; font-size: 0.96rem; margin-bottom: 2px; }
.auth-benefit small { color: #a5b4fc; font-size: 0.85rem; }

.auth-form-area {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    background-color: var(--bg-body);
}

.auth-form-card {
    width: 100%;
    max-width: 440px;
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    padding: 40px 36px;
}

.mobile-auth-logo { display: none; }

.auth-form-card h2 {
    font-size: 1.7rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    margin-bottom: 8px;
}

.auth-subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 28px;
}

.remember-row, .terms-row {
    margin-bottom: 22px;
    font-size: 0.88rem;
    color: var(--text-secondary);
}

.remember-row label, .terms-row label {
    display: flex;
    align-items: center;
    gap: 9px;
    cursor: pointer;
}

.remember-row input[type="checkbox"], .terms-row input[type="checkbox"] {
    width: 16px; height: 16px;
    accent-color: var(--primary);
    cursor: pointer;
}

.terms-row a { color: var(--primary); font-weight: 500; }
.terms-row a:hover { text-decoration: underline; }

.auth-divider {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 26px 0;
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 600;
}

.auth-divider::before, .auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background-color: var(--border);
}

.auth-switch {
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 18px;
}

.auth-switch a { color: var(--primary); font-weight: 600; }
.auth-switch a:hover { text-decoration: underline; }

.back-home {
    display: block;
    text-align: center;
    font-size: 0.88rem;
    color: var(--text-muted);
    font-weight: 500;
}

.back-home:hover { color: var(--primary); }


/* ==========================================================================
   11. PAGE CONTAINER
   ========================================================================== */
.page-container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 32px 24px 56px;
    min-height: calc(100vh - var(--navbar-height));
    width: 100%;
}

.dashboard-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 32px;
}

.dashboard-header h1 {
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    margin-bottom: 4px;
}

.dashboard-header p { font-size: 0.94rem; color: var(--text-secondary); }

.user-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px; height: 44px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #ffffff;
    font-weight: 700;
    font-size: 1rem;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
    flex-shrink: 0;
}


/* ==========================================================================
   12. DASHBOARD COMPONENTS
   ========================================================================== */
.welcome-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 32px;
    padding: 40px;
    margin-bottom: 28px;
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 55%, #4338ca 100%);
    border-radius: var(--radius-xl);
    color: #ffffff;
    box-shadow: var(--shadow-md);
    overflow: hidden;
    position: relative;
}

.welcome-card::after {
    content: "";
    position: absolute;
    top: -70px; right: 120px;
    width: 240px; height: 240px;
    background: radial-gradient(circle, rgba(14, 165, 233, 0.35), transparent 65%);
    border-radius: 50%;
    pointer-events: none;
}

.welcome-card > div { position: relative; z-index: 1; }
.welcome-label { background-color: rgba(255, 255, 255, 0.15); color: #e0e7ff; }

.welcome-card h2 {
    color: #ffffff;
    font-size: clamp(1.4rem, 2.6vw, 1.9rem);
    font-weight: 800;
    margin-bottom: 10px;
}

.welcome-card p { color: #c7d2fe; max-width: 520px; margin-bottom: 24px; }
.welcome-card .btn-primary { background-color: #ffffff; color: var(--primary-dark); box-shadow: none; }
.welcome-card .btn-primary:hover { background-color: #eef2ff; }
.welcome-visual { position: relative; z-index: 1; }

.ai-circle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 130px; height: 130px;
    background: rgba(255, 255, 255, 0.12);
    border: 2px solid rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    font-size: 2rem;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: 0.04em;
}

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 18px;
    margin-bottom: 28px;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 22px;
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xs);
    transition: all var(--transition);
}

.stat-card:hover { box-shadow: var(--shadow); transform: translateY(-3px); }

.stat-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px; height: 48px;
    background-color: var(--primary-light);
    color: var(--primary);
    font-size: 1.05rem;
    font-weight: 800;
    border-radius: var(--radius);
    flex-shrink: 0;
}

.stat-card div:last-child { display: flex; flex-direction: column; }
.stat-card span { font-size: 0.8rem; color: var(--text-muted); font-weight: 500; }
.stat-card strong { font-size: 1.35rem; font-weight: 800; color: var(--text-primary); }
.status-online { color: var(--success) !important; font-size: 1rem !important; }

.dashboard-quick-section {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 24px;
    align-items: stretch;
    margin-bottom: 28px;
}

.dashboard-quick-section > .dashboard-card {
    height: 100%;
    display: flex;
    flex-direction: column;
    min-height: 420px;
}

.dashboard-card {
    padding: 26px;
    display: flex;
    flex-direction: column;
}

.card-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 22px;
    flex-shrink: 0;
}

.card-heading h3 { font-size: 1.15rem; margin-top: 4px; }
.card-heading a { font-size: 0.86rem; font-weight: 600; color: var(--primary); }
.card-heading a:hover { text-decoration: underline; }

.card-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px; height: 42px;
    background-color: var(--primary-light);
    color: var(--primary);
    font-size: 1rem;
    font-weight: 800;
    border-radius: var(--radius);
    flex-shrink: 0;
}

.upload-dropzone {
    position: relative;
    margin-bottom: 18px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.upload-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 40px 24px;
    background-color: var(--bg-body);
    border: 2px dashed var(--border-strong);
    border-radius: var(--radius-lg);
    cursor: pointer;
    text-align: center;
    transition: all var(--transition);
    height: 100%;
}

.upload-label:hover, .upload-dropzone.dragover .upload-label {
    border-color: var(--primary);
    background-color: var(--primary-light);
}

.upload-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px; height: 52px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #ffffff;
    font-size: 1.3rem;
    font-weight: 700;
    border-radius: 50%;
    margin-bottom: 8px;
}

.upload-label h3, .upload-label h4 { font-size: 1.05rem; }
.upload-label p { font-size: 0.9rem; color: var(--text-secondary); }
.upload-label small { font-size: 0.8rem; color: var(--text-muted); }

.image-preview {
    position: relative;
    margin-top: 16px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border);
    background-color: var(--bg-subtle);
}

.image-preview img { width: 100%; max-height: 320px; object-fit: contain; }

.remove-image {
    position: absolute;
    top: 10px; right: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px; height: 34px;
    background-color: rgba(15, 23, 42, 0.7);
    color: #ffffff;
    border: none;
    border-radius: 50%;
    font-size: 1.15rem;
    line-height: 1;
    cursor: pointer;
    transition: background-color var(--transition-fast);
}

.remove-image:hover { background-color: var(--danger); }

.recent-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
    overflow-y: auto;
    max-height: 400px;
    padding-right: 5px;
}

.recent-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px;
    background-color: var(--bg-body);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: all var(--transition-fast);
    min-height: 75px;
    flex-shrink: 0;
}

.recent-item:hover {
    border-color: var(--primary-soft);
    background-color: var(--primary-light);
}

.recent-item img {
    width: 56px; height: 56px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}

.recent-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.recent-info strong {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    line-height: 1.4;
    word-break: break-word;
}

.recent-info small { font-size: 0.8rem; color: var(--text-muted); white-space: nowrap; }

.view-btn {
    padding: 7px 14px;
    background-color: var(--primary);
    color: #ffffff;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
    text-decoration: none;
}

.view-btn:hover { background-color: var(--primary-dark); }

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 44px 24px;
    text-align: center;
    background-color: var(--bg-body);
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    height: 100%;
}

.empty-icon { font-size: 2.2rem; opacity: 0.6; }
.empty-state h2, .empty-state h4 { font-size: 1.1rem; }
.empty-state p { font-size: 0.9rem; color: var(--text-secondary); max-width: 340px; }

.info-section {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 28px;
    padding: 34px 36px;
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xs);
}

.info-content { max-width: 560px; }
.info-content h2 { font-size: 1.35rem; font-weight: 800; margin: 8px 0 10px; }
.info-content p { font-size: 0.93rem; color: var(--text-secondary); }

.info-steps { display: flex; gap: 14px; flex-wrap: wrap; }

.mini-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 16px 20px;
    background-color: var(--bg-body);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    min-width: 100px;
}

.mini-step span { font-size: 0.75rem; font-weight: 800; color: var(--primary); letter-spacing: 0.05em; }
.mini-step strong { font-size: 0.85rem; font-weight: 600; color: var(--text-primary); }


/* ==========================================================================
   13. UPLOAD PAGE
   ========================================================================== */
.analysis-page { max-width: 900px; margin: 0 auto; }
.analysis-upload-card { padding: 32px; }

.large-dropzone {
    position: relative;
    margin: 20px 0;
    background-color: var(--bg-body);
    border: 2px dashed var(--border-strong);
    border-radius: 12px;
    transition: all 0.3s ease;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.large-dropzone.dragover { border-color: var(--primary); background-color: var(--primary-light); }

.upload-prompt {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-align: center;
}

.large-upload-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 72px; height: 72px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #ffffff;
    font-size: 2rem;
    font-weight: 700;
    border-radius: 50%;
    margin-bottom: 10px;
}

.file-support { font-size: 0.82rem; color: var(--text-muted); margin-top: 6px; }

.analysis-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.preview-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 15px;
    align-items: center;
}

.preview-info strong { font-size: 1.1rem; color: var(--text-primary); font-weight: 600; }

.analysis-options { margin-top: 28px; }
.analysis-options h3 { font-size: 1.1rem; margin-bottom: 16px; }

.option-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
}

.option-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    background-color: var(--bg-body);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.option-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px; height: 38px;
    background-color: var(--primary-light);
    color: var(--primary);
    font-size: 1rem;
    font-weight: 700;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}

.option-item strong { display: block; font-size: 0.95rem; margin-bottom: 4px; }
.option-item p { font-size: 0.85rem; color: var(--text-secondary); line-height: 1.4; }

.upload-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }


/* ==========================================================================
   14. RESULTS PAGE
   ========================================================================== */
.result-grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 24px;
    margin-bottom: 28px;
}

.result-card { padding: 26px; }
.result-card h2 { font-size: 1.15rem; margin-bottom: 18px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }

.analysis-image {
    width: 100%;
    max-height: 380px;
    object-fit: contain;
    background-color: var(--bg-subtle);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.92rem;
}

.info-row:last-child { border-bottom: none; }
.info-label, .label { font-weight: 600; color: var(--text-secondary); }
.info-value, .value { color: var(--text-primary); font-weight: 500; text-align: right; word-break: break-word; }

.caption-box, .caption {
    padding: 18px;
    background-color: var(--bg-body);
    border-left: 4px solid var(--primary);
    border-radius: var(--radius);
    font-size: 0.95rem;
    color: var(--text-primary);
    line-height: 1.7;
}

.tag-list, .previous-tags { display: flex; flex-direction: column; gap: 14px; }

.tag-item, .tag {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 14px 16px;
    background-color: var(--bg-body);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: border-color var(--transition-fast);
}

.tag-item:hover, .tag:hover { border-color: var(--primary-soft); }
.tag-item { flex-direction: row; justify-content: space-between; align-items: center; }
.tag-name, .tag span:first-child { font-weight: 600; font-size: 0.94rem; }
.confidence { font-size: 0.82rem; font-weight: 600; color: var(--primary); }
.tag .confidence { display: inline-flex; align-items: center; padding: 3px 10px; background-color: var(--primary-light); border-radius: var(--radius-full); }

.result-bottom-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    padding: 24px;
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xs);
}


/* ==========================================================================
   15. HISTORY PAGE
   ========================================================================== */
.filter-card {
    padding: 20px;
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xs);
    margin-bottom: 28px;
}

.filter-form { display: flex; gap: 12px; align-items: center; width: 100%; }

.filter-form input[type="search"] {
    flex: 1;
    max-width: 450px;
    height: 44px;
    padding: 0 16px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
}

.filter-form select {
    width: 160px;
    height: 44px;
    padding: 0 12px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
}

.filter-form .btn-search {
    height: 44px;
    width: auto !important;
    padding: 0 30px;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.history-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 24px; }
.history-card { overflow: hidden; transition: all var(--transition); }
.history-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); }

.history-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background-color: var(--bg-subtle);
    border-bottom: 1px solid var(--border);
}

.history-body { padding: 20px; }
.history-body h2 { font-size: 1.02rem; font-weight: 700; margin-bottom: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.history-date { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 10px; }

.history-caption {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 18px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.history-actions { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding-top: 14px; border-top: 1px solid var(--border); }
.delete-history-form { margin: 0; }

.delete-btn {
    padding: 8px 16px;
    background-color: transparent;
    color: var(--danger);
    border: 1.5px solid var(--danger);
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.delete-btn:hover { background-color: var(--danger); color: #ffffff; }


/* ==========================================================================
   16. HISTORY DETAIL PAGE
   ========================================================================== */
.details-container { max-width: var(--container); margin: 0 auto; padding: 40px 24px 60px; }

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 24px;
}

.back-link:hover { text-decoration: underline; }

.details-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.details-grid .card { padding: 26px; }
.details-grid .card h2 { font-size: 1.15rem; margin-bottom: 18px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.details-grid .card h3 { font-size: 1rem; margin: 22px 0 12px; }
.details-grid .card p { font-size: 0.92rem; color: var(--text-secondary); margin-bottom: 8px; }
.details-grid .card p strong { color: var(--text-primary); }
.details-grid hr { border: none; border-top: 1px solid var(--border); margin: 20px 0; }


/* ==========================================================================
   17. PROFILE / EDIT PROFILE / CHANGE PASSWORD
   ========================================================================== */
.profile-card, .form-card, .password-card, .error-card, .server-content, .not-found-content {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    padding: 40px 36px;
}

.profile-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding-bottom: 28px;
    margin-bottom: 28px;
    border-bottom: 1px solid var(--border);
}

.avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 84px; height: 84px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #ffffff;
    font-size: 2rem;
    font-weight: 800;
    border-radius: 50%;
    margin-bottom: 16px;
    box-shadow: 0 8px 22px rgba(79, 70, 229, 0.3);
}

.profile-header h1 { font-size: 1.5rem; font-weight: 800; margin-bottom: 4px; }
.profile-header p { font-size: 0.88rem; color: var(--text-muted); }
.profile-info { margin-bottom: 28px; }

.form-card h1, .password-card h1 { font-size: 1.55rem; font-weight: 800; letter-spacing: -0.01em; margin-bottom: 8px; }
.form-card > p, .password-card > p { font-size: 0.94rem; color: var(--text-secondary); margin-bottom: 28px; }

.actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 8px; }
.profile-card .actions { padding-top: 24px; border-top: 1px solid var(--border); }


/* ==========================================================================
   18. ERROR PAGES
   ========================================================================== */
.not-found, .server-error {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - var(--navbar-height));
    padding: 60px 24px;
    background: radial-gradient(circle at 50% 30%, rgba(79, 70, 229, 0.07), transparent 55%), var(--bg-body);
}

.not-found-content, .server-content {
    max-width: 560px;
    width: 100%;
    text-align: center;
    padding: 56px 40px;
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
}

.number {
    font-size: clamp(4rem, 12vw, 6.5rem);
    font-weight: 900;
    line-height: 1;
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 16px;
}

.not-found-content h1, .server-content h1 { font-size: 1.6rem; font-weight: 800; margin-bottom: 14px; }
.not-found-content p, .server-content p { font-size: 1rem; color: var(--text-secondary); margin-bottom: 30px; }

.error-card { text-align: center; }
.error-icon { display: inline-flex; align-items: center; justify-content: center; width: 72px; height: 72px; background-color: var(--danger-light); color: var(--danger); font-size: 2rem; font-weight: 800; border-radius: 50%; margin-bottom: 22px; }
.error-card h1 { font-size: 1.5rem; font-weight: 800; margin-bottom: 14px; }
.error-message { font-size: 1rem; color: var(--text-secondary); margin-bottom: 30px; line-height: 1.7; }


/* ==========================================================================
   19. UTILITIES & HELPERS
   ========================================================================== */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.hidden { display: none !important; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background-color: var(--bg-subtle); }
::-webkit-scrollbar-thumb { background-color: var(--border-strong); border-radius: var(--radius-full); border: 2px solid var(--bg-subtle); }
::-webkit-scrollbar-thumb:hover { background-color: var(--text-muted); }

.password-strength { display: block; height: 4px; width: 0; margin-top: 8px; border-radius: 2px; background-color: transparent; transition: all 0.3s ease; }
button[type="submit"]:disabled { cursor: not-allowed; opacity: 0.7; }

.custom-lang-switcher { display: inline-block; margin-right: 15px; }
.custom-lang-switcher select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-color: transparent;
    border: 1.5px solid var(--border-strong);
    border-radius: var(--radius);
    padding: 8px 30px 8px 12px;
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    outline: none;
    transition: all var(--transition-fast);
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23475569%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 10px;
}

.custom-lang-switcher select:hover, .custom-lang-switcher select:focus {
    border-color: var(--primary);
    background-color: var(--primary-light);
    color: var(--primary);
}

.custom-lang-switcher select option {
    background-color: var(--bg-card);
    color: var(--text-primary);
    padding: 10px;
}


/* ==========================================================================
   20. RESPONSIVE MEDIA QUERIES
   ========================================================================== */

/* ----- Large tablets / small desktops ----- */
@media (max-width: 1100px) {
    .hero-container { grid-template-columns: 1fr; gap: 48px; text-align: center; }
    .hero-content > p { margin-left: auto; margin-right: auto; }
    .hero-buttons, .hero-features { justify-content: center; }
    .hero-visual { order: -1; }
    .about-container { grid-template-columns: 1fr; gap: 40px; }
    .result-grid, .details-grid { grid-template-columns: 1fr; }
    .dashboard-quick-section { grid-template-columns: 1fr; }
    .dashboard-quick-section > .dashboard-card { min-height: auto; }
}

/* ----- Tablets ----- */
@media (max-width: 900px) {
    .auth-wrapper { grid-template-columns: 1fr; }
    .auth-info { display: none; }
    .auth-form-area { padding: 32px 20px; }
    .mobile-auth-logo { display: inline-flex; align-items: center; justify-content: center; width: 100%; margin-bottom: 24px; font-size: 1.05rem; font-weight: 700; color: var(--primary); }
    .welcome-card { flex-direction: column; text-align: center; }
    .welcome-card p { margin-left: auto; margin-right: auto; }
    
    .nav-container { height: auto; padding: 12px 18px; flex-direction: column; gap: 10px; }
    .nav-menu { flex-wrap: wrap; justify-content: center; gap: 4px; width: 100%; }
    .nav-menu a { padding: 7px 12px; font-size: 0.86rem; }
    .nav-menu .nav-signup { padding: 8px 16px; }
}

/* ----- Mobile (bottom navbar + stack) ----- */
@media (max-width: 640px) {
    h1 { font-size: 1.55rem; }
    h2 { font-size: 1.25rem; }

    /* ===== LOGGED-IN BOTTOM NAVBAR ===== */
    body.has-bottom-nav .navbar {
        position: fixed;
        bottom: 0;
        top: auto;
        left: 0;
        right: 0;
        width: 100%;
        height: var(--bottom-nav-height);
        border-bottom: none;
        border-top: 1px solid var(--border);
        background-color: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        box-shadow: 0 -4px 16px rgba(15, 23, 42, 0.08);
        z-index: 1000;
    }

    body.has-bottom-nav .nav-container { height: 100%; padding: 0 4px; flex-direction: row; justify-content: center; align-items: stretch; gap: 0; }
    body.has-bottom-nav .nav-container .logo { display: none; }
    body.has-bottom-nav .nav-menu { width: 100%; height: 100%; display: flex; flex-direction: row; justify-content: space-around; align-items: stretch; gap: 0; flex-wrap: nowrap; }

    body.has-bottom-nav .nav-menu > a,
    body.has-bottom-nav .nav-menu .nav-profile-dropdown {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        padding: 6px 2px;
        font-size: 0.7rem;
        font-weight: 600;
        color: var(--text-secondary);
        border-radius: 0;
        background: transparent;
        text-align: center;
        line-height: 1.2;
    }

    body.has-bottom-nav .nav-menu > a.active { color: var(--primary); background-color: var(--primary-light); }
    body.has-bottom-nav .nav-menu > a::before { content: attr(data-icon); font-size: 1.25rem; line-height: 1; display: block; margin-bottom: 2px; }
    body.has-bottom-nav .nav-user, body.has-bottom-nav .nav-menu > a[href="/logout"] { display: none; }

    /* Profile dropdown becomes bottom-up on mobile */
    body.has-bottom-nav .nav-profile-dropdown { position: static; margin: 0; }
    body.has-bottom-nav .nav-profile-dropdown > .profile-trigger {
        background: transparent;
        border: none;
        padding: 6px 2px;
        flex-direction: column;
        align-items: center;
        gap: 2px;
        font-size: 0.7rem;
        font-weight: 600;
        color: var(--text-secondary);
        border-radius: 0;
        width: 100%;
        height: 100%;
        justify-content: center;
    }
    body.has-bottom-nav .nav-profile-dropdown > .profile-trigger .mini-avatar { width: 24px; height: 24px; font-size: 0.7rem; margin-bottom: 0; }
    body.has-bottom-nav .nav-profile-dropdown > .profile-trigger .caret { display: none; }
    
    body.has-bottom-nav .nav-profile-dropdown.open .dropdown-menu {
        display: flex;
        position: fixed;
        bottom: calc(var(--bottom-nav-height) + 8px);
        right: 12px;
        left: auto;
        top: auto;
        min-width: 180px;
        background-color: var(--bg-card);
        border: 1px solid var(--border);
        border-radius: var(--radius);
        box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.15);
    }

    body.has-bottom-nav .page-container { padding-bottom: calc(var(--bottom-nav-height) + 32px); }

    /* ===== LANDING PAGE NAVBAR (index.html — TOP, stays top) ===== */
    body:not(.has-bottom-nav) .nav-container { flex-direction: row; justify-content: space-between; padding: 12px 18px; height: auto; gap: 10px; }
    body:not(.has-bottom-nav) .nav-menu { flex-wrap: wrap; justify-content: center; gap: 4px; }
    body:not(.has-bottom-nav) .nav-menu a { padding: 7px 10px; font-size: 0.82rem; }
    body:not(.has-bottom-nav) .nav-menu .nav-signup { padding: 8px 16px; }

    /* ===== HERO ===== */
    .hero-section { padding: 48px 18px 64px; }
    .features-section, .steps-section, .about-section { padding: 60px 18px; }
    .section-heading { margin-bottom: 36px; }
    .about-stats { grid-template-columns: 1fr; }
    .footer-container { flex-direction: column; text-align: center; }
    .footer-links { justify-content: center; }
    .hero-container { display: flex; flex-direction: column-reverse; gap: 30px; }
    .hero-visual { width: 100%; }
    .analysis-card { max-width: 100%; transform: rotate(0deg); padding: 16px; }
    .image-placeholder { padding: 20px 15px; }

    /* ===== AUTH ===== */
    .auth-wrapper { display: flex; flex-direction: column; padding: 20px; background-color: var(--bg-body); }
    .auth-form-area { padding: 0; min-height: calc(100vh - 40px); display: flex; align-items: center; justify-content: center; }
    .auth-form-card { width: 100%; max-width: 100%; padding: 30px 20px; border-radius: var(--radius-xl); box-shadow: var(--shadow-lg); }

    /* ===== PAGE CONTAINER ===== */
    .page-container { padding: 20px 15px 32px; }

    /* Dashboard header stack */
    .dashboard-header { flex-direction: row; align-items: center; gap: 12px; }
    .dashboard-header > div:first-child { flex: 1; min-width: 0; }
    .dashboard-header h1 { font-size: 1.4rem; }
    .dashboard-header p { font-size: 0.85rem; }
    .user-avatar { width: 40px; height: 40px; font-size: 0.95rem; }

        /* Welcome card */
    .welcome-card {
        padding: 26px 20px !important;
        flex-direction: column !important;
        text-align: center !important;
        gap: 20px !important;
        overflow: hidden !important; /* Orbit ko bahar nikalne se rokega */
    }
    
    .welcome-card > div:last-child {
        margin-left: 0 !important;
        width: 100% !important;
        display: flex !important;
        justify-content: center !important;
    }

    .orb-inner-3d {
        width: 80px !important;
        height: 80px !important;
        font-size: 1.5rem !important;
    }

    .orb-ring-3d {
        width: 100% !important; /* 140% se 100% kiya taake fit ho */
        height: 100% !important;
    }
    /* Stats */
    .dashboard-stats { grid-template-columns: 1fr 1fr; gap: 12px; }
    .stat-card { padding: 16px; gap: 12px; }
    .stat-icon { width: 40px; height: 40px; font-size: 0.9rem; }
    .stat-card span { font-size: 0.72rem; }
    .stat-card strong { font-size: 1.15rem; }

    /* ===== DASHBOARD QUICK: STACK (New upar, Recent neeche) ===== */
    .dashboard-quick-section { grid-template-columns: 1fr !important; gap: 20px; }
    .dashboard-quick-section > .dashboard-card { min-height: auto; height: auto; }
    .dashboard-quick-section > .dashboard-card:first-child { min-height: 360px; }
    .recent-list { max-height: 320px; }
    .recent-item { min-height: 70px; padding: 10px; gap: 10px; }
    .recent-item img { width: 48px; height: 48px; }
    .recent-info strong { font-size: 0.88rem; -webkit-line-clamp: 2; }
    .view-btn { padding: 6px 10px; font-size: 0.78rem; }

    /* Info section */
    .info-section { flex-direction: column; align-items: flex-start; padding: 26px 22px; }
    .info-steps { width: 100%; }
    .mini-step { flex: 1; min-width: 0; padding: 12px 10px; }

    /* ===== UPLOAD PAGE MOBILE ===== */
    .analysis-upload-card { padding: 20px; }
    .large-dropzone { min-height: 280px; padding: 16px; }
    .large-upload-icon { width: 60px; height: 60px; font-size: 1.6rem; }
    .analysis-preview img { height: 240px !important; max-width: 100% !important; }
    .option-grid { grid-template-columns: 1fr; }

    /* ===== RESULTS PAGE MOBILE ===== */
    .result-grid { grid-template-columns: 1fr; }
    .result-bottom-actions { flex-direction: column; }
    .result-bottom-actions form, .result-bottom-actions .btn { width: 100%; }

    /* ===== FILTER ===== */
    .filter-form { flex-direction: column; align-items: stretch; }
    .filter-form input[type="search"], .filter-form select, .filter-form .btn-search { width: 100%; max-width: 100%; }

       /* ===== HISTORY ===== */
    .history-grid {
        grid-template-columns: 1fr !important; /* Side-by-side ko khatam karke ek ke neeche ek karega */
        gap: 20px !important;
    }
    
    .history-card {
        width: 100% !important;
    }

    .history-actions {
        flex-direction: column !important;
        align-items: stretch !important;
    }

    .history-actions .view-btn, 
    .delete-history-form .delete-btn {
        width: 100% !important;
        text-align: center !important;
    }

    /* ===== FORMS ===== */
    .actions { flex-direction: column; }
    .actions .btn { width: 100%; }
    .profile-card, .form-card, .password-card, .error-card { padding: 28px 22px; }
    .not-found-content, .server-content { padding: 40px 24px; }

    /* ===== DETAILS PAGE ===== */
    .details-grid { grid-template-columns: 1fr; }
    .details-container > .details-topbar > div { flex-direction: column !important; align-items: stretch !important; gap: 12px !important; }
    .details-container > .details-topbar .btn { width: 100%; text-align: center; }
}

/* ==========================================================================
   21. DARK MODE FIXES & EXTRA UTILITIES
   ========================================================================== */

/* Google translate ka top wala frame chupao */
iframe.skiptranslate { display: none !important; height: 0 !important; visibility: hidden !important; }
body { top: 0 !important; position: static !important; }
.goog-te-banner-frame { display: none !important; }
#goog-gt-tt, .goog-te-balloon-frame { display: none !important; }
.goog-text-highlight { background: none !important; box-shadow: none !important; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
/* ==========================================================================
   22. FINAL MOBILE OVERFLOW & NAVBAR FIX (DO NOT REMOVE)
   ========================================================================== */

@media (max-width: 640px) {

    /* 1. Screen Overflow (Horizontal Scroll) Fix */
    html, body {
        overflow-x: hidden !important;
        width: 100% !important;
        max-width: 100vw !important;
    }

    /* 2. Dashboard Boxes Fix (Screen se bahar nikalne se rokna) */
    .dashboard-quick-section {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        max-width: 100% !important;
        gap: 16px !important;
    }

    .dashboard-quick-section > .dashboard-card {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important; 
        flex: none !important;
        min-height: auto !important;
    }

    /* Upload Box ko thodi height do taake drag-drop kaam kare */
    .dashboard-quick-section > .dashboard-card:first-child {
        min-height: 320px !important;
    }

    /* 3. Bottom Navbar Fix (Proper Fit) */
    body.has-bottom-nav .navbar {
        width: 100vw !important;
        max-width: 100vw !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        padding: 0 !important;
        margin: 0 !important;
        box-sizing: border-box !important;
    }

    body.has-bottom-nav .nav-container {
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 4px !important;
        margin: 0 !important;
        display: flex !important;
        justify-content: space-around !important;
        align-items: center !important;
    }

    body.has-bottom-nav .nav-menu {
        width: 100% !important;
        display: flex !important;
        justify-content: space-around !important;
        align-items: center !important;
        margin: 0 !important;
        padding: 0 !important;
        gap: 0 !important;
    }

    /* Har icon ko barabar jagah do */
    body.has-bottom-nav .nav-menu > a,
    body.has-bottom-nav .nav-profile-dropdown {
        flex: 1 !important;
        min-width: 0 !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 8px 2px !important;
        margin: 0 !important;
        text-align: center !important;
    }

    /* Text thoda chhota karo taake fit ho jaye */
    body.has-bottom-nav .nav-menu > a {
        font-size: 0.65rem !important;
        white-space: nowrap !important;
    }

    /* Profile ka text chupao, sirf Avatar dikhao */
    body.has-bottom-nav .profile-trigger .profile-name {
        display: none !important;
    }

    body.has-bottom-nav .profile-trigger {
        padding: 4px !important;
        background: transparent !important;
        border: none !important;
    }

    /* Avatar ka size set karo */
    body.has-bottom-nav .profile-trigger .mini-avatar {
        width: 28px !important;
        height: 28px !important;
        font-size: 0.8rem !important;
        margin-bottom: 4px !important;
    }
}

/* Dropdown fix for history-detail page */
.details-container .navbar {
    position: relative;
    z-index: 9999;
}

.details-container .nav-profile-dropdown.open .dropdown-menu {
    display: flex !important;
    z-index: 99999 !important;
    position: absolute !important;
    top: 120% !important;
}
/* ==========================================================================
   PURE CSS DROPDOWN FIX (NO JS NEEDED)
   ========================================================================== */

/* Jab mouse ya touch avatar par jaye toh dropdown khule */
.nav-profile-dropdown:hover .dropdown-menu,
.nav-profile-dropdown:focus-within .dropdown-menu {
    display: flex !important;
}

/* Mobile ke liye touch support */
@media (max-width: 640px) {
    body.has-bottom-nav .nav-profile-dropdown:hover .dropdown-menu,
    body.has-bottom-nav .nav-profile-dropdown:focus-within .dropdown-menu {
        display: flex !important;
        position: fixed !important;
        bottom: calc(var(--bottom-nav-height) + 8px) !important;
        right: 12px !important;
        left: auto !important;
        top: auto !important;
    }
}
/* ==========================================================================
   HERO SECTION ANIMATIONS (index.html)
   ========================================================================== */

/* Scan Line ko dabbe ke andar rakhne ke liye */
.image-placeholder {
    position: relative; /* Ye zaroori hai taake scan line isi ke andar rahe */
    overflow: hidden;   /* Scan line bahar na nikle */
}

.scan-line {
    position: absolute;
    top: -10%;
    left: 0;
    width: 100%;
    height: 4px;
    background: rgba(79, 70, 229, 0.8);
    box-shadow: 0 0 20px 4px rgba(79, 70, 229, 0.6);
    z-index: 1;
    animation: scan 2.5s infinite linear;
    pointer-events: none;
}

@keyframes scan {
    0% { top: -10%; opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { top: 110%; opacity: 0; }
}
/* ==========================================================================
   FINAL MOBILE OVERFLOW FIX (Welcome Box & Result Page)
   ========================================================================== */

@media (max-width: 640px) {
    /* 1. Dashboard Welcome Box Fix */
    .welcome-card {
        padding: 20px 15px !important;
        flex-direction: column !important;
        text-align: center !important;
        gap: 15px !important;
        width: 100% !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
    }

    /* 3D Orb (AI Ball) ko screen ke andar rakho */
    .welcome-card > div:last-child {
        margin-left: 0 !important;
        width: 100% !important;
        display: flex !important;
        justify-content: center !important;
        overflow: hidden !important;
    }

    .orb-inner-3d {
        width: 70px !important;
        height: 70px !important;
        font-size: 1.3rem !important;
    }

    .orb-ring-3d {
        width: 90% !important; /* Pehle 140% tha, isliye bahar ja raha tha */
        height: 90% !important;
    }

    /* 2. Result Page Grid Fix (Side-by-side ko khatam karo) */
    .result-grid {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        gap: 20px !important;
    }

    /* Result ke dono boxes ko screen ke andar rakho */
    .result-card {
        width: 100% !important;
        min-width: 0 !important;
        padding: 15px !important;
        box-sizing: border-box !important;
    }

    /* Tags ka grid (2 columns wala) mobile par 1 column karo */
    .result-card .tag-list {
        grid-template-columns: 1fr !important;
    }

    /* 3. General Overflow Fix */
    body, html, .page-container {
        overflow-x: hidden !important;
        width: 100% !important;
    }
}
/* ==========================================================================
   RESULT PAGE HEADER BUTTONS FIX (Mobile)
   ========================================================================== */

@media (max-width: 640px) {
    /* Header ko column mein badlo taake buttons neeche aayen */
    .dashboard-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 15px !important;
        width: 100% !important;
    }

    /* Buttons wale container ko full width do */
    .dashboard-header > div:last-child {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        gap: 10px !important;
    }

    /* Dono buttons ko full width aur center align karo */
    .dashboard-header .btn {
        width: 100% !important;
        padding: 12px 15px !important;
        font-size: 0.95rem !important;
        white-space: normal !important;
        text-align: center !important;
        display: inline-flex !important;
        justify-content: center !important;
        box-sizing: border-box !important;
    }
}