/* ============================================================
   Cell Dealers Platform — Design System 2.0
   Modern • Warm • Beautiful — with Full Dark Mode
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ===== CSS RESET ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ===== DESIGN TOKENS — LIGHT MODE ===== */
:root {
    /* Brand */
    --primary-color:  #4F46E5;
    --primary:        #4F46E5;   /* alias used by view inline styles */
    --primary-dark:   #3730A3;
    --primary-light:  #818CF8;
    --primary-rgb:    79, 70, 229;
    --secondary:      #7C3AED;   /* purple for gradients, used by request-type-badge, budget-card */

    /* Extra aliases used by dashboard/view inline styles */
    --success-bg:     rgba(16, 185, 129, 0.1);

    --accent-color:   #F59E0B;
    --accent-dark:    #D97706;
    --accent-light:   #FCD34D;
    --accent-rgb:     245, 158, 11;

    /* Gradients */
    --gradient-brand:  linear-gradient(135deg, #4F46E5 0%, #7C3AED 100%);
    --gradient-warm:   linear-gradient(135deg, #F59E0B 0%, #EF4444 100%);
    --gradient-hero:   linear-gradient(135deg, #1E1B4B 0%, #312E81 45%, #4F46E5 100%);
    --gradient-subtle: linear-gradient(135deg, #EEF2FF 0%, #F5F3FF 100%);

    /* Backgrounds */
    --bg-base:     #FFFFFF;
    --bg-subtle:   #F8F7FF;
    --bg-card:     #FFFFFF;
    --bg-elevated: #EEF2FF;
    --bg-muted:    #F3F4F6;

    /* Legacy bg aliases used throughout PHP views */
    --white:      #FFFFFF;
    --light-gray: #EEF2FF;
    --bg-light:   #F8F7FF;

    /* Text */
    --text-primary:   #1E1B4B;
    --text-secondary: #4B5563;
    --text-muted:     #9CA3AF;
    --text-inverse:   #FFFFFF;

    /* Legacy text aliases */
    --dark-gray:   #1E1B4B;
    --medium-gray: #6B7280;
    --heading:     #1E1B4B;

    /* Borders */
    --border:        #E0E7FF;
    --border-strong: #C7D2FE;

    /* Status */
    --success: #10B981;
    --warning: #F59E0B;
    --error:   #EF4444;
    --info:    #6366F1;

    /* Shadows */
    --shadow-xs:          0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-sm:          0 1px 4px rgba(79, 70, 229, 0.07), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md:          0 4px 20px rgba(79, 70, 229, 0.09), 0 2px 6px rgba(0,0,0,0.04);
    --shadow-lg:          0 16px 48px rgba(79, 70, 229, 0.13), 0 4px 12px rgba(0,0,0,0.06);
    --shadow-glow:        0 0 32px rgba(79, 70, 229, 0.22);
    --shadow-glow-accent: 0 0 32px rgba(245, 158, 11, 0.25);

    /* Typography */
    --font-primary:    'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-size-base:  16px;
    --line-height-base: 1.65;

    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 4rem;

    /* Border Radius */
    --radius-sm:   6px;
    --radius-md:   10px;
    --radius-lg:   16px;
    --radius-xl:   24px;
    --radius-full: 9999px;

    /* Transitions */
    --transition:        all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow:   all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ===== DESIGN TOKENS — DARK MODE ===== */
[data-theme="dark"] {
    --primary:     #818CF8;   /* lighter in dark mode for visibility */
    --secondary:   #A5B4FC;   /* lighter purple for gradients in dark mode */
    --bg-base:     #0C0A18;
    --bg-subtle:   #13102A;
    --bg-card:     #1A1730;
    --bg-elevated: #231E3D;
    --bg-muted:    #1C1835;

    --white:      #1A1730;
    --light-gray: #231E3D;
    --bg-light:   #13102A;

    --text-primary:   #EEF2FF;
    --text-secondary: #A5B4FC;
    --text-muted:     #94A3B8;   /* lighter for contrast on dark backgrounds */
    --text-inverse:   #FFFFFF;    /* keep white for dark-background sections (hero, CTA, imei-hero) */

    --dark-gray:   #EEF2FF;
    --medium-gray: #A5B4FC;
    --heading:     #EEF2FF;

    --border:        #2A2550;
    --border-strong: #3D3570;

    --shadow-sm: 0 1px 4px rgba(0,0,0,0.4);
    --shadow-md: 0 4px 20px rgba(0,0,0,0.45);
    --shadow-lg: 0 16px 48px rgba(0,0,0,0.55);
    --shadow-glow: 0 0 40px rgba(99, 102, 241, 0.3);
}

/* ===== BASE ===== */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    font-family: var(--font-primary);
    font-size: var(--font-size-base);
    line-height: var(--line-height-base);
    color: var(--text-primary);
    background-color: var(--bg-base);
    transition: background-color 0.3s ease, color 0.3s ease;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}
a:hover { color: var(--primary-dark); }

[data-theme="dark"] a { color: var(--primary-light); }
[data-theme="dark"] a:hover { color: #C7D2FE; }

img { max-width: 100%; height: auto; display: block; }

h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary);
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -0.01em;
}

/* ===== LAYOUT ===== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-sm);
}

.main-content {
    min-height: calc(100vh - 400px);
}

/* ===== HEADER ===== */
.main-header {
    background-color: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-bottom: 1px solid var(--border);
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    height: 70px;
    display: flex;
    align-items: center;
    transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

[data-theme="dark"] .main-header {
    background-color: rgba(12, 10, 24, 0.9);
    border-bottom-color: var(--border);
}

.main-header.scrolled {
    box-shadow: var(--shadow-md);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    gap: 1rem;
}

/* Header actions: theme toggle + hamburger (grouped on mobile) */
.header-actions {
    display: flex;
    align-items: center;
}

/* Logo - left side */
.logo {
    flex-shrink: 0;
}

/* Navigation - right side */
.main-nav {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin-left: auto;
    padding-right: 0.25rem;
}

/* Logo */
.logo-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    flex-shrink: 0;
}

.logo-img {
    height: 40px;
    width: auto;
}

.logo-text h1,
.logo-text .logo-name {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0;
    letter-spacing: -0.03em;
    display: block;
}

.logo-check {
    background: var(--gradient-brand);
    color: white;
    border-radius: 50%;
    width: 1.1rem;
    height: 1.1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
}

.tagline {
    font-size: 0.68rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-top: 0.1rem;
    font-weight: 500;
}

/* Navigation styles continue below */

.nav-link {
    color: var(--text-secondary);
    padding: 0.45rem 0.7rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    transition: var(--transition);
}

.nav-link:hover {
    color: var(--primary-color);
    background-color: var(--bg-elevated);
}

[data-theme="dark"] .nav-link { color: var(--text-secondary); }
[data-theme="dark"] .nav-link:hover { color: var(--primary-light); background-color: var(--bg-elevated); }

/* Dropdown */
.nav-dropdown { position: relative; }

.nav-dropdown-toggle {
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 0.45rem 0.7rem;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    font-family: var(--font-primary);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.nav-dropdown-toggle:hover {
    color: var(--primary-color);
    background-color: var(--bg-elevated);
}

[data-theme="dark"] .nav-dropdown-toggle { color: var(--text-secondary); }
[data-theme="dark"] .nav-dropdown-toggle:hover { color: var(--primary-light); background-color: var(--bg-elevated); }

.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;          /* NO gap — hover area is unbroken */
    left: 0;
    padding-top: 8px;   /* visual breathing room — padding IS inside hover area */
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    min-width: 210px;
    box-shadow: var(--shadow-lg);
    z-index: 1001;
    overflow: hidden;
    animation: dropdownAppear 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes dropdownAppear {
    from { opacity: 0; transform: translateY(-8px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.nav-dropdown:hover .nav-dropdown-menu { display: block; }

.nav-dropdown-menu a {
    display: block;
    padding: 0.55rem 1rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    border-bottom: 1px solid var(--border);
    transition: var(--transition);
}

.nav-dropdown-menu a:last-child { border-bottom: none; }

.nav-dropdown-menu a:hover {
    background-color: var(--bg-elevated);
    color: var(--primary-color);
    padding-left: 1.25rem;
}

[data-theme="dark"] .nav-dropdown-menu a:hover { color: var(--primary-light); }

.nav-dropdown-menu hr {
    margin: 0.25rem 0;
    border: none;
    border-top: 1px solid var(--border);
}

/* Theme Toggle */
.theme-toggle {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease, transform 0.25s ease;
    color: var(--text-secondary);
    flex-shrink: 0;
    margin-left: 0.5rem;
}

.theme-toggle:hover {
    background: var(--gradient-brand);
    border-color: transparent;
    color: white;
    box-shadow: var(--shadow-glow);
    transform: scale(1.1) rotate(15deg);
}

.theme-toggle svg {
    width: 17px;
    height: 17px;
    transition: var(--transition);
    pointer-events: none;
}

.theme-toggle .sun-icon  { display: none; }
.theme-toggle .moon-icon { display: block; }

[data-theme="dark"] .theme-toggle .sun-icon  { display: block; }
[data-theme="dark"] .theme-toggle .moon-icon { display: none; }

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    cursor: pointer;
    padding: 0;
    border-radius: var(--radius-sm);
    gap: 4px;
    width: 40px;
    height: 40px;
}

.mobile-menu-toggle span {
    width: 18px;
    height: 2px;
    background-color: var(--text-primary);
    border-radius: 2px;
    transition: var(--transition);
    display: block;
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    text-align: center;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    font-family: var(--font-primary);
    letter-spacing: 0.01em;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: var(--gradient-brand);
    color: white;
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.35);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(79, 70, 229, 0.45);
    color: white;
}

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

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

.btn-secondary:hover {
    background-color: var(--bg-muted);
    border-color: var(--border-strong);
    transform: translateY(-1px);
}

/* Ensure primary buttons always have white text in dark mode */
[data-theme="dark"] .btn-primary,
[data-theme="dark"] .btn-primary:hover,
[data-theme="dark"] .btn-primary:focus,
[data-theme="dark"] .btn-primary:active,
[data-theme="dark"] a.btn-primary,
[data-theme="dark"] a.btn-primary:hover {
    color: white !important;
}

[data-theme="dark"] .btn-secondary { color: var(--text-primary); }

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

.btn-outline:hover {
    background: var(--gradient-brand);
    color: white;
    border-color: transparent;
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.3);
}

[data-theme="dark"] .btn-outline { color: var(--primary-light); border-color: var(--primary-light); }
[data-theme="dark"] .btn-outline:hover { color: white; border-color: transparent; }

.btn-block { display: flex; width: 100%; }

.btn-large {
    padding: 0.875rem 2rem;
    font-size: 1rem;
    border-radius: var(--radius-lg);
}

.btn-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
    border-radius: var(--radius-sm);
}

/* ===== FORMS ===== */
.form-control {
    width: 100%;
    padding: 0.65rem 1rem;
    font-size: 0.9rem;
    font-family: var(--font-primary);
    color: var(--text-primary);
    background-color: var(--bg-card);
    border: 1.5px solid #CBD5E1;    /* clearly visible neutral gray border */
    border-radius: var(--radius-md);
    transition: var(--transition);
    appearance: none;
    -webkit-appearance: none;
}

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

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.15);
}

[data-theme="dark"] .form-control {
    background-color: var(--bg-elevated);
    border-color: #4A4570;   /* clearly visible on dark background */
    color: var(--text-primary);
}

[data-theme="dark"] .form-control:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.form-group { margin-bottom: var(--spacing-sm); }

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

.form-group small {
    display: block;
    margin-top: 0.35rem;
    color: var(--text-muted);
    font-size: 0.78rem;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-sm);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    cursor: pointer;
    font-size: 0.875rem;
}

.input-group { display: flex; align-items: center; gap: 0.5rem; }
.input-group-separator { color: var(--text-muted); }

/* Password input with toggle visibility */
.password-input-wrap {
    position: relative;
}
.password-input-wrap .form-control {
    padding-right: 2.75rem;
}
.password-toggle-btn {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 0.35rem;
    cursor: pointer;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}
.password-toggle-btn:hover {
    color: var(--primary-color);
}
.password-toggle-btn:focus {
    outline: none;
}

/* ===== HERO SECTION ===== */
.hero {
    background: var(--gradient-subtle);
    color: var(--text-primary);
    padding: var(--spacing-xl) 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 15% 60%, rgba(79, 70, 229, 0.06) 0%, transparent 55%),
        radial-gradient(ellipse at 85% 20%, rgba(124, 58, 237, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 100%, rgba(79, 70, 229, 0.04) 0%, transparent 40%);
    pointer-events: none;
}

[data-theme="dark"] .hero {
    background: var(--gradient-hero);
    color: white;
}

[data-theme="dark"] .hero::before {
    background:
        radial-gradient(ellipse at 15% 60%, rgba(124, 58, 237, 0.35) 0%, transparent 55%),
        radial-gradient(ellipse at 85% 20%, rgba(99, 102, 241, 0.3) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 100%, rgba(79, 70, 229, 0.2) 0%, transparent 40%);
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: var(--spacing-sm);
    letter-spacing: -0.03em;
    line-height: 1.12;
    position: relative;
    color: #111827;
}

[data-theme="dark"] .hero-title {
    color: white;
}

.hero-subtitle {
    font-size: 1.15rem;
    margin-bottom: var(--spacing-lg);
    color: var(--text-secondary);
    max-width: 540px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.7;
    position: relative;
}

[data-theme="dark"] .hero-subtitle {
    color: rgba(255, 255, 255, 0.82);
}

.hero-actions {
    display: flex;
    justify-content: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-lg);
    flex-wrap: wrap;
    position: relative;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: var(--spacing-xl);
    margin-top: var(--spacing-lg);
    position: relative;
}

.stat { display: flex; flex-direction: column; align-items: center; }

.stat-number {
    font-size: 2.25rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--primary-color);
}

[data-theme="dark"] .stat-number { color: white; }

.stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-top: 0.2rem;
}

[data-theme="dark"] .stat-label { color: rgba(255,255,255,0.65); }

/* ===== SECTIONS ===== */
.section-title {
    font-size: 2.25rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
    letter-spacing: -0.03em;
}

.section-subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-lg);
    font-size: 1rem;
    max-width: 540px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.7;
}

.section-footer {
    text-align: center;
    margin-top: var(--spacing-lg);
}

.elite-members,
.features,
.recent-offers {
    padding: var(--spacing-xl) 0;
}

.elite-members { background-color: var(--bg-subtle); }

/* ===== GRIDS ===== */
.members-grid,
.features-grid,
.offers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--spacing-md);
    margin-top: var(--spacing-lg);
}

/* ===== CARDS ===== */
.member-card,
.feature-card,
.offer-card {
    background-color: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.member-card:hover,
.offer-card:hover {
    box-shadow: var(--shadow-lg);
    border-color: var(--border-strong);
    transform: translateY(-5px);
}

[data-theme="dark"] .member-card:hover,
[data-theme="dark"] .offer-card:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow-glow);
}

.feature-card {
    border: 1px solid var(--border);
    text-align: center;
}

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

[data-theme="dark"] .feature-card:hover {
    border-color: var(--primary-light);
    box-shadow: 0 0 28px rgba(99, 102, 241, 0.2);
}

.member-logo {
    width: 80px;
    height: 80px;
    margin: 0 auto var(--spacing-sm);
    border-radius: 50%;
    overflow: hidden;
    background-color: var(--bg-elevated);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--border);
}

.member-logo img { width: 100%; height: 100%; object-fit: cover; }

.member-name {
    text-align: center;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.member-rating { text-align: center; margin-bottom: 0.5rem; }

.member-location {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-bottom: var(--spacing-sm);
}

.feature-icon {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: var(--spacing-sm);
}

.feature-card h3 {
    text-align: center;
    margin-bottom: var(--spacing-xs);
    color: var(--text-primary);
    font-size: 1.1rem;
}

.feature-card p {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.65;
}

/* ===== OFFER CARD ===== */
.offer-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    border-radius: var(--radius-md);
    background-color: var(--bg-elevated);
    margin-bottom: var(--spacing-sm);
    position: relative;
}

.offer-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.45s ease;
}

.offer-card:hover .offer-image img { transform: scale(1.05); }

.offer-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 2.5rem;
}

.offer-title a {
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.4;
}

.offer-title a:hover { color: var(--primary-color); }

.offer-details { color: var(--text-muted); margin: 0.5rem 0; font-size: 0.85rem; }

.offer-meta {
    display: flex;
    justify-content: space-between;
    margin: 0.5rem 0;
    font-weight: 600;
}

.offer-price {
    color: var(--primary-color);
    font-size: 1.1rem;
    font-weight: 700;
}

.offer-company { margin: 0.5rem 0; font-size: 0.85rem; }

.offer-time { color: var(--text-muted); font-size: 0.78rem; }

/* ===== BADGES ===== */
.badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-mini { padding: 0.1rem 0.4rem; font-size: 0.62rem; }

.badge-verified {
    background-color: rgba(16, 185, 129, 0.12);
    color: #059669;
    border: 1px solid rgba(16, 185, 129, 0.25);
}

[data-theme="dark"] .badge-verified {
    background-color: rgba(16, 185, 129, 0.2);
    color: #34D399;
    border-color: rgba(52, 211, 153, 0.3);
}

.badge-condition {
    background-color: rgba(99, 102, 241, 0.1);
    color: var(--primary-color);
    border: 1px solid rgba(99, 102, 241, 0.2);
}

[data-theme="dark"] .badge-condition { color: var(--primary-light); }

/* ===== RATING STARS ===== */
.star        { color: var(--warning); font-size: 1rem; }
.star-full   { color: var(--warning); }
.star-half   { color: var(--warning); opacity: 0.6; }
.star-empty  { color: var(--border-strong); }

.rating-count {
    color: var(--text-muted);
    font-size: 0.78rem;
    margin-left: 0.25rem;
}

/* ===== CTA SECTION ===== */
.cta {
    background: var(--gradient-hero);
    color: white;
    padding: var(--spacing-xl) 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.cta::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 25% 50%, rgba(255,255,255,0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 75% 50%, rgba(255,255,255,0.06) 0%, transparent 50%);
    pointer-events: none;
}

.cta h2 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: var(--spacing-sm);
    color: white;
    letter-spacing: -0.03em;
}

.cta p {
    font-size: 1.1rem;
    margin-bottom: var(--spacing-lg);
    opacity: 0.9;
    color: rgba(255, 255, 255, 0.95);
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.7;
}

[data-theme="dark"] .cta p {
    color: rgba(255, 255, 255, 0.95) !important;
    opacity: 0.95;
}

/* ===== FOOTER ===== */
.main-footer {
    background: linear-gradient(180deg, #1E1B4B 0%, #0D0B1E 100%);
    color: rgba(255, 255, 255, 0.8);
    padding: var(--spacing-xl) 0 var(--spacing-sm);
    margin-top: var(--spacing-xl);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
}

.footer-section h3,
.footer-section h4 {
    color: white;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 1.1rem;
}

.footer-section p {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.55);
    line-height: 1.75;
}

.footer-section ul { list-style: none; }
.footer-section ul li { margin-bottom: 0.6rem; }

.footer-section a {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.85rem;
    transition: var(--transition);
}

.footer-section a:hover {
    color: white;
    padding-left: 4px;
}

.footer-mini-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
    align-items: center;
    margin-top: var(--spacing-md);
}

.footer-mini-nav a {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
}

.footer-mini-nav a:hover {
    color: white;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    padding-top: var(--spacing-sm);
    text-align: center;
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.35);
}

.social-links { display: flex; gap: 0.6rem; flex-wrap: wrap; }

.social-link {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 0.9rem;
    background-color: rgba(255, 255, 255, 0.07);
    border-radius: var(--radius-full);
    font-size: 0.78rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: var(--transition);
}

.social-link:hover {
    background-color: rgba(255, 255, 255, 0.15);
    color: white !important;
    transform: translateY(-2px);
    border-color: rgba(255,255,255,0.2);
}

/* ===== AUTH PAGES ===== */
.auth-page {
    min-height: calc(100vh - 400px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-lg) 0;
    background-color: var(--bg-subtle);
}

.auth-container { width: 100%; max-width: 480px; }

.auth-box {
    background-color: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: var(--spacing-xl);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
}

.auth-box-large { max-width: 680px; }

.auth-box h1 {
    text-align: center;
    margin-bottom: var(--spacing-xs);
    font-size: 1.75rem;
    letter-spacing: -0.03em;
}

.auth-subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-lg);
    font-size: 0.9rem;
}

.auth-form { margin-bottom: var(--spacing-md); }

.auth-links {
    text-align: center;
    margin-top: var(--spacing-sm);
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.auth-footer {
    text-align: center;
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--border);
    font-size: 0.85rem;
}

/* ===== FLASH MESSAGES ===== */
.flash-messages {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 9999;
    max-width: 380px;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.alert {
    padding: 0.875rem 2.5rem 0.875rem 1.1rem;
    border-radius: var(--radius-lg);
    position: relative;
    box-shadow: var(--shadow-lg);
    font-size: 0.875rem;
    font-weight: 500;
    animation: alertSlideIn 0.3s ease;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

@keyframes alertSlideIn {
    from { opacity: 0; transform: translateX(20px); }
    to   { opacity: 1; transform: translateX(0); }
}

.alert-success { background: rgba(16, 185, 129, 0.93); color: white; }
.alert-error   { background: rgba(239, 68, 68, 0.93); color: white; }
.alert-warning { background: rgba(245, 158, 11, 0.93); color: white; }
.alert-info    { background: rgba(79, 70, 229, 0.93); color: white; }

.alert-close {
    position: absolute;
    top: 50%;
    right: 0.75rem;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: inherit;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0.7;
    padding: 0.2rem;
    line-height: 1;
}

.alert-close:hover { opacity: 1; }

/* ===== PAGE HEADER ===== */
.page-header {
    background: var(--gradient-hero);
    color: white;
    padding: var(--spacing-lg) 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.page-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, rgba(255,255,255,0.07) 0%, transparent 70%);
}

.page-header h1 {
    font-size: 2.25rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    color: white;
    letter-spacing: -0.03em;
    position: relative;
}

.page-header p {
    opacity: 0.8;
    position: relative;
    font-size: 1rem;
}

/* ===== MARKET PAGE ===== */
.market-page {
    padding: var(--spacing-lg) 0;
}

.market-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: var(--spacing-lg);
}

.market-filters {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    height: fit-content;
    position: sticky;
    top: 80px;
}

.filter-form h3 {
    margin-bottom: var(--spacing-sm);
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-primary);
}

.filter-group { margin-bottom: var(--spacing-sm); }

.filter-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.4rem;
    color: var(--text-primary);
    font-size: 0.875rem;
}

.filter-actions {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    margin-top: var(--spacing-md);
}

.filter-cta {
    margin-top: var(--spacing-lg);
    padding: var(--spacing-md);
    background: var(--gradient-brand);
    border-radius: var(--radius-md);
    text-align: center;
    color: white;
}

.filter-cta h4 {
    margin-bottom: var(--spacing-sm);
    color: white;
    font-size: 0.95rem;
}

/* ===== MARKET TOOLBAR ===== */
.market-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-md);
    padding: 0.75rem 1rem;
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}

.sort-options { display: flex; align-items: center; gap: 0.5rem; font-size: 0.875rem; }

.sort-options label {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.sort-options select { width: auto; }

/* ===== OFFERS TABLE ===== */
.offers-table {
    background-color: var(--bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
}

.offers-table table { width: 100%; border-collapse: collapse; }

.offers-table thead {
    background: var(--gradient-brand);
    color: white;
}

.offers-table th,
.offers-table td {
    padding: 0.875rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 0.85rem;
}

.offers-table th {
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.offers-table tbody tr:hover { background-color: var(--bg-subtle); }

.product-info { display: flex; align-items: center; gap: var(--spacing-sm); }

.product-thumb {
    width: 52px;
    height: 52px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

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

/* ===== PAGINATION ===== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.4rem;
    margin-top: var(--spacing-lg);
}

.pagination .btn {
    min-width: 38px;
    padding: 0.45rem 0.7rem;
    font-size: 0.85rem;
}

.pagination-info {
    padding: 0.5rem 0.875rem;
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center;
    padding: 5rem var(--spacing-xl);
    color: var(--text-muted);
}

.empty-state p {
    font-size: 1.1rem;
    margin-bottom: var(--spacing-md);
    color: var(--text-secondary);
}

/* ===== UTILITY ===== */
.text-center { text-align: center; }

/* ===== KEYFRAMES ===== */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 0 20px rgba(79, 70, 229, 0.2); }
    50%       { box-shadow: 0 0 40px rgba(79, 70, 229, 0.4); }
}

/* ===== DARK MODE: OVERRIDE HARDCODED WHITE BACKGROUNDS IN VIEWS ===== */
/*
 * Many view inline <style> blocks use `background: white` or `background: #fff`.
 * These overrides ensure those elements stay readable in dark mode.
 */

/* Dashboard — my-profile.php */
[data-theme="dark"] .profile-form-section,
[data-theme="dark"] .profile-stats-card,
[data-theme="dark"] .profile-info-card,
[data-theme="dark"] .verification-cta-card,
[data-theme="dark"] .danger-zone-card {
    background: var(--bg-card) !important;
    box-shadow: var(--shadow-md) !important;
    color: var(--text-primary);
}

/* Dashboard — my-reviews.php, my-requests.php, my-offers.php */
[data-theme="dark"] .review-card,
[data-theme="dark"] .request-card,
[data-theme="dark"] .requests-table,
[data-theme="dark"] .offers-list,
[data-theme="dark"] .offer-item {
    background: var(--bg-card) !important;
    color: var(--text-primary);
}

/* Market news, contact, coming-soon */
[data-theme="dark"] .news-card,
[data-theme="dark"] .contact-form-wrap,
[data-theme="dark"] .coming-soon-card {
    background: var(--bg-card) !important;
    color: var(--text-primary);
}

/* Subscription success/canceled pages */
[data-theme="dark"] .success-card,
[data-theme="dark"] .cancel-card,
[data-theme="dark"] .subscription-card {
    background: var(--bg-card) !important;
    color: var(--text-primary);
}

/* Offer show page */
[data-theme="dark"] .offer-detail-wrapper,
[data-theme="dark"] .offer-main-content,
[data-theme="dark"] .offer-sidebar,
[data-theme="dark"] .offer-gallery,
[data-theme="dark"] .main-image,
[data-theme="dark"] .contact-card,
[data-theme="dark"] .seller-card,
[data-theme="dark"] .offer-specs {
    background: var(--bg-card) !important;
    color: var(--text-primary);
}

/* General: any element inside body using hardcoded white backgrounds via inline styles */
[data-theme="dark"] .page-container,
[data-theme="dark"] .page-content,
[data-theme="dark"] .content-card,
[data-theme="dark"] .form-card,
[data-theme="dark"] .info-card,
[data-theme="dark"] .detail-card {
    background: var(--bg-card) !important;
    color: var(--text-primary);
}

/* Fix status badges in dark mode — ensure readable on dark cards */
[data-theme="dark"] .status-verified {
    background: rgba(46, 125, 50, 0.2) !important;
    color: #81C784 !important;
}

[data-theme="dark"] .status-active,
[data-theme="dark"] .status-badge.status-active,
[data-theme="dark"] .status-badge.active {
    background: rgba(16, 185, 129, 0.25) !important;
    color: #6EE7B7 !important;
}

[data-theme="dark"] .status-succeeded {
    background: rgba(16, 185, 129, 0.25) !important;
    color: #6EE7B7 !important;
}

[data-theme="dark"] .status-failed {
    background: rgba(239, 68, 68, 0.25) !important;
    color: #FCA5A5 !important;
}

[data-theme="dark"] .status-pending {
    background: rgba(245, 158, 11, 0.25) !important;
    color: #FCD34D !important;
}

/* Badges with colored backgrounds — ensure text contrast */
[data-theme="dark"] .badge[style*="var(--success)"],
[data-theme="dark"] .badge[style*="var(--warning)"] {
    color: #FFFFFF !important;
}

/* Make sure table cells in dark mode are readable */
[data-theme="dark"] .requests-table td,
[data-theme="dark"] .requests-table th,
[data-theme="dark"] .requests-table thead {
    background: var(--bg-card) !important;
    color: var(--text-primary);
    border-color: var(--border) !important;
}

[data-theme="dark"] .requests-table thead {
    background: var(--bg-elevated) !important;
}

[data-theme="dark"] .requests-table tbody tr:hover td {
    background: var(--bg-elevated) !important;
}

/* Form controls that use var(--border) in inline styles */
[data-theme="dark"] .form-control {
    background-color: var(--bg-elevated) !important;
    color: var(--text-primary) !important;
    border-color: #4A4570 !important;
}

/* Readonly inputs (e.g. create-bundle max_price) — dark mode */
[data-theme="dark"] .form-control[readonly],
[data-theme="dark"] input[readonly] {
    background-color: var(--bg-muted) !important;
    color: var(--text-secondary) !important;
}

/* Danger button hover — dark mode */
[data-theme="dark"] .btn-icon.btn-danger:hover,
[data-theme="dark"] .btn-danger:hover {
    background: rgba(239, 68, 68, 0.25) !important;
    color: #FCA5A5 !important;
}

/* Logo upload section */
[data-theme="dark"] .logo-upload-section {
    background: var(--bg-elevated) !important;
}

/* Form section dividers */
[data-theme="dark"] .form-section {
    border-color: var(--border) !important;
}

/* Btn-icon hover in dark mode */
[data-theme="dark"] .btn-icon:hover {
    background: var(--bg-elevated) !important;
    color: var(--primary-light) !important;
}

/* Dashboard notice in dark mode */
[data-theme="dark"] .dashboard-notice {
    background: var(--bg-elevated) !important;
    color: var(--text-primary);
}

/* Market filters in dark mode */
[data-theme="dark"] .market-filters,
[data-theme="dark"] .dashboard-filters {
    background: var(--bg-card) !important;
    border-color: var(--border) !important;
}

/* Filter CTA keeps gradient in dark mode */
[data-theme="dark"] .filter-cta {
    background: var(--gradient-brand) !important;
    color: white !important;
}

/* Nav mobile menu background in dark mode — extra specificity */
@media (max-width: 768px) {
    [data-theme="dark"] .main-nav {
        background-color: var(--bg-card) !important;
        border-left-color: var(--border) !important;
    }
}

/* ===== COMPREHENSIVE UI FIXES ===== */

/* ---- Hero: "Watch Video" btn-secondary in light mode hero needs good contrast ---- */
.hero .btn-secondary {
    background-color: rgba(255,255,255,0.15);
    border-color: rgba(79,70,229,0.4);
    color: var(--text-primary);
    backdrop-filter: blur(4px);
}
.hero .btn-secondary:hover {
    background-color: rgba(79,70,229,0.1);
    border-color: var(--primary-color);
}
[data-theme="dark"] .hero .btn-secondary {
    background-color: rgba(255,255,255,0.12);
    border-color: rgba(255,255,255,0.3);
    color: white;
}
[data-theme="dark"] .hero .btn-secondary:hover {
    background-color: rgba(255,255,255,0.2);
    border-color: rgba(255,255,255,0.5);
    color: white;
}

/* ---- IMEI / Tool hero sections: always white text on dark gradient (both modes) ---- */
[data-theme="dark"] .imei-hero,
[data-theme="dark"] .imei-hero h1,
[data-theme="dark"] .imei-hero-sub,
[data-theme="dark"] .tool-hero,
[data-theme="dark"] .tool-hero h1 {
    color: #FFFFFF !important;
}
/* ---- IMEI form card: ensure intro text readable on dark card ---- */
[data-theme="dark"] .imei-form-card h2,
[data-theme="dark"] .imei-form label,
[data-theme="dark"] .imei-services-label {
    color: var(--text-primary) !important;
}
[data-theme="dark"] .imei-form-intro {
    color: var(--text-secondary) !important;
}

/* ---- CTA Section: always white text on gradient background ---- */
.cta .btn-primary,
[data-theme="dark"] .cta .btn-primary {
    color: white !important;
    background: rgba(255,255,255,0.2) !important;
    border: 2px solid rgba(255,255,255,0.5) !important;
    box-shadow: none !important;
    backdrop-filter: blur(8px);
}
.cta .btn-primary:hover,
[data-theme="dark"] .cta .btn-primary:hover {
    background: rgba(255,255,255,0.3) !important;
    border-color: white !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.2) !important;
}

/* ---- Contact page: dark mode for form card, info cards, FAQ, social ---- */
[data-theme="dark"] .form-card,
[data-theme="dark"] .info-card,
[data-theme="dark"] .social-links-card,
[data-theme="dark"] .contact-faq-section {
    background: var(--bg-card) !important;
    border: 1px solid var(--border);
    color: var(--text-primary);
}

[data-theme="dark"] .contact-faq-section {
    background: var(--bg-card) !important;
    border: 1px solid var(--border);
}

[data-theme="dark"] .faq-item h4 {
    color: var(--heading) !important;
}

[data-theme="dark"] .faq-item p {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .social-link {
    background: var(--bg-elevated) !important;
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .social-link:hover {
    background: var(--primary) !important;
    color: white !important;
}

/* Center FAQ heading */
.contact-faq-section {
    text-align: center;
}
.contact-faq-section h2 {
    text-align: center;
}
.contact-faq-section .section-subtitle {
    text-align: center;
}
.faq-grid {
    text-align: left;
}

/* ---- Create forms: consistent base styles for all create pages ---- */
.create-form-page {
    padding: 3rem 0;
    background: var(--bg-light);
}

.create-form-page .container {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 2rem;
    max-width: 1200px;
}

.create-form {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
}

.form-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.tips-card,
.form-sidebar .info-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    position: sticky;
    top: 2rem;
}

@media (max-width: 1024px) {
    .create-form-page .container {
        grid-template-columns: 1fr;
    }
    .form-sidebar {
        order: -1;
    }
    .tips-card, .form-sidebar .info-card {
        position: static;
    }
}

/* ---- Create Request / Bundle forms: dark mode ---- */
[data-theme="dark"] .create-form,
[data-theme="dark"] .tips-card,
[data-theme="dark"] .create-form-page .info-card {
    background: var(--bg-card) !important;
    border: 1px solid var(--border);
    color: var(--text-primary);
}

[data-theme="dark"] .create-form h3,
[data-theme="dark"] .tips-card h4,
[data-theme="dark"] .create-form-page .info-card h4 {
    color: var(--heading) !important;
}

[data-theme="dark"] .tips-card li,
[data-theme="dark"] .create-form-page .info-card li,
[data-theme="dark"] .create-form-page .info-card p {
    color: var(--text-secondary) !important;
}

/* ---- Bundle item cards: dark mode ---- */
[data-theme="dark"] .bundle-item {
    background: var(--bg-elevated) !important;
    border-color: var(--border) !important;
}

[data-theme="dark"] .bundle-item-card {
    background: var(--bg-elevated) !important;
    border-color: var(--border) !important;
    border-left-color: var(--primary) !important;
}

[data-theme="dark"] .bundle-item-body {
    background: transparent;
}

[data-theme="dark"] .bundle-total-calculated {
    background: rgba(99,102,241,0.15) !important;
    border-color: var(--primary) !important;
}

[data-theme="dark"] .bundle-total-calculated .total-value {
    color: var(--primary-light) !important;
}

[data-theme="dark"] .bundle-price-note {
    background: rgba(23,162,184,0.15) !important;
    border-color: #17a2b8 !important;
}

[data-theme="dark"] .bundle-price-note strong {
    color: #63d6e8 !important;
}

[data-theme="dark"] .item-subtotal .price-value {
    color: #4ade80 !important;
}

[data-theme="dark"] .item-subtotal {
    border-top-color: var(--border) !important;
}

/* ---- Market Offers/Requests: product cell spacing (condition badge & city) ---- */
.product-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-top: 0.35rem;
}

.product-city {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.badge-condition {
    display: inline-flex;
    align-items: center;
}

/* ---- Market Offers: filter buttons spacing (see .filter-actions above) ---- */

/* ---- Market News: dark mode ---- */
[data-theme="dark"] .empty-state-box {
    background: var(--bg-card) !important;
    border: 1px solid var(--border);
    color: var(--text-primary);
}

[data-theme="dark"] .empty-message {
    color: var(--heading) !important;
}

[data-theme="dark"] .empty-sub {
    color: var(--text-secondary) !important;
}

/* ---- My Reviews: dark mode ---- */
[data-theme="dark"] .reviews-empty-state {
    background: var(--bg-card) !important;
    border: 1px solid var(--border);
}

[data-theme="dark"] .reviews-empty-state h2 {
    color: var(--heading) !important;
}

[data-theme="dark"] .reviews-empty-state p {
    color: var(--text-secondary) !important;
}

/* ---- Offer/Request show pages: View Company Profile button white text in dark mode ---- */
[data-theme="dark"] .seller-actions .btn-primary,
[data-theme="dark"] .buyer-actions .btn-primary,
[data-theme="dark"] .seller-actions .btn-primary:hover {
    color: white !important;
}

/* ---- Offer/Bundle show: dark mode for price card and seller card ---- */
[data-theme="dark"] .price-card {
    background: var(--bg-card) !important;
    border-color: var(--border) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .price-card .price-label {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .price-card .price-amount {
    color: var(--heading) !important;
}

[data-theme="dark"] .price-card .price-negotiable {
    color: #10B981 !important;
    background: rgba(16, 185, 129, 0.2) !important;
}

[data-theme="dark"] .seller-card {
    background: var(--bg-card) !important;
    border-color: var(--border) !important;
}

[data-theme="dark"] .seller-card h3 {
    color: var(--heading) !important;
}

[data-theme="dark"] .seller-details h4 a,
[data-theme="dark"] .buyer-details h4 a {
    color: var(--primary-light) !important;
}

[data-theme="dark"] .verified-badge {
    color: #4ade80 !important;
}

[data-theme="dark"] .seller-location,
[data-theme="dark"] .buyer-location {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .offer-meta-actions {
    background: var(--bg-card) !important;
    border-color: var(--border) !important;
}

[data-theme="dark"] .meta-action {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .meta-action:hover {
    color: var(--primary-light) !important;
}

/* ---- Bundle offer show: bundle items section dark mode ---- */
[data-theme="dark"] .bundle-items-section {
    background: var(--bg-card) !important;
    border-color: var(--border) !important;
}

[data-theme="dark"] .bundle-items-section h2 {
    color: var(--heading) !important;
}

/* ---- Footer: social links (previous icon-only design) ---- */
.footer-social-links {
    display: flex;
    flex-direction: row;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.footer-social-links .social-link {
    width: 40px;
    height: 40px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(255, 255, 255, 0.07);
    border-radius: var(--radius-full);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
    transition: var(--transition);
}

.footer-social-links .social-link:hover {
    background-color: rgba(255, 255, 255, 0.15);
    color: white !important;
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.2);
}

/* Footer social links on light background (e.g. contact page) */
.social-links-card .footer-social-links .social-link {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    color: var(--text-primary);
}

.social-links-card .footer-social-links .social-link:hover {
    background: var(--primary);
    color: white !important;
    border-color: transparent;
}

/* ---- requests-table — tbody & table dark mode ---- */
[data-theme="dark"] .offers-table table,
[data-theme="dark"] .offers-table thead,
[data-theme="dark"] .offers-table thead tr th,
[data-theme="dark"] .offers-table tbody tr td {
    background: var(--bg-card) !important;
    color: var(--text-primary) !important;
    border-color: var(--border) !important;
}

[data-theme="dark"] .offers-table thead {
    background: var(--bg-elevated) !important;
}

[data-theme="dark"] .offers-table tbody tr:hover td {
    background: var(--bg-elevated) !important;
}

[data-theme="dark"] .bundle-items-list .bundle-item-mini {
    color: var(--text-secondary);
}

[data-theme="dark"] .text-muted {
    color: var(--text-muted) !important;
}

/* ---- Page header breadcrumb dark mode ---- */
[data-theme="dark"] .breadcrumb {
    color: var(--text-secondary);
}

[data-theme="dark"] .breadcrumb a {
    color: var(--primary-light);
}

/* ---- Similar offers dark mode ---- */
[data-theme="dark"] .similar-offers-section {
    color: var(--text-primary);
}

/* ---- Offer show: bundle items, quantity badge, savings badge ---- */
[data-theme="dark"] .item-quantity-badge {
    background: rgba(255,255,255,0.12) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .savings-badge {
    background: #22c55e !important;
    color: #FFFFFF !important;
}

[data-theme="dark"] .bundle-price-note {
    background: rgba(99, 102, 241, 0.15) !important;
    border-color: var(--primary) !important;
    color: var(--text-primary);
}

/* ---- No image placeholder (offer/device pages) ---- */
[data-theme="dark"] .no-image-placeholder,
[data-theme="dark"] .no-image-placeholder p {
    color: var(--text-muted) !important;
}

/* ---- Empty state messages ---- */
[data-theme="dark"] .empty-state,
[data-theme="dark"] .empty-state p {
    color: var(--text-secondary) !important;
}

/* ---- CTA card text (e.g. "Post a buying request") ---- */
[data-theme="dark"] .cta-card p,
[data-theme="dark"] .empty-cta p {
    color: var(--text-secondary) !important;
}

/* ---- Request header card dark mode ---- */
[data-theme="dark"] .request-header-card {
    background: var(--bg-card) !important;
    border-color: var(--border) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .request-header-card .request-type-badge svg {
    color: #FFFFFF;
}

[data-theme="dark"] .request-header-card .hint-icon {
    background: rgba(255,255,255,0.25) !important;
    color: #FFFFFF !important;
}

[data-theme="dark"] .request-header-card .hint-icon:hover,
[data-theme="dark"] .request-header-card .hint-icon:focus {
    background: rgba(255,255,255,0.4) !important;
}

[data-theme="dark"] .request-details-section,
[data-theme="dark"] .request-description-section {
    background: var(--bg-card) !important;
    border-color: var(--border) !important;
    color: var(--text-primary) !important;
}

/* request-type-badge: keep white text on gradient in both modes */
[data-theme="dark"] .request-type-badge {
    color: #FFFFFF !important;
    background: linear-gradient(135deg, var(--primary), var(--secondary)) !important;
}

[data-theme="dark"] .request-title {
    color: var(--heading) !important;
}

[data-theme="dark"] .meta-item {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .meta-item svg {
    color: var(--text-secondary);
}

/* ---- Offer/Request page titles and labels ---- */
[data-theme="dark"] .offer-page-title,
[data-theme="dark"] .offer-detail-wrapper h1 {
    color: var(--heading) !important;
}

[data-theme="dark"] .detail-label,
[data-theme="dark"] .price-label,
[data-theme="dark"] .total-value span:not(strong) {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .detail-value,
[data-theme="dark"] .price-amount,
[data-theme="dark"] .total-value strong {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .buyer-card {
    background: var(--bg-card) !important;
    border-color: var(--border) !important;
}

[data-theme="dark"] .buyer-card h3 {
    color: var(--heading) !important;
}

/* ---- Market offers/requests: company with logo ---- */
.company-with-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.company-logo-thumb {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}

.company-logo-placeholder-thumb {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    flex-shrink: 0;
}

/* ---- Social link brand colors on hover ---- */
.social-link--instagram:hover { color: #E1306C !important; }
.social-link--facebook:hover  { color: #1877F2 !important; }
.social-link--linkedin:hover  { color: #0A66C2 !important; }

/* ---- Verified / Unverified badge ---- */
.company-verified-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    vertical-align: middle;
    line-height: 1;
    flex-shrink: 0;
}

.company-verified-badge svg {
    display: block;
    flex-shrink: 0;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,.12));
}

.company-verified-badge .verified-badge-label {
    font-size: 0.82em;
    font-weight: 600;
}

.company-verified-badge.is-verified .verified-badge-label {
    color: #38B6E8;
}

.company-verified-badge.is-unverified .verified-badge-label {
    color: #9CA3AF;
}

[data-theme="dark"] .company-verified-badge.is-verified .verified-badge-label {
    color: #67d4f5 !important;
}

[data-theme="dark"] .company-verified-badge.is-unverified .verified-badge-label {
    color: var(--text-muted) !important;
}

[data-theme="dark"] .company-verified-badge svg {
    filter: drop-shadow(0 1px 3px rgba(0,0,0,.4));
}

/* ---- Country flag ---- */
.country-flag {
    width: 16px;
    height: 16px;
    object-fit: cover;
    border-radius: 2px;
    vertical-align: middle;
    flex-shrink: 0;
}

.country-with-flag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    vertical-align: middle;
}

/* ---- Hint / Tooltip System ---- */
.hint-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
    margin-left: 4px;
}

.hint-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--primary-color, #2563eb);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    border: none;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
    transition: background 0.15s ease, transform 0.1s ease;
    font-family: inherit;
    outline-offset: 2px;
}

.hint-icon:hover,
.hint-icon:focus {
    background: var(--primary-dark, #1d4ed8);
    transform: scale(1.15);
}

.hint-tip {
    display: none;
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    width: 220px;
    background: var(--gray-900, #111827);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 400;
    line-height: 1.5;
    padding: 8px 12px;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.25);
    pointer-events: none;
    white-space: normal;
    text-align: left;
}

.hint-tip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: var(--gray-900, #111827);
}

.hint-wrap.hint-open .hint-tip,
.hint-wrap:focus-within .hint-tip {
    display: block;
}

/* Flip tooltip below when near top of viewport */
.hint-tip.hint-below {
    bottom: auto;
    top: calc(100% + 8px);
}

.hint-tip.hint-below::after {
    top: auto;
    bottom: 100%;
    border-top-color: transparent;
    border-bottom-color: var(--gray-900, #111827);
}

/* Dark-mode adjustments */
[data-theme="dark"] .hint-tip {
    background: #e5e7eb;
    color: #111827;
}

[data-theme="dark"] .hint-tip::after {
    border-top-color: #e5e7eb;
}

[data-theme="dark"] .hint-tip.hint-below::after {
    border-bottom-color: #e5e7eb;
    border-top-color: transparent;
}
