:root {
    --bg-color: #0c0806;
    --card-bg: #150f0b;
    --card-border: #2b1f16;
    --accent-color: #d8963e;
    --accent-hover: #c37b27;
    --text-main: #ebd9c5;
    --text-muted: #8c7867;
    --input-bg: #1a130e;
}

body {
    margin: 0;
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: 'Poppins', system-ui, -apple-system, sans-serif;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 50px;
    background: rgba(12, 8, 6, 0.98);
    border-bottom: 1px solid var(--card-border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.brand-logo {
    width: 42px;
    height: 42px;
    object-fit: contain;
}

.brand-text {
    display: flex;
    flex-direction: column;
    font-family: 'Cinzel', serif;
}

.brand-title {
    font-weight: 800;
    font-size: 15px;
    color: #ffffff;
    letter-spacing: 1px;
    line-height: 1;
    margin: 0;
}

.brand-subtitle {
    font-weight: 600;
    font-size: 10px;
    color: var(--accent-color);
    line-height: 1.2;
    margin-top: 2px;
    letter-spacing: 1.2px;
}

.nav-links {
    display: flex;
    gap: 25px;
    align-items: center;
}

.nav-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: color 0.2s ease;
    position: relative;
    padding-bottom: 4px;
}

.nav-link:hover,
.nav-link.active {
    color: var(--accent-color);
}

.nav-link.active::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--accent-color);
}

.hero-section {
    padding: 30px 40px 10px;
    background: radial-gradient(circle at top right, #2b1803 0%, transparent 60%);
}

.hero-section h1 {
    font-size: 32px;
    margin: 0 0 6px 0;
    font-family: 'Cinzel', serif;
}

.hero-section h1 span {
    color: var(--accent-color);
}

.hero-section p {
    color: var(--text-muted);
    font-size: 13px;
    margin: 0 0 16px 0;
}

.search-control-bar {
    max-width: 400px;
    margin-top: 10px;
}

.search-input-wrap {
    position: relative;
}

.search-input-wrap input {
    width: 100%;
    background: var(--input-bg);
    border: 1px solid var(--card-border);
    padding: 10px 36px 10px 14px;
    border-radius: 6px;
    color: #fff;
    font-size: 12px;
    box-sizing: border-box;
}

.search-icon {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.main-wrapper,
.admin-upload-section {
    padding: 20px 40px;
}

.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.card h3 {
    margin: 0 0 6px 0;
    font-size: 14px;
    color: var(--accent-color);
    font-family: 'Cinzel', serif;
}

.section-desc {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.form-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.form-group input {
    background: var(--input-bg);
    border: 1px solid var(--card-border);
    color: var(--text-main);
    padding: 9px 12px;
    border-radius: 6px;
    font-size: 12px;
}

.browse-btn {
    background: var(--accent-color);
    color: #0c0806;
    border: none;
    font-weight: bold;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.2s;
}

.browse-btn:hover {
    background: var(--accent-hover);
}

.table-container {
    overflow-x: auto;
    max-height: 500px;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

th,
td {
    padding: 12px 14px;
    text-align: left;
    border-bottom: 1px solid var(--card-border);
}

th {
    background: #0f0a07;
    color: var(--text-muted);
    font-weight: 500;
    position: sticky;
    top: 0;
}

.btn-action {
    background: var(--accent-color);
    color: #0c0806;
    border: none;
    padding: 6px 14px;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    font-size: 11px;
}

.btn-action.download {
    background: #10b981;
    color: #fff;
}

.btn-action:hover {
    opacity: 0.9;
}

footer {
    text-align: center;
    font-size: 10px;
    color: var(--text-muted);
    padding: 20px;
    border-top: 1px solid var(--card-border);
}

/* Modal / Progress styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(12, 8, 6, 0.75);
    backdrop-filter: blur(6px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.upload-progress-card {
    background: #0f0a07;
    border: 1px solid var(--accent-color);
    border-radius: 8px;
    padding: 20px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 0 25px rgba(216, 150, 62, 0.3);
}

.upload-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.upload-status-badge {
    display: flex;
    align-items: center;
    gap: 8px;
}

.spinner-dot {
    width: 8px;
    height: 8px;
    background-color: var(--accent-color);
    border-radius: 50%;
    animation: pulse 1s infinite alternate;
}

.upload-status-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--accent-color);
    text-transform: uppercase;
}

.upload-percent {
    font-size: 15px;
    font-weight: 800;
    color: var(--text-main);
}

.progress-bar-bg {
    height: 8px;
    background: #2b1f16;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 12px;
}

.progress-bar-fill {
    height: 100%;
    background: var(--accent-color);
    transition: width 0.15s linear;
}

.upload-progress-details {
    font-size: 11px;
    color: var(--text-muted);
}

.modal-content.success-card {
    background: var(--card-bg);
    border: 1px solid var(--accent-color);
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    position: relative;
    overflow: hidden;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 0 40px rgba(216, 150, 62, 0.3);
}

#confettiCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.success-icon {
    font-size: 45px;
    margin-bottom: 10px;
}

.success-card h2 {
    color: var(--accent-color);
    margin: 0 0 8px 0;
    font-family: 'Cinzel', serif;
}

.success-card p {
    color: var(--text-muted);
    font-size: 12px;
    margin-bottom: 20px;
}

.success-btn {
    width: 100%;
    padding: 10px;
    position: relative;
    z-index: 2;
}

@keyframes pulse {
    0% {
        transform: scale(0.8);
        opacity: 0.4;
    }

    100% {
        transform: scale(1.3);
        opacity: 1;
    }
}

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

    .navbar {
        padding: 12px 20px;
    }

    .main-wrapper,
    .hero-section,
    .admin-upload-section {
        padding-left: 20px;
        padding-right: 20px;
    }
}

/* USER PROFILE DROPDOWN MENU */
.user-dropdown-wrapper {
    position: relative;
    display: inline-block;
}

.user-menu-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-card, #150f0b);
    border: 1px solid var(--border-color, #2b1f16);
    padding: 4px 12px 4px 6px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 12px;
    user-select: none;
    transition: all 0.2s ease;
}

.user-menu-pill:hover,
.user-dropdown-wrapper.active .user-menu-pill {
    border-color: var(--accent-gold, #d8963e);
    background: var(--bg-card-alt, #1a130e);
}

.user-menu-pill img {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    object-fit: cover;
}

.avatar-ring {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid #ff9800;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #1a1a1a;
}

.user-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.dropdown-arrow {
    font-size: 11px;
    color: var(--text-secondary, #8c7867);
    display: inline-block;
    transition: transform 0.2s ease, color 0.2s ease;
}

.user-dropdown-wrapper.active .dropdown-arrow {
    transform: rotate(180deg);
    color: var(--accent-gold, #d8963e);
}

.user-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 230px;
    background: var(--bg-card, #150f0b);
    border: 1px solid var(--border-color, #2b1f16);
    border-radius: 10px;
    padding: 10px 0;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    display: none;
    z-index: 1100;
    animation: navbarDropdownFade 0.2s ease forwards;
}

.user-dropdown-wrapper.active .user-dropdown-menu {
    display: block;
}

@keyframes navbarDropdownFade {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

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

.dropdown-header {
    padding: 6px 16px 10px;
}

.dropdown-header .user-profile {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
}

.user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary, #ebd9c5);
    display: block;
}

.user-handle {
    font-size: 0.85rem;
    color: #8c7867;
    font-weight: 400;
    display: block;
}

.dropdown-divider {
    height: 1px;
    background: var(--border-color, #2b1f16);
    margin: 6px 0;
}

.dropdown-items {
    display: flex;
    flex-direction: column;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    color: var(--text-secondary, #8c7867);
    text-decoration: none;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.dropdown-item i {
    width: 14px;
    text-align: center;
    font-size: 12px;
    color: var(--accent-gold, #d8963e);
}

.dropdown-item:hover {
    background: rgba(216, 150, 62, 0.15);
    color: var(--accent-gold, #d8963e);
}

.dropdown-item.logout-item {
    color: #e74c3c;
}

.dropdown-item.logout-item i {
    color: #e74c3c;
}

.dropdown-item.logout-item:hover {
    background: rgba(231, 76, 60, 0.1);
}

/* Hide login button when user wrapper has the 'logged-in' class */
.user-dropdown-wrapper.logged-in #loginBtn,
.user-dropdown-wrapper.logged-in .login-btn {
    display: none !important;
}

/* Optional: Hide logged-in user details when NOT logged in */
.user-dropdown-wrapper:not(.logged-in) .user-profile-menu {
    display: none !important;
}
