/* ================================================
   WHEN IT WAS - CONTRIBUTOR PORTAL DARK THEME V2
   Created: October 24, 2025
   FIXED: Text contrast for better readability
   ================================================ */

/* ===============================================
   ROOT VARIABLES
   =============================================== */
:root {
    /* Brand Colors */
    --compass-gold: #D4A574;
    --slate-blue: #3D5A6B;
    --deep-charcoal: #1a1a1a;
    
    /* Dark Theme Colors */
    --bg-primary: #1a1a1a;
    --bg-secondary: #252525;
    --bg-card: #2a2a2a;
    --bg-hover: #333333;
    
    /* Text Colors - MUCH LIGHTER FOR READABILITY */
    --text-primary: #ffffff;        /* Pure white for main text */
    --text-secondary: #E8DCC8;      /* Cream for secondary text */
    --text-muted: #94a3b8;          /* Light gray for muted text */
    
    /* Status Colors */
    --color-approved: #10b981;
    --color-pending: #f59e0b;
    --color-rejected: #ef4444;
    --color-info: #3b82f6;
    
    /* Border & Shadow */
    --border-color: #3a3a3a;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.5);
}

/* ===============================================
   GLOBAL STYLES
   =============================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

/* ===============================================
   LAYOUT
   =============================================== */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.main-content {
    margin-left: 280px;
    padding: 20px;
    transition: margin-left 0.3s ease;
}

@media (max-width: 768px) {
    .main-content {
        margin-left: 0;
        padding: 15px;
    }
}

/* ===============================================
   SIDEBAR NAVIGATION
   =============================================== */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 280px;
    height: 100vh;
    background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
    padding: 30px 20px;
    overflow-y: auto;
    border-right: 1px solid var(--border-color);
    z-index: 1000;
    transition: transform 0.3s ease;
}

.sidebar-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.logo-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--compass-gold);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-subtitle {
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 5px;
}

/* User Profile in Sidebar */
.user-info {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
    border: 1px solid var(--border-color);
}

.user-info h3 {
    color: var(--compass-gold);
    font-size: 18px;
    margin-bottom: 5px;
}

.user-role {
    color: var(--text-muted);
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.user-role.trusted {
    color: var(--color-info);
    font-weight: 600;
}

/* Navigation Menu */
.nav-menu {
    list-style: none;
}

.nav-item {
    margin-bottom: 8px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 10px;
    transition: all 0.2s ease;
    font-size: 15px;
    font-weight: 500;
}

.nav-link:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    transform: translateX(4px);
}

.nav-link.active {
    background: linear-gradient(135deg, var(--compass-gold) 0%, #c4955f 100%);
    color: var(--deep-charcoal);
    font-weight: 600;
    box-shadow: var(--shadow-md);
}

.nav-link .icon {
    font-size: 20px;
    width: 24px;
    text-align: center;
}

/* Logout Button */
.logout-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.logout-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* ===============================================
   MOBILE MENU
   =============================================== */
.mobile-header {
    display: none;
    background: var(--bg-secondary);
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 999;
}

.hamburger {
    background: none;
    border: none;
    font-size: 28px;
    color: var(--compass-gold);
    cursor: pointer;
    padding: 5px;
}

.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 998;
}

.mobile-overlay.active {
    display: block;
}

@media (max-width: 768px) {
    .mobile-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
}

/* ===============================================
   CARDS & CONTAINERS
   =============================================== */
.card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
}

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

.card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.card-header h2 {
    font-size: 22px;
    color: var(--compass-gold);
    font-weight: 600;
}

.card-header .icon {
    font-size: 28px;
}

/* ===============================================
   STATISTICS BOXES - FIXED TEXT COLORS
   =============================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-box {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
}

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

.stat-box.total {
    border-left: 4px solid var(--color-info);
}

.stat-box.approved {
    border-left: 4px solid var(--color-approved);
}

.stat-box.pending {
    border-left: 4px solid var(--color-pending);
}

.stat-box.rejected {
    border-left: 4px solid var(--color-rejected);
}

.stat-icon {
    font-size: 32px;
    margin-bottom: 12px;
}

/* CRITICAL FIX: Numbers must be bright white */
.stat-number {
    font-size: 42px;
    font-weight: 700;
    color: #ffffff !important;  /* Pure white - highly visible */
    margin: 10px 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* CRITICAL FIX: Labels must be lighter */
.stat-label {
    font-size: 13px;
    color: var(--text-muted);  /* Light gray */
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-weight: 600;
}

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

label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 14px;
}

input[type="text"],
input[type="email"],
input[type="number"],
input[type="date"],
textarea,
select {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 15px;
    transition: all 0.2s ease;
}

input::placeholder,
textarea::placeholder {
    color: var(--text-muted);
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--compass-gold);
    box-shadow: 0 0 0 3px rgba(212, 165, 116, 0.2);
}

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

select {
    cursor: pointer;
}

input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* ===============================================
   BUTTONS
   =============================================== */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: linear-gradient(135deg, var(--compass-gold) 0%, #c4955f 100%);
    color: var(--deep-charcoal);
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--bg-hover);
}

.btn-success {
    background: linear-gradient(135deg, var(--color-approved) 0%, #059669 100%);
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, var(--color-rejected) 0%, #dc2626 100%);
    color: white;
}

.btn-warning {
    background: linear-gradient(135deg, var(--color-pending) 0%, #d97706 100%);
    color: white;
}

/* ===============================================
   BADGES & PILLS
   =============================================== */
.badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-approved {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
    border: 1px solid var(--color-approved);
}

.badge-pending {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
    border: 1px solid var(--color-pending);
}

.badge-rejected {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
    border: 1px solid var(--color-rejected);
}

.badge-trusted {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
    border: 1px solid var(--color-info);
}

/* ===============================================
   TABLES
   =============================================== */
table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
    border-radius: 12px;
    overflow: hidden;
}

thead {
    background: var(--bg-secondary);
}

th {
    padding: 16px;
    text-align: left;
    font-weight: 600;
    color: var(--compass-gold);
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

td {
    padding: 16px;
    border-top: 1px solid var(--border-color);
    color: var(--text-primary);
}

tr:hover {
    background: var(--bg-hover);
}

/* ===============================================
   ALERTS & NOTIFICATIONS
   =============================================== */
.alert {
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
}

.alert-success {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid var(--color-approved);
    color: #34d399;
}

.alert-error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid var(--color-rejected);
    color: #f87171;
}

.alert-warning {
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid var(--color-pending);
    color: #fbbf24;
}

.alert-info {
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid var(--color-info);
    color: #60a5fa;
}

/* ===============================================
   LOADING STATES
   =============================================== */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: var(--text-muted);
}

.spinner {
    border: 3px solid var(--border-color);
    border-top-color: var(--compass-gold);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 0.8s linear infinite;
}

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

/* ===============================================
   PROFILE SECTION
   =============================================== */
.profile-header {
    text-align: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-card) 100%);
    border-radius: 12px;
    margin-bottom: 30px;
    border: 1px solid var(--border-color);
}

.profile-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--compass-gold) 0%, #c4955f 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    margin: 0 auto 20px;
    border: 4px solid var(--border-color);
    box-shadow: var(--shadow-md);
}

.profile-name {
    font-size: 28px;
    font-weight: 700;
    color: var(--compass-gold);
    margin-bottom: 8px;
}

.profile-email {
    color: var(--text-muted);
    font-size: 16px;
    margin-bottom: 15px;
}

/* ===============================================
   LOCATION & BUSINESS CARDS
   =============================================== */
.location-card,
.business-card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.location-card:hover,
.business-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    border-color: var(--compass-gold);
}

.location-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--compass-gold);
    margin-bottom: 10px;
}

.location-address {
    color: var(--text-secondary);
    margin-bottom: 15px;
    font-size: 15px;
}

.location-stats {
    display: flex;
    gap: 20px;
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

/* ===============================================
   IMAGE GALLERY
   =============================================== */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.photo-item {
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.photo-item:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-lg);
}

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

/* ===============================================
   HEADINGS - ALL BRIGHT AND READABLE
   =============================================== */
h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary);
    font-weight: 600;
}

h1 { font-size: 32px; color: var(--compass-gold); }
h2 { font-size: 26px; color: var(--compass-gold); }
h3 { font-size: 22px; }
h4 { font-size: 18px; }
h5 { font-size: 16px; }
h6 { font-size: 14px; }

/* ===============================================
   PARAGRAPHS & TEXT
   =============================================== */
p {
    color: var(--text-secondary);
    margin-bottom: 12px;
    line-height: 1.6;
}

strong, b {
    color: var(--text-primary);
    font-weight: 600;
}

/* ===============================================
   UTILITY CLASSES
   =============================================== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted) !important; }
.text-primary { color: var(--text-primary) !important; }
.text-gold { color: var(--compass-gold) !important; }
.text-white { color: #ffffff !important; }

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }

.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.gap-3 { gap: 24px; }

.hidden { display: none; }

/* ===============================================
   RESPONSIVE DESIGN
   =============================================== */
@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .card {
        padding: 20px;
    }
    
    .form-group {
        margin-bottom: 16px;
    }
    
    .profile-header {
        padding: 30px 15px;
    }
    
    .stat-number {
        font-size: 36px;
    }
}

/* ===============================================
   PRINT STYLES
   =============================================== */
@media print {
    .sidebar,
    .mobile-header,
    .logout-btn,
    .btn {
        display: none;
    }
    
    .main-content {
        margin-left: 0;
    }
}
