/* ============================================
   Bobby Verify - Luxury Gold / Charcoal Theme
   Inspired by premium hotel & architecture design
   Light (default) + Dark mode
   ============================================ */

/* --- Google Fonts supplement --- */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;500;600;700&display=swap');

/* --- Light Theme (default) --- */
:root {
    --gold: #C9A84C;
    --gold-light: #D4B96A;
    --gold-lighter: #E8D9A0;
    --gold-dark: #A8893A;
    --gold-bg: rgba(201, 168, 76, 0.08);
    --gold-bg-hover: rgba(201, 168, 76, 0.14);
    --gold-gradient: linear-gradient(135deg, #C9A84C 0%, #D4B96A 50%, #C9A84C 100%);
    --gold-gradient-hover: linear-gradient(135deg, #A8893A 0%, #C9A84C 50%, #A8893A 100%);
    --gold-shimmer: linear-gradient(90deg, #C9A84C, #E8D9A0, #C9A84C);

    --bg: #FAF9F6;
    --bg-surface: #FFFFFF;
    --bg-card: #FFFFFF;
    --bg-warm: #F5F1EB;
    --border: #E8E2D6;
    --border-light: #F0EBE3;
    --border-gold: rgba(201, 168, 76, 0.25);

    --text: #1A1A1A;
    --text-secondary: #5C5C5C;
    --text-muted: #9A9A9A;
    --charcoal: #2D2D2D;

    --shadow-sm: 0 1px 4px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.06);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.08);
    --shadow-gold: 0 4px 20px rgba(201, 168, 76, 0.15);
}

/* --- Dark Theme --- */
[data-theme="dark"] {
    --gold: #D4B96A;
    --gold-light: #E8D9A0;
    --gold-lighter: #F0E6C0;
    --gold-dark: #C9A84C;
    --gold-bg: rgba(212, 185, 106, 0.08);
    --gold-bg-hover: rgba(212, 185, 106, 0.15);
    --gold-gradient: linear-gradient(135deg, #D4B96A 0%, #E8D9A0 50%, #D4B96A 100%);
    --gold-gradient-hover: linear-gradient(135deg, #C9A84C 0%, #D4B96A 50%, #C9A84C 100%);

    --bg: #0F0F0F;
    --bg-surface: #171717;
    --bg-card: #1C1C1C;
    --bg-warm: #1A1917;
    --border: #2E2E2E;
    --border-light: #252525;
    --border-gold: rgba(212, 185, 106, 0.2);

    --text: #F0ECE4;
    --text-secondary: #B0A898;
    --text-muted: #706A60;
    --charcoal: #E8E4DD;

    --shadow-sm: 0 1px 4px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.4);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.5);
    --shadow-gold: 0 4px 20px rgba(201, 168, 76, 0.1);
}

/* --- Base --- */
* {
    font-family: 'Sarabun', -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
    background-color: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background-color 0.4s ease, color 0.3s ease;
    position: relative;
}

/* --- Luxury background pattern --- */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 0;
    /* Elegant curved art-deco arcs pattern */
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='280' height='280' viewBox='0 0 280 280'%3E%3Cdefs%3E%3Cstyle%3Ecircle,path%7Bfill:none;stroke:%23C9A84C;stroke-width:0.6%7D%3C/style%3E%3C/defs%3E%3Ccircle cx='140' cy='140' r='120'/%3E%3Ccircle cx='140' cy='140' r='90'/%3E%3Ccircle cx='140' cy='140' r='60'/%3E%3Ccircle cx='140' cy='140' r='30'/%3E%3Cpath d='M20,140 Q140,20 260,140'/%3E%3Cpath d='M20,140 Q140,260 260,140'/%3E%3Cpath d='M140,20 Q20,140 140,260'/%3E%3Cpath d='M140,20 Q260,140 140,260'/%3E%3Cpath d='M50,50 Q140,80 230,50'/%3E%3Cpath d='M50,230 Q140,200 230,230'/%3E%3Cpath d='M50,50 Q80,140 50,230'/%3E%3Cpath d='M230,50 Q200,140 230,230'/%3E%3C/svg%3E");
    background-size: 420px 420px;
    opacity: 0.04;
}

/* Soft radial gold ambient glow */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 0;
    background:
        radial-gradient(ellipse 600px 400px at 15% 10%, rgba(201,168,76,0.04), transparent),
        radial-gradient(ellipse 500px 500px at 85% 80%, rgba(201,168,76,0.03), transparent),
        radial-gradient(ellipse 400px 300px at 50% 50%, rgba(201,168,76,0.015), transparent);
}

[data-theme="dark"] body::before {
    opacity: 0.05;
}

[data-theme="dark"] body::after {
    background:
        radial-gradient(ellipse 600px 400px at 15% 10%, rgba(201,168,76,0.07), transparent),
        radial-gradient(ellipse 500px 500px at 85% 80%, rgba(201,168,76,0.05), transparent),
        radial-gradient(ellipse 400px 300px at 50% 50%, rgba(201,168,76,0.03), transparent);
}

/* Ensure content sits above pattern */
.navbar {
    position: relative;
    z-index: 1050;
}
main, footer, .login-container {
    position: relative;
    z-index: 1;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
}

a {
    color: var(--gold);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--gold-dark);
}

/* --- Selection --- */
::selection {
    background: rgba(201, 168, 76, 0.3);
    color: var(--text);
}

/* --- Navbar --- */
.navbar {
    background-color: var(--bg-surface) !important;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    padding: 0.6rem 0;
}

.brand-text {
    font-family: 'Playfair Display', 'Sarabun', serif;
    font-weight: 700;
    font-size: 1.15rem;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    color: var(--gold) !important;
    -webkit-text-fill-color: var(--gold);
    background: none;
}

.text-brand {
    color: var(--gold) !important;
}

.navbar .nav-link {
    color: var(--text-secondary) !important;
    font-weight: 500;
    font-size: 0.88rem;
    letter-spacing: 0.3px;
    padding: 0.5rem 0.85rem;
    transition: color 0.2s;
    position: relative;
}

.navbar .nav-link:hover,
.navbar .nav-link.active {
    color: var(--gold) !important;
}

.navbar .nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: var(--gold);
    transition: width 0.3s ease;
}

.navbar .nav-link:hover::after,
.navbar .nav-link.active::after {
    width: 60%;
}

/* Dropdown nav-link override - remove gold underline on dropdown toggle */
.navbar .nav-link.dropdown-toggle::after {
    position: static;
    transform: none;
    width: auto;
    height: auto;
    background: none;
    display: inline-block;
    margin-left: 0.255em;
    vertical-align: 0.255em;
    content: "";
    border-top: 0.3em solid;
    border-right: 0.3em solid transparent;
    border-bottom: 0;
    border-left: 0.3em solid transparent;
    transition: none;
}

.dropdown-menu {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    border-radius: 8px;
    overflow: hidden;
}

.dropdown-menu .dropdown-item {
    color: var(--text);
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
    transition: all 0.15s;
}

.dropdown-menu .dropdown-item:hover {
    background-color: var(--gold-bg);
    color: var(--gold);
}

.dropdown-menu .dropdown-divider {
    border-color: var(--border);
}

/* Theme toggle */
.theme-toggle {
    background: none;
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gold);
    cursor: pointer;
    transition: all 0.3s;
    font-size: 1rem;
}

.theme-toggle:hover {
    background-color: var(--gold-bg);
    border-color: var(--gold);
    box-shadow: var(--shadow-gold);
}

/* --- Text utilities --- */
.text-gold { color: var(--gold) !important; }
.text-gold-light { color: var(--gold-light) !important; }
.text-gold-muted { color: var(--text-muted) !important; }

/* --- Divider with gold --- */
.divider-gold {
    border: none;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    margin: 1.5rem 0;
}

/* --- Cards --- */
.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    overflow: hidden;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    background-color: transparent;
    border-bottom: 1px solid var(--border);
    padding: 1rem 1.25rem;
}

.card-gold {
    border-color: var(--border-gold);
}

.card-gold .card-header {
    background: var(--gold-bg);
    border-bottom-color: var(--border-gold);
}

/* Card with top gold accent */
.card-accent {
    border-top: 3px solid var(--gold);
}

/* --- Stat cards --- */
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gold-gradient);
}

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

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    background: var(--gold-bg);
    color: var(--gold);
    border: 1px solid var(--border-gold);
}

.stat-card .stat-value {
    font-family: 'Playfair Display', 'Sarabun', serif;
    font-size: 2rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
}

.stat-card .stat-label {
    color: var(--text-muted);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 0.25rem;
}

/* --- Buttons --- */
.btn-gold {
    background: var(--gold-gradient);
    color: #fff;
    border: none;
    font-weight: 600;
    letter-spacing: 0.5px;
    padding: 0.5rem 1.25rem;
    border-radius: 8px;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.btn-gold:hover {
    background: var(--gold-gradient-hover);
    color: #fff;
    box-shadow: var(--shadow-gold);
    transform: translateY(-1px);
}

.btn-gold:active {
    transform: translateY(0);
}

.btn-outline-gold {
    border: 1px solid var(--gold);
    color: var(--gold);
    background: transparent;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s;
}

.btn-outline-gold:hover {
    background: var(--gold-bg);
    color: var(--gold-dark);
    border-color: var(--gold-dark);
    box-shadow: var(--shadow-gold);
}

/* --- Tables --- */
.table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--text);
    --bs-table-border-color: var(--border-light);
    --bs-table-hover-bg: var(--gold-bg);
    --bs-table-striped-bg: var(--gold-bg);
    color: var(--text);
}

.table > :not(caption) > * > * {
    background-color: transparent;
    color: var(--text);
    border-bottom-color: var(--border);
    padding: 0.75rem;
}

.table thead th {
    background-color: var(--gold-bg) !important;
    color: var(--gold-dark);
    border-bottom: 2px solid var(--border-gold);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 0.85rem 0.75rem;
}

.table tbody tr {
    border-color: var(--border-light);
    transition: background-color 0.2s;
}

.table tbody tr:hover > * {
    background-color: var(--gold-bg);
}

.table tfoot td {
    background-color: transparent !important;
}

/* --- Forms --- */
.form-control,
.form-select {
    background-color: var(--bg-surface);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 8px;
    padding: 0.55rem 0.85rem;
    transition: all 0.3s;
}

.form-control:focus,
.form-select:focus {
    background-color: var(--bg-surface);
    border-color: var(--gold);
    color: var(--text);
    box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.12);
}

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

.form-label {
    color: var(--text);
    font-weight: 500;
    font-size: 0.88rem;
    letter-spacing: 0.2px;
}

.input-group-text {
    background-color: var(--gold-bg);
    border: 1px solid var(--border);
    color: var(--gold);
}

/* --- Badges --- */
.badge-gold {
    background: var(--gold-gradient);
    color: #fff;
    font-weight: 600;
    letter-spacing: 0.3px;
}

/* Status badges */
.status-pending_photo { background-color: #f59e0b; color: #fff; }
.status-pending_review { background-color: #3b82f6; color: #fff; }
.status-retake_photo { background-color: #ef4444; color: #fff; }
.status-approved { background-color: #22c55e; color: #fff; }
.status-rejected { background-color: #ef4444; color: #fff; }

/* --- Alerts --- */
.alert {
    border-radius: 10px;
    border: 1px solid var(--border-gold);
    background: var(--gold-bg);
    color: var(--text);
}

.alert-success {
    background: linear-gradient(135deg, rgba(34,197,94,0.08), rgba(34,197,94,0.03));
    color: #166534;
    border: 1px solid rgba(34,197,94,0.2);
}

.alert-info {
    background: linear-gradient(135deg, rgba(201,168,76,0.1), rgba(201,168,76,0.04));
    color: var(--gold-dark);
    border: 1px solid var(--border-gold);
}

.alert-warning {
    background: linear-gradient(135deg, rgba(245,158,11,0.1), rgba(245,158,11,0.04));
    color: #92400e;
    border: 1px solid rgba(245,158,11,0.2);
}

.alert-danger {
    background: linear-gradient(135deg, rgba(239,68,68,0.08), rgba(239,68,68,0.03));
    color: #991b1b;
    border: 1px solid rgba(239,68,68,0.2);
}

[data-theme="dark"] .alert-success { color: #86efac; }
[data-theme="dark"] .alert-info { color: var(--gold-light); }
[data-theme="dark"] .alert-warning { color: #fbbf24; }
[data-theme="dark"] .alert-danger { color: #f87171; }

/* --- Footer --- */
.footer-dark {
    background-color: var(--bg-surface);
    border-top: 1px solid var(--border);
}

.footer-dark::before {
    content: '';
    display: block;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

/* --- Login page --- */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    position: relative;
}

.login-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(ellipse at top, var(--gold-bg) 0%, transparent 60%);
    pointer-events: none;
}

.login-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-gold);
    border-radius: 16px;
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gold-gradient);
}

.login-logo {
    font-size: 3rem;
    color: var(--gold);
    text-align: center;
    margin-bottom: 0.5rem;
}

.login-title {
    text-align: center;
    font-family: 'Playfair Display', 'Sarabun', serif;
    font-weight: 700;
    font-size: 1.5rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--gold);
    -webkit-text-fill-color: var(--gold);
    background: none;
    margin-bottom: 0.5rem;
}

/* --- Photo grid --- */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.75rem;
}

.photo-item {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border);
    aspect-ratio: 4/3;
    transition: all 0.3s;
}

.photo-item:hover {
    border-color: var(--gold);
    box-shadow: var(--shadow-gold);
}

.photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-item .photo-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(180deg, transparent 30%, rgba(0,0,0,0.6) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.photo-item:hover .photo-overlay {
    opacity: 1;
}

/* --- Upload area --- */
.upload-area {
    border: 2px dashed var(--border-gold);
    border-radius: 16px;
    padding: 3rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: var(--gold-bg);
}

.upload-area:hover {
    border-color: var(--gold);
    background: var(--gold-bg-hover);
    box-shadow: var(--shadow-gold);
}

.upload-area .upload-icon {
    font-size: 3rem;
    color: var(--gold);
    margin-bottom: 1rem;
}

/* --- Result display --- */
.result-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.6rem 1.5rem;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.result-authentic {
    background-color: #dcfce7;
    color: #166534;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.result-fake {
    background-color: #fef2f2;
    color: #991b1b;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

[data-theme="dark"] .result-authentic {
    background-color: rgba(34, 197, 94, 0.12);
    color: #4ade80;
    border-color: rgba(34, 197, 94, 0.2);
}

[data-theme="dark"] .result-fake {
    background-color: rgba(239, 68, 68, 0.12);
    color: #f87171;
    border-color: rgba(239, 68, 68, 0.2);
}

/* --- Expert profile --- */
.expert-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 3px solid var(--gold);
    object-fit: cover;
    box-shadow: var(--shadow-gold);
}

/* --- QR section --- */
.qr-section {
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    border: 1px solid var(--border);
}

[data-theme="dark"] .qr-section {
    background: #ffffff;
}

.qr-section img {
    max-width: 180px;
}

/* --- Embed widget --- */
.embed-widget {
    background: var(--bg-card);
    border: 1px solid var(--border-gold);
    border-radius: 12px;
    padding: 1rem;
    max-width: 350px;
}

/* --- Pagination --- */
.page-link {
    background-color: var(--bg-card);
    border-color: var(--border);
    color: var(--text);
    transition: all 0.2s;
}

.page-link:hover {
    background-color: var(--gold-bg);
    border-color: var(--gold);
    color: var(--gold);
}

.page-item.active .page-link {
    background: var(--gold-gradient);
    border-color: var(--gold);
    color: #fff;
}

/* --- Custom scrollbar --- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold); }

/* --- Selection highlight --- */
::selection {
    background: rgba(201, 168, 76, 0.3);
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .stat-card .stat-value {
        font-size: 1.5rem;
    }

    .photo-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }

    .login-card {
        margin: 1rem;
        padding: 2rem;
    }
}

/* --- Print --- */
@media print {
    body { background: #fff !important; color: #000 !important; }
    .navbar, .footer-dark, .btn, .no-print, .theme-toggle { display: none !important; }
    .card { border: 1px solid #ccc !important; background: #fff !important; box-shadow: none !important; }
    .qr-section { border: 1px solid #ccc; }
}
