/* =======================================================
   Lunker Brand Design System - WITH THEME SUPPORT
   Supports Light and Dark Mode
   ======================================================= */

/* ==========================================
   THEME SYSTEM - Light & Dark Mode
   ========================================== */

/* Dark Theme */
[data-theme="dark"] {
    /* Primary Lunker Brand Colors - Dark Mode */
    --lunker-primary: #4ade80;
    --lunker-secondary: #22c55e;
    --lunker-accent: #86efac;
    --lunker-light: #1e1e1e;
    --lunker-cream: #1e1e1e;
    --lunker-cream-light: #242526;
    --lunker-cream-dark: #262626;
    --lunker-dark: #16a34a;
    
    /* Background Colors - Facebook-style */
    --background-gray: #18191a;
    --background-light: #242526;
    --background-cream: #18191a;
    --card-background: #242526;
    --card-background-cream: #242526;
    
    /* Text Colors */
    --text-primary: #ffffff;
    --text-secondary: #d4d4d4;
    --text-light: #a3a3a3;
    --text-on-green: #ffffff;
    --text-muted: #a3a3a3;
    
    /* Border Colors - Facebook-style */
    --border-light: #3a3b3c;
    --border-medium: #3a3b3c;
    --border-dark: #525252;
    
    /* Shadow System - Darker */
    --shadow-light: 0 2px 12px rgba(0, 0, 0, 0.4);
    --shadow-medium: 0 4px 16px rgba(0, 0, 0, 0.5);
    --shadow-hover: 0 8px 32px rgba(0, 0, 0, 0.6);
    --shadow-strong: 0 12px 40px rgba(0, 0, 0, 0.7);
    --shadow-dropdown: 0 0.5rem 1rem rgba(0, 0, 0, 0.5);
    
    /* Interactive States */
    --lunker-hover: rgba(255, 255, 255, 0.08);
    --lunker-active: rgba(255, 255, 255, 0.12);
    --lunker-focus: rgba(255, 255, 255, 0.16);
}

/* Light Theme (Default) */
[data-theme="light"] {
    /* Primary Lunker Brand Colors - Light Mode */
    --lunker-primary: #2d5a2d;
    --lunker-secondary: #3a7c3a;
    --lunker-accent: #4a9d4a;
    --lunker-light: #e8f5e8;
    --lunker-cream: #e8e4df;
    --lunker-cream-light: #f5f3f0;
    --lunker-cream-dark: #ded9d3;
    --lunker-dark: #1e3d1e;
    
    /* Background Colors - Facebook-style */
    --background-gray: #f0f2f5;
    --background-light: #ffffff;
    --background-cream: #f0f2f5;
    --card-background: #ffffff;
    --card-background-cream: #ffffff;
    
    /* Text Colors */
    --text-primary: #1a1a1a;
    --text-secondary: #4a4a4a;
    --text-light: #6c757d;
    --text-on-green: #ffffff;
    --text-muted: #666666;
    
    /* Border Colors */
    --border-light: #dee2e6;
    --border-medium: #ced4da;
    --border-dark: #6c757d;
    
    /* Shadow System */
    --shadow-light: 0 2px 12px rgba(45, 90, 45, 0.08);
    --shadow-medium: 0 4px 16px rgba(45, 90, 45, 0.12);
    --shadow-hover: 0 8px 32px rgba(45, 90, 45, 0.12);
    --shadow-strong: 0 12px 40px rgba(45, 90, 45, 0.15);
    --shadow-dropdown: 0 0.5rem 1rem rgba(45, 90, 45, 0.15);
    
    /* Interactive States */
    --lunker-hover: rgba(45, 90, 45, 0.06);
    --lunker-active: rgba(45, 90, 45, 0.12);
    --lunker-focus: rgba(45, 90, 45, 0.2);
}

/* ==========================================
   CSS VARIABLES - LUNKER BRAND PALETTE (Fallback)
   ========================================== */
:root {
    /* Primary Lunker Brand Colors */
    --lunker-primary: #2d5a2d;
    --lunker-secondary: #3a7c3a;
    --lunker-accent: #4a9d4a;
    --lunker-light: #e8f5e8;
    --lunker-cream: #e8e4df;
    --lunker-cream-light: #f5f3f0;
    --lunker-cream-dark: #ded9d3;
    --lunker-dark: #1e3d1e;
    
    /* Semantic Colors */
    --lunker-success: #28a745;
    --lunker-warning: #ffc107;
    --lunker-danger: #dc3545;
    --lunker-info: #17a2b8;
    
    /* Background Colors */
    --background-gray: #f8f9fa;
    --background-light: #ffffff;
    --background-cream: #f5f3f0;
    --card-background: #ffffff;
    --card-background-cream: #e8e4df;
    
    /* Text Colors */
    --text-primary: #1a1a1a;
    --text-secondary: #4a4a4a;
    --text-light: #6c757d;
    --text-on-green: #ffffff;
    --text-muted: #666666;
    
    /* Border Colors */
    --border-light: #dee2e6;
    --border-medium: #ced4da;
    --border-dark: #6c757d;
    
    /* Shadow System */
    --shadow-light: 0 2px 12px rgba(45, 90, 45, 0.08);
    --shadow-medium: 0 4px 16px rgba(45, 90, 45, 0.12);
    --shadow-hover: 0 8px 32px rgba(45, 90, 45, 0.12);
    --shadow-strong: 0 12px 40px rgba(45, 90, 45, 0.15);
    --shadow-dropdown: 0 0.5rem 1rem rgba(45, 90, 45, 0.15);
    
    /* Border Radius System */
    --border-radius-sm: 4px;
    --border-radius: 8px;
    --border-radius-lg: 12px;
    --border-radius-xl: 16px;
    --border-radius-card: 22px;
    --border-radius-pill: 50px;
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, var(--lunker-primary), var(--lunker-secondary));
    --gradient-success: linear-gradient(135deg, var(--lunker-secondary), var(--lunker-accent));
    --gradient-accent: linear-gradient(135deg, var(--lunker-accent), #5cb85c);
    --gradient-hero: linear-gradient(135deg, var(--lunker-primary) 0%, var(--lunker-secondary) 50%, var(--lunker-accent) 100%);
    --gradient-cream: linear-gradient(135deg, var(--lunker-cream-light), var(--lunker-cream));
    --gradient-green-cream: linear-gradient(135deg, var(--lunker-light), var(--lunker-cream));
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-medium: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.5s ease;
    
    /* Spacing System */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    --spacing-xxl: 48px;
    
    /* Interactive States */
    --lunker-hover: rgba(45, 90, 45, 0.06);
    --lunker-active: rgba(45, 90, 45, 0.12);
    --lunker-focus: rgba(45, 90, 45, 0.2);
}

/* ==========================================
   GLOBAL STYLES
   ========================================== */
body {
    background: var(--background-cream);
    color: var(--text-primary);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
}

body.white-bg {
    background: var(--background-gray);
}

/* Ensure all text has good contrast */
p, div, span, li {
    color: var(--text-primary);
}

/* Secondary text should still be readable */
.text-secondary, .text-muted {
    color: var(--text-secondary) !important;
}

/* Specific fixes for common light text issues */
small, .small {
    color: var(--text-secondary);
}

/* Ensure sufficient contrast in all interactive elements */
.dropdown-item {
    color: var(--text-primary);
}

.dropdown-item:hover {
    color: var(--text-primary);
    background: var(--lunker-hover);
}

/* ==========================================
   LUNKER CARD SYSTEM
   ========================================== */
.lunker-card {
    background: var(--card-background);
    border-radius: var(--border-radius-card);
    box-shadow: var(--shadow-light);
    padding: var(--spacing-xl);
    margin-bottom: var(--spacing-lg);
    transition: all var(--transition-medium);
    border: 1px solid var(--border-light);
    color: var(--text-primary);
}

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

.lunker-card.highlight {
    border: 2px solid var(--lunker-accent);
    box-shadow: var(--shadow-medium);
}

.lunker-card.compact {
    padding: var(--spacing-lg);
}

.lunker-card.white {
    background: var(--card-background);
    border: 1px solid var(--border-light);
}

.lunker-card.cream {
    background: var(--card-background-cream);
    border: 1px solid var(--border-light);
}

.lunker-card.cream-light {
    background: var(--lunker-cream-light);
    border: 1px solid var(--border-light);
}

/* ==========================================
   LUNKER BUTTON SYSTEM
   ========================================== */
.btn-lunker {
    padding: 12px 24px;
    border: none;
    border-radius: var(--border-radius-xl);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all var(--transition-medium);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    line-height: 1;
}

.btn-lunker-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-medium);
}

.btn-lunker-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
    color: white;
    text-decoration: none;
}

.btn-lunker-secondary {
    background: var(--card-background);
    color: var(--text-primary);
    border: 2px solid var(--border-light);
}

.btn-lunker-secondary:hover {
    border-color: var(--lunker-primary);
    color: var(--lunker-primary);
    transform: translateY(-1px);
    box-shadow: var(--shadow-light);
    text-decoration: none;
}

.btn-lunker-success {
    background: var(--gradient-success);
    color: white;
    box-shadow: var(--shadow-medium);
}

.btn-lunker-success:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
    color: white;
    text-decoration: none;
}

.btn-lunker-danger {
    background: linear-gradient(135deg, var(--lunker-danger), #b02a5b);
    color: white;
    box-shadow: var(--shadow-medium);
}

.btn-lunker-danger:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
    color: white;
    text-decoration: none;
}

.btn-lunker-outline {
    background: transparent;
    color: var(--lunker-primary);
    border: 2px solid var(--lunker-primary);
}

.btn-lunker-outline:hover {
    background: var(--lunker-primary);
    color: white;
    text-decoration: none;
}

.btn-lunker-cream {
    background: var(--lunker-cream);
    color: var(--lunker-primary);
    border: 2px solid var(--border-light);
}

.btn-lunker-cream:hover {
    background: var(--lunker-hover);
    color: var(--lunker-primary);
    border-color: var(--lunker-primary);
    transform: translateY(-1px);
    text-decoration: none;
}

.btn-lunker-cream-outline {
    background: transparent;
    color: var(--lunker-primary);
    border: 2px solid var(--border-light);
}

.btn-lunker-cream-outline:hover {
    background: var(--lunker-cream);
    color: var(--lunker-primary);
    text-decoration: none;
}

.btn-lunker-sm {
    padding: 8px 16px;
    font-size: 0.875rem;
}

.btn-lunker-lg {
    padding: 16px 32px;
    font-size: 1.125rem;
}

/* ==========================================
   LUNKER TYPOGRAPHY
   ========================================== */
.lunker-title {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
    line-height: 1.2;
}

.lunker-text-primary { color: var(--lunker-primary); }
.lunker-text-secondary { color: var(--lunker-secondary); }
.lunker-text-accent { color: var(--lunker-accent); }
.lunker-text-muted { color: var(--text-muted); }

.lunker-heading {
    color: var(--text-primary);
    font-weight: 700;
    margin-bottom: var(--spacing-md);
}

/* ==========================================
   LUNKER TABLES - ENHANCED READABILITY
   ========================================== */
.lunker-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    background: var(--card-background);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-light);
    border: 1px solid var(--border-light);
}

.lunker-table th {
    background: var(--gradient-primary);
    color: white;
    padding: var(--spacing-md);
    text-align: left;
    font-weight: 600;
    font-size: 0.95rem;
    border-bottom: 2px solid var(--lunker-secondary);
}

.lunker-table td {
    padding: 14px var(--spacing-md);
    border-bottom: 1px solid var(--border-light);
    color: var(--text-primary);
    background: var(--card-background);
    font-size: 0.9rem;
}

.lunker-table tr:nth-child(even) td {
    background: var(--lunker-light);
    color: var(--text-primary);
}

[data-theme="dark"] .lunker-table tr:nth-child(even) td {
    background: #252525;
}

.lunker-table.cream-stripes tr:nth-child(even) td {
    background: var(--lunker-cream);
    color: var(--text-primary);
}

.lunker-table tr:hover td {
    background: var(--lunker-hover);
    color: var(--text-primary) !important;
}

.lunker-table-striped tbody tr:nth-child(odd) td {
    background-color: var(--lunker-light);
    color: var(--text-primary);
}

[data-theme="dark"] .lunker-table-striped tbody tr:nth-child(odd) td {
    background-color: #252525;
}

.lunker-table-striped.cream-stripes tbody tr:nth-child(odd) td {
    background-color: var(--lunker-cream);
    color: var(--text-primary);
}

/* ==========================================
   LUNKER FORM ELEMENTS
   ========================================== */
.lunker-input {
    width: 100%;
    padding: 12px var(--spacing-md);
    border: 2px solid var(--border-light);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: all var(--transition-medium);
    background: var(--card-background);
    color: var(--text-primary);
}

.lunker-input.cream {
    background: var(--lunker-cream-light);
    border-color: var(--border-light);
}

.lunker-input.on-cream {
    background: var(--card-background);
    border-color: var(--border-light);
}

.lunker-input:focus {
    outline: none;
    border-color: var(--lunker-primary);
    box-shadow: 0 0 0 3px var(--lunker-hover);
}

.lunker-input.cream:focus {
    border-color: var(--lunker-primary);
    background: var(--card-background);
}

.lunker-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 8px center;
    background-repeat: no-repeat;
    background-size: 16px;
    padding-right: 40px;
}

.lunker-textarea {
    min-height: 120px;
    resize: vertical;
}

.lunker-checkbox,
.lunker-radio {
    accent-color: var(--lunker-primary);
}

/* ==========================================
   LUNKER ALERTS
   ========================================== */
.lunker-alert {
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: var(--border-radius-lg);
    border: none;
    margin-bottom: var(--spacing-lg);
    font-weight: 500;
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-md);
}

.lunker-alert-success {
    background: rgba(40, 167, 69, 0.1);
    color: #155724;
    border-left: 4px solid var(--lunker-success);
}

[data-theme="dark"] .lunker-alert-success {
    background: rgba(74, 222, 128, 0.15);
    color: #86efac;
}

.lunker-alert-warning {
    background: rgba(255, 193, 7, 0.1);
    color: #856404;
    border-left: 4px solid var(--lunker-warning);
}

[data-theme="dark"] .lunker-alert-warning {
    background: rgba(251, 191, 36, 0.15);
    color: #fcd34d;
}

.lunker-alert-danger {
    background: rgba(220, 53, 69, 0.1);
    color: #721c24;
    border-left: 4px solid var(--lunker-danger);
}

[data-theme="dark"] .lunker-alert-danger {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
}

.lunker-alert-info {
    background: rgba(23, 162, 184, 0.1);
    color: #0c5460;
    border-left: 4px solid var(--lunker-info);
}

[data-theme="dark"] .lunker-alert-info {
    background: rgba(56, 189, 248, 0.15);
    color: #7dd3fc;
}

/* ==========================================
   LUNKER BADGES & TAGS
   ========================================== */
.lunker-badge {
    display: inline-block;
    padding: 4px 12px;
    background: var(--lunker-light);
    color: var(--lunker-primary);
    border-radius: var(--border-radius-pill);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.lunker-badge-primary {
    background: var(--gradient-primary);
    color: white;
}

.lunker-badge-success {
    background: var(--lunker-success);
    color: white;
}

.lunker-tag {
    background: var(--gradient-primary);
    color: white;
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--border-radius-pill);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all var(--transition-medium);
    box-shadow: var(--shadow-light);
    display: inline-block;
}

.lunker-tag:hover {
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
    background: var(--gradient-accent);
    text-decoration: none;
}

/* ==========================================
   LUNKER NAVIGATION ENHANCEMENTS
   ========================================== */
.lunker-nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--border-radius);
    transition: all var(--transition-medium);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.lunker-nav-link:hover {
    background: var(--lunker-hover);
    color: var(--lunker-primary);
    text-decoration: none;
}

.lunker-nav-link.cream:hover {
    background: var(--lunker-cream);
    color: var(--lunker-primary);
    text-decoration: none;
}

.lunker-nav-link.active {
    background: var(--lunker-active);
    color: var(--lunker-primary);
    font-weight: 600;
}

/* ==========================================
   LUNKER NAVBAR SYSTEM
   ========================================== */
.lunker-navbar {
    background: var(--lunker-cream);
    border-bottom: 2px solid var(--border-light);
    box-shadow: var(--shadow-light);
    padding: var(--spacing-md) 0;
}

.lunker-navbar-gradient {
    background: var(--gradient-green-cream);
    border-bottom: 3px solid var(--lunker-primary);
}

.lunker-navbar-bold {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-medium);
}

.lunker-navbar .navbar-brand:hover img {
    transform: scale(1.05);
    filter: drop-shadow(0 4px 8px rgba(45, 90, 45, 0.15));
    transition: all var(--transition-medium);
}

.lunker-navbar .nav-link {
    color: var(--lunker-primary);
    border-radius: var(--border-radius);
    transition: all var(--transition-medium);
    padding: var(--spacing-sm) var(--spacing-md);
}

.lunker-navbar .nav-link:hover {
    background: var(--lunker-hover);
    color: var(--lunker-primary);
}

.lunker-navbar-bold .nav-link {
    color: white;
}

.lunker-navbar-bold .nav-link:hover {
    background: rgba(255,255,255,0.2);
}

/* ==========================================
   LUNKER UTILITY CLASSES
   ========================================== */
.lunker-bg-primary { background-color: var(--lunker-primary) !important; }
.lunker-bg-secondary { background-color: var(--lunker-secondary) !important; }
.lunker-bg-accent { background-color: var(--lunker-accent) !important; }
.lunker-bg-light { background-color: var(--lunker-light) !important; }
.lunker-bg-cream { background-color: var(--lunker-cream) !important; }
.lunker-bg-cream-light { background-color: var(--lunker-cream-light) !important; }
.lunker-bg-cream-dark { background-color: var(--lunker-cream-dark) !important; }

.lunker-border-primary { border-color: var(--lunker-primary) !important; }
.lunker-border-light { border-color: var(--border-light) !important; }
.lunker-border-cream { border-color: var(--lunker-cream) !important; }
.lunker-border-cream-dark { border-color: var(--lunker-cream-dark) !important; }

.lunker-shadow-sm { box-shadow: var(--shadow-light); }
.lunker-shadow-md { box-shadow: var(--shadow-medium); }
.lunker-shadow-lg { box-shadow: var(--shadow-hover); }

.lunker-rounded { border-radius: var(--border-radius); }
.lunker-rounded-lg { border-radius: var(--border-radius-lg); }
.lunker-rounded-xl { border-radius: var(--border-radius-xl); }
.lunker-rounded-card { border-radius: var(--border-radius-card); }
.lunker-rounded-pill { border-radius: var(--border-radius-pill); }

/* ==========================================
   LUNKER RESPONSIVE DESIGN
   ========================================== */
@media (max-width: 768px) {
    .lunker-card {
      padding: var(--spacing-lg);
      margin-bottom: var(--spacing-md);
    }

    .btn-lunker {
      width: 100%;
      justify-content: center;
    }
}

/* Override Bootstrap text colors for better contrast */
.text-primary { color: var(--text-primary) !important; }
.text-secondary { color: var(--text-secondary) !important; }
.text-muted { color: var(--text-muted) !important; }

/* Ensure table text is always readable */
table td, table th {
    color: inherit;
}

/* ENSURE PROPER BACKGROUND */
body {
    background: var(--background-cream) !important;
}

/* TABLE HOVER FIX - Improved contrast */
.lunker-table tr:hover td {
    background: var(--lunker-hover) !important; 
    color: var(--text-primary) !important;
    transition: background 0.2s ease;
}
