@import url('https://fonts.cdnfonts.com/css/anurati');

/* ECA-CONNECT MASTER STYLESHEET
  Version: 2.0 - White / Dark Blue / Sky Blue Theme + Dark Mode
  Description: Clean light mode with navy & sky-blue accents; charcoal dark mode.
*/

/* ============================================================
   LIGHT MODE (DEFAULT)
   Palette: White backgrounds | Dark Navy text | Sky Blue actions
   ============================================================ */
:root {
    /* --- BACKGROUNDS - Light Glass Style --- */
    --base-black: #ffffff;
    --surface-50: #f5f5f7;
    --surface-100: rgba(255, 255, 255, 0.6);
    --surface-200: rgba(255, 255, 255, 0.8);
    --surface-300: rgba(0, 0, 0, 0.1);

    --base-white: #000000;
    --text-muted: #555555;
    --text-description: #333333;

    --primary-500: #000000;
    --primary-600: #333333;
    --primary-700: #555555;
    --primary-50: rgba(0, 0, 0, 0.1);
    --primary-200: rgba(0, 0, 0, 0.2);

    --secondary-500: #10b981;
    --match-perfect: #10b981;
    --match-near: #38bdf8;
    --match-low: #64748b;

    --success-bg: rgba(16, 185, 129, 0.1);
    --success-text: #059669;
    --success-50: rgba(16, 185, 129, 0.05);
    --success-200: rgba(16, 185, 129, 0.15);
    --success-700: #10b981;

    --warning-bg: rgba(245, 158, 11, 0.1);
    --warning-text: #d97706;

    --error-bg: rgba(239, 68, 68, 0.1);
    --error-text: #dc2626;
    --error-50: rgba(239, 68, 68, 0.05);
    --error-200: rgba(239, 68, 68, 0.15);
    --error-700: #ef4444;

    --info-bg: rgba(56, 189, 248, 0.1);
    --info-text: #0284c7;

    --font-headings: 'SF Pro Display', 'Inter', system-ui, -apple-system, sans-serif;
    --font-body: 'SF Pro Text', 'Inter', system-ui, -apple-system, sans-serif;

    --text-h1: 3.0rem;
    --text-h2: 2.25rem;
    --text-h3: 1.5rem;
    --text-h4: 1.25rem;
    --text-lg: 1.125rem;
    --text-base: 0.95rem;
    --text-sm: 0.875rem;
    --text-xs: 0.75rem;

    --leading-tight: 1.15;
    --leading-normal: 1.6;

    --space-4: 0.25rem;
    --space-8: 0.5rem;
    --space-12: 0.75rem;
    --space-16: 1.0rem;
    --space-24: 1.5rem;
    --space-32: 2.0rem;
    --space-48: 3.0rem;

    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-full: 999px;

    --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.15);
    --shadow-focus: 0 0 0 2px rgba(0, 0, 0, 0.4);

    --bg-gradient: radial-gradient(circle at 50% 0%, #ffffff 0%, #f0f0f5 100%);
    --card-bg: rgba(255, 255, 255, 0.55);
    --card-border: rgba(0, 0, 0, 0.05);
    --card-border-top: rgba(255, 255, 255, 0.8);
    --card-shadow: 0 24px 48px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(0,0,0,0.02);
    --input-bg: rgba(255, 255, 255, 0.4);
    --input-border: rgba(0, 0, 0, 0.1);
    --btn-primary-bg: #000000;
    --btn-primary-text: #ffffff;
    --btn-primary-hover: #333333;
    --btn-secondary-bg: rgba(0, 0, 0, 0.05);
    --btn-secondary-hover: rgba(0, 0, 0, 0.1);

    /* Theme Toggle Images */
    --bg-logo-url: url('bg_logo_black.png');
}

html.dark {
    --primary-50: rgba(255, 255, 255, 0.05); /* Deep dark input background */
    --primary-100: #2a2a2a;
    --primary-200: #404040;
    --primary-500: #ffffff;
    --primary-600: #e0e0e0;
    --primary-700: #a0a0a0;

    --surface-50: #0a0a0a;  /* the main background color */
    --surface-100: rgba(25, 25, 25, 0.6); /* Translucent panel */
    --surface-200: rgba(45, 45, 45, 0.5); /* Component background */
    --surface-300: rgba(70, 70, 70, 0.5); /* Borders and subtle fills */

    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.85);
    --text-muted: rgba(255, 255, 255, 0.6);
    --text-description: rgba(255, 255, 255, 0.45);

    --border-subtle: rgba(255, 255, 255, 0.1);

    --bg-gradient: linear-gradient(135deg, #050505 0%, #111111 100%);
    --card-bg: rgba(25, 25, 25, 0.5); /* Glass feel */
    --card-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.8);
    --input-bg: rgba(0, 0, 0, 0.5);
    --nav-blur: blur(24px);

    /* Theme Toggle Images */
    --bg-logo-url: url('bg_logo_white.png');

    /* --- BACKGROUNDS - ssscript.app Minimalist Dark Style --- */
    --base-black: #050505;
    --base-white: #ffffff;
    /* Primary text */
    --text-muted: #888888;
    /* Muted labels */
    --text-description: #a1a1aa;
    /* Body / description text */

    /* --- PRIMARY ACTION (Monochrome / White) --- */
    --primary-500: #ffffff;
    /* Main action */
    --primary-600: #e4e4e7;
    /* Hover */
    --primary-700: #a1a1aa;
    /* Active / pressed */
    --primary-50: rgba(255, 255, 255, 0.1);
    /* Focus halo */
    --primary-200: rgba(255, 255, 255, 0.2);

    /* --- SUCCESS & MATCHING --- */
    --secondary-500: #10b981;
    /* Success green */
    --match-perfect: #10b981;
    --match-near: #38bdf8;
    --match-low: #64748b;

    /* --- SEMANTIC STATES --- */
    --success-bg: rgba(16, 185, 129, 0.1);
    --success-text: #34d399;
    --success-50: rgba(16, 185, 129, 0.05);
    --success-200: rgba(16, 185, 129, 0.15);
    --success-700: #10b981;

    --warning-bg: rgba(245, 158, 11, 0.1);
    --warning-text: #fbbf24;

    --error-bg: rgba(239, 68, 68, 0.1);
    --error-text: #f87171;
    --error-50: rgba(239, 68, 68, 0.05);
    --error-200: rgba(239, 68, 68, 0.15);
    --error-700: #ef4444;

    --info-bg: rgba(56, 189, 248, 0.1);
    --info-text: #7dd3fc;

    /* --- TYPOGRAPHY --- */
    --font-headings: 'SF Pro Display', 'Inter', system-ui, -apple-system, sans-serif;
    --font-body: 'SF Pro Text', 'Inter', system-ui, -apple-system, sans-serif;

    --text-h1: 3.0rem;
    --text-h2: 2.25rem;
    --text-h3: 1.5rem;
    --text-h4: 1.25rem;
    --text-lg: 1.125rem;
    --text-base: 0.95rem;
    --text-sm: 0.875rem;
    --text-xs: 0.75rem;

    --leading-tight: 1.15;
    --leading-normal: 1.6;

    /* --- SPACING & LAYOUT --- */
    --space-4: 0.25rem;
    --space-8: 0.5rem;
    --space-12: 0.75rem;
    --space-16: 1.0rem;
    --space-24: 1.5rem;
    --space-32: 2.0rem;
    --space-48: 3.0rem;

    /* --- SHADOWS & RADIUS --- */
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-full: 999px;

    --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.5);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.7);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.9);
    --shadow-focus: 0 0 0 2px rgba(255, 255, 255, 0.4);

    --bg-gradient: radial-gradient(circle at 50% 0%, rgba(25, 25, 35, 1) 0%, #000 100%);
    --card-bg: rgba(25, 25, 25, 0.45);
    --card-border: rgba(255, 255, 255, 0.08);
    --card-border-top: rgba(255, 255, 255, 0.15);
    --card-shadow: 0 24px 48px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255,255,255,0.02);
    --input-bg: rgba(0, 0, 0, 0.3);
    --input-border: rgba(255, 255, 255, 0.1);
    --btn-primary-bg: rgba(255, 255, 255, 0.95);
    --btn-primary-text: #000000;
    --btn-primary-hover: #ffffff;
    --btn-secondary-bg: rgba(255, 255, 255, 0.1);
    --btn-secondary-hover: rgba(255, 255, 255, 0.15);
}

/* --- GLOBAL RESET --- */

* {
    box-sizing: border-box;
}

/* --- THEME OVERRIDES FOR GLOBAL STYLES --- */

body {
    background-color: var(--base-black);
    color: var(--base-white);
    font-family: var(--font-body);
    font-size: var(--text-base);
    line-height: var(--leading-normal);
    margin: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* --- DARK MODE TOGGLE BUTTON --- */
#dark-mode-toggle {
    background: var(--surface-100);
    border: 1.5px solid var(--surface-300);
    color: var(--base-white);
    border-radius: var(--radius-full);
    padding: 6px 14px;
    font-size: var(--text-sm);
    font-family: var(--font-body);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    white-space: nowrap;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.07),
        0 2px 4px rgba(0, 0, 0, 0.25),
        0 1px 2px rgba(0, 0, 0, 0.15);
}

#dark-mode-toggle:hover {
    background: var(--surface-200);
    border-color: var(--primary-500);
    color: var(--primary-500);
    transform: translateY(-1px);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        0 4px 8px rgba(0, 0, 0, 0.3),
        0 2px 4px rgba(0, 0, 0, 0.2);
}

h1,
h2,
h3,
h4 {
    color: var(--base-white);
    font-family: var(--font-headings);
    font-weight: 700;
    line-height: var(--leading-tight);
    margin: 0 0 var(--space-16) 0;
}

h1 {
    font-size: var(--text-h1);
}

h2 {
    font-size: var(--text-h2);
}

h3 {
    font-size: var(--text-h3);
}

h4 {
    font-size: var(--text-h4);
}

/* --- COMPONENT: BUTTONS - Depth & Shadow Design --- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-headings);
    font-weight: 600;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
    gap: var(--space-8);
    text-decoration: none;
    min-height: 48px;
    position: relative;
    user-select: none;
    /* Base depth: inner top-highlight + outer drop shadow */
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        0 2px 4px rgba(0, 0, 0, 0.3),
        0 1px 2px rgba(0, 0, 0, 0.2);
}

.btn-primary {
    background: var(--primary-500);
    border-color: var(--primary-600);
    color: var(--base-black);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.15),
        0 2px 8px rgba(61, 181, 229, 0.35),
        0 1px 3px rgba(0, 0, 0, 0.25);
}

.btn-primary:hover {
    background: var(--primary-600);
    border-color: var(--primary-500);
    transform: translateY(-2px);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        0 6px 16px rgba(61, 181, 229, 0.45),
        0 2px 6px rgba(0, 0, 0, 0.3);
}

.btn-primary:active {
    background: var(--primary-700);
    transform: translateY(0);
    box-shadow:
        inset 0 2px 4px rgba(0, 0, 0, 0.2),
        0 1px 3px rgba(61, 181, 229, 0.25);
}

.btn-secondary {
    background: var(--surface-100);
    border: 2px solid var(--surface-300);
    color: var(--base-white);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.07),
        0 2px 4px rgba(0, 0, 0, 0.3),
        0 1px 2px rgba(0, 0, 0, 0.2);
}

.btn-secondary:hover {
    background: var(--surface-200);
    border-color: var(--primary-500);
    transform: translateY(-2px);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        0 6px 12px rgba(0, 0, 0, 0.35),
        0 2px 4px rgba(0, 0, 0, 0.2);
}

.btn-secondary:active {
    background: var(--surface-50);
    transform: translateY(0);
    box-shadow:
        inset 0 2px 4px rgba(0, 0, 0, 0.15),
        0 1px 2px rgba(0, 0, 0, 0.2);
}

.btn-ghost {
    background: transparent;
    color: var(--text-description);
    border-color: transparent;
    box-shadow: none;
}

.btn-ghost:hover {
    background: var(--surface-100);
    color: var(--base-white);
    border-color: var(--surface-300);
    transform: translateY(-1px);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.07),
        0 3px 8px rgba(0, 0, 0, 0.25),
        0 1px 2px rgba(0, 0, 0, 0.15);
}

.btn-ghost:active {
    background: var(--surface-200);
    transform: translateY(0);
    box-shadow: none;
}

/* Google Button Variant */
.btn-google {
    background: var(--base-white);
    border: 2px solid var(--surface-300);
    color: var(--base-black);
    width: 100%;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.6),
        0 2px 4px rgba(0, 0, 0, 0.2),
        0 1px 2px rgba(0, 0, 0, 0.15);
}

.btn-google:hover {
    background: var(--surface-50);
    border-color: var(--primary-500);
    transform: translateY(-2px);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.6),
        0 6px 12px rgba(0, 0, 0, 0.2),
        0 2px 4px rgba(0, 0, 0, 0.15);
}

.btn-sm {
    padding: var(--space-4) var(--space-16);
    font-size: var(--text-sm);
    min-height: 32px;
}

.btn-lg {
    padding: var(--space-16) var(--space-32);
    font-size: var(--text-lg);
    min-height: 56px;
}

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    filter: grayscale(1);
    box-shadow: none;
    transform: none;
}

.btn:focus-visible {
    outline: 3px solid var(--primary-500);
    outline-offset: 3px;
    box-shadow: var(--shadow-focus);
}

/* --- COMPONENT: INPUTS & FORMS - Enhanced Visibility --- */

.form-group {
    margin-bottom: var(--space-16);
    display: flex;
    flex-direction: column;
    gap: var(--space-8);
}

.label {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-description);
    letter-spacing: 0.025em;
}

.input,
.textarea,
.select {
    width: 100%;
    padding: var(--space-12) var(--space-16);
    font-family: var(--font-body);
    font-size: var(--text-base);
    background: var(--surface-100);
    border: 2px solid var(--surface-300);
    border-radius: var(--radius-md);
    color: var(--base-white);
    transition: all 0.2s ease;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.06),
        0 2px 4px rgba(0, 0, 0, 0.25),
        0 1px 2px rgba(0, 0, 0, 0.15);
}

.input:hover,
.textarea:hover,
.select:hover {
    border-color: var(--primary-500);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        0 3px 8px rgba(0, 0, 0, 0.3),
        0 1px 3px rgba(0, 0, 0, 0.18);
}

.input:focus,
.textarea:focus,
.select:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: var(--shadow-focus);
    background: var(--surface-50);
}

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

.input:disabled,
.textarea:disabled,
.select:disabled {
    background: var(--surface-50);
    border-color: var(--surface-200);
    cursor: not-allowed;
    opacity: 0.6;
}

.input--error {
    border-color: var(--error-text);
    background: var(--error-bg);
}

.input--error:focus {
    box-shadow: 0 0 0 4px rgba(255, 133, 133, 0.2);
}

.helper-text {
    font-size: var(--text-xs);
    color: var(--text-muted);
    margin-top: var(--space-4);
}

.error-text {
    font-size: var(--text-xs);
    color: var(--error-text);
    font-weight: 600;
    margin-top: var(--space-4);
}

/* --- COMPONENT: SELECTION CONTROLS --- */

/* Toggle Switch Styling */
.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--surface-200);
    transition: .3s;
    border-radius: var(--radius-full);
    border: 2px solid var(--surface-300);
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 2px;
    bottom: 2px;
    background-color: var(--base-white);
    transition: .3s;
    border-radius: 50%;
    box-shadow: var(--shadow-sm);
}

input:checked+.slider {
    background-color: var(--secondary-500);
    border-color: var(--secondary-500);
}

input:checked+.slider:before {
    transform: translateX(20px);
}

input:focus-visible+.slider {
    box-shadow: var(--shadow-focus);
}

/* --- COMPONENT: DATA DISPLAY & BADGES --- */

.avatar {
    border-radius: var(--radius-full);
    object-fit: cover;
    background: var(--surface-100);
    border: 2px solid var(--surface-200);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: var(--primary-500);
    overflow: hidden;
}

.avatar-xs {
    width: 24px;
    height: 24px;
    font-size: 10px;
}

.avatar-s {
    width: 32px;
    height: 32px;
    font-size: 12px;
}

.avatar-m {
    width: 48px;
    height: 48px;
    font-size: 16px;
}

.avatar-l {
    width: 80px;
    height: 80px;
    font-size: 24px;
}

.badge {
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 700;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    background: var(--surface-200);
    color: var(--base-white);
}

.tag {
    background: var(--surface-200);
    color: var(--text-description);
    padding: 6px 12px;
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    display: inline-flex;
    align-items: center;
    gap: var(--space-8);
    font-weight: 500;
    border: 1px solid var(--surface-300);
}

.tag-remove {
    cursor: pointer;
    color: var(--text-muted);
    transition: color 0.2s;
}

.tag-remove:hover {
    color: var(--error-text);
}

/* --- COMPONENT: SEARCH BAR - Enhanced Contrast --- */
.search-container {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.search-input {
    padding-left: 40px;
    padding-right: 100px;
}

.search-icon {
    position: absolute;
    left: 12px;
    color: var(--text-muted);
    pointer-events: none;
}

.search-filter-pill {
    position: absolute;
    right: 8px;
    background: var(--surface-200);
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 600;
    cursor: pointer;
    color: var(--base-white);
    border: 1px solid var(--surface-300);
    transition: all 0.2s;
}

.search-filter-pill:hover {
    background: var(--surface-300);
    color: var(--primary-500);
    border-color: var(--primary-500);
}

/* --- COMPONENT: DATE & TIME PICKER --- */
.picker-group {
    display: flex;
    gap: var(--space-8);
}

.datetime-input {
    background: var(--surface-100);
    border: 2px solid var(--surface-200);
    padding: var(--space-12);
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    color: var(--base-white);
    transition: all 0.2s;
}

.datetime-input:focus {
    border-color: var(--primary-500);
    box-shadow: var(--shadow-focus);
}

/* --- COMPONENT: AVAILABILITY SELECTOR --- */
.availability-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-8);
}

.avail-chip {
    padding: 8px 16px;
    border: 2px solid var(--surface-300);
    border-radius: var(--radius-full);
    background: var(--surface-100);
    color: var(--text-description);
    font-size: var(--text-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
    user-select: none;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.07),
        0 2px 4px rgba(0, 0, 0, 0.3),
        0 1px 2px rgba(0, 0, 0, 0.2);
}

.avail-chip:hover {
    border-color: var(--primary-400, #38bdf8);
    background: var(--surface-200);
    transform: translateY(-2px);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        0 6px 12px rgba(0, 0, 0, 0.35),
        0 2px 4px rgba(0, 0, 0, 0.2);
}

.avail-chip.active {
    background: var(--primary-500);
    border-color: var(--primary-400, #38bdf8);
    color: var(--base-black);
    font-weight: 600;
    transform: translateY(-1px);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        0 4px 14px rgba(56, 189, 248, 0.45),
        0 2px 6px rgba(0, 0, 0, 0.35);
}

.avail-chip:focus-visible {
    outline: 2px solid var(--primary-500);
    outline-offset: 2px;
}

/* --- COMPONENT: RADIUS SLIDER --- */
.radius-slider-container {
    padding: var(--space-8) 0;
}

.radius-ticks {
    display: flex;
    justify-content: space-between;
    margin-top: var(--space-8);
    font-size: var(--text-xs);
    color: var(--text-muted);
}

.range-slider {
    width: 100%;
    height: 6px;
    accent-color: var(--primary-500);
    background: var(--surface-200);
    border-radius: var(--radius-full);
}

.range-slider:focus {
    outline: 2px solid var(--primary-500);
    outline-offset: 4px;
}

/* --- COMPONENT: CARDS & HEADERS - Clear Elevation --- */
.card {
    background: var(--surface-100);
    border: 1px solid var(--surface-200);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: all 0.2s;
}

.card:hover {
    border-color: var(--surface-300);
    box-shadow: var(--shadow-lg);
}

.card-header {
    padding: var(--space-16);
    display: flex;
    gap: var(--space-16);
    align-items: center;
    background: var(--surface-50);
    border-bottom: 1px solid var(--surface-200);
}

.card-header-img {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    background: var(--surface-200);
    object-fit: cover;
    border: 2px solid var(--surface-300);
}

.card-compact {
    display: flex;
    align-items: center;
    padding: var(--space-12);
    gap: var(--space-12);
}

.card-group {
    background-color: var(--surface-100);
    border: 1px solid var(--surface-200);
    box-shadow: var(--shadow-md);
}

/* --- COMPONENT: MAP PIN --- */
.map-pin {
    width: 32px;
    height: 32px;
    background: var(--primary-500);
    border: 3px solid var(--base-white);
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.map-pin::after {
    content: '';
    width: 8px;
    height: 8px;
    background: var(--base-white);
    border-radius: 50%;
}

.map-pin.secondary {
    background: var(--secondary-500);
}

.map-pin:hover {
    transform: rotate(-45deg) scale(1.15);
    box-shadow: 0 12px 20px -5px rgba(0, 0, 0, 0.6);
}

/* --- COMPONENT: COMPATIBILITY METER --- */
.compatibility-meter {
    height: 10px;
    background: var(--surface-200);
    border-radius: var(--radius-full);
    overflow: hidden;
    position: relative;
    width: 100%;
    border: 1px solid var(--surface-300);
}

.meter-fill {
    height: 100%;
    background: var(--match-near);
    width: 0%;
    transition: width 0.5s ease;
    box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.2);
}

.meter-perfect .meter-fill {
    background: var(--match-perfect);
}

/* --- COMPONENT: HEALTH BADGE --- */
.health-badge {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid var(--base-white);
    position: relative;
    box-shadow: var(--shadow-sm);
}

.health-active {
    background: var(--success-text);
}

.health-sporadic {
    background: var(--warning-text);
}

/* --- COMPONENT: TOAST / ALERT --- */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--surface-100);
    color: var(--base-white);
    padding: 16px 28px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: var(--space-12);
    z-index: 1000;
    animation: slideUp 0.3s ease;
    border: 1px solid var(--surface-300);
}

.toast-success {
    background: var(--surface-100);
    border-left: 4px solid var(--secondary-500);
}

.toast-error {
    background: var(--surface-100);
    border-left: 4px solid var(--error-text);
}

@keyframes slideUp {
    from {
        transform: translate(-50%, 20px);
        opacity: 0;
    }

    to {
        transform: translate(-50%, 0);
        opacity: 1;
    }
}


/* ═══════════════════════════════════════════════════════════════════════════
   MOBILE & ANDROID OPTIMIZATIONS
   Full responsive system — mobile-first, touch-optimized, PWA-ready
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Touch & Tap Target Improvements ─────────────────────────────────────── */
* {
    -webkit-tap-highlight-color: transparent;       /* Remove blue flash on Android tap */
    -webkit-touch-callout: none;                    /* No callout on long press */
}

/* Interactive elements must be at least 44×44px (Android / accessibility) */
button, .btn, a.btn,
input[type="checkbox"], input[type="radio"],
select, .avail-chip, .interest-tag, .tab-btn {
    min-height: 44px;
}

/* Smooth scrolling on iOS/Android */
html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;   /* Prevent font scaling in landscape */
}

body {
    overscroll-behavior-y: contain;   /* Prevent pull-to-refresh on Android Chrome */
}

/* ── Bottom Navigation Bar (mobile only) ─────────────────────────────────── */
#mobile-bottom-nav {
    display: none;
}

@media (max-width: 768px) {
    /* Show bottom nav */
    #mobile-bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 200;
        background: var(--surface-50);
        border-top: 1px solid var(--surface-200);
        padding: 0;
        height: 60px;
        box-shadow: 0 -4px 12px rgba(0,0,0,0.2);
    }

    #mobile-bottom-nav a {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        text-decoration: none;
        color: var(--text-muted);
        font-size: 10px;
        font-family: var(--font-body);
        font-weight: 500;
        padding: 8px 4px;
        transition: color 0.2s;
        border-top: 2px solid transparent;
    }

    #mobile-bottom-nav a.active,
    #mobile-bottom-nav a:active {
        color: var(--primary-500);
        border-top-color: var(--primary-500);
    }

    #mobile-bottom-nav a span.nav-icon {
        font-size: 20px;
        line-height: 1;
    }

    /* Push page content above bottom nav */
    body {
        padding-bottom: 60px;
    }
}

/* ── Mobile Typography ────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    :root {
        --text-h1: 2.0rem;
        --text-h2: 1.5rem;
        --text-h3: 1.2rem;
        --text-h4: 1.05rem;
        --space-48: 2.0rem;
        --space-32: 1.5rem;
    }
}

@media (max-width: 480px) {
    :root {
        --text-h1: 1.75rem;
        --text-h2: 1.35rem;
        --text-h3: 1.1rem;
        --space-48: 1.5rem;
        --space-32: 1.25rem;
    }
}

/* ── Navigation — Mobile ─────────────────────────────────────────────────── */
@media (max-width: 768px) {
    nav .user-menu {
        gap: var(--space-8) !important;
    }

    /* Hide desktop nav links on mobile (replaced by bottom nav) */
    nav > div > div:not(.user-menu) {
        display: none !important;
    }

    /* Shrink dark mode toggle text on mobile */
    #dark-mode-toggle {
        padding: 6px 10px;
        font-size: 12px;
    }
}

/* ── Dashboard Layout — Mobile ───────────────────────────────────────────── */
@media (max-width: 1024px) {
    /* Stack sidebar below results on tablet */
    main > div[style*="grid-template-columns: 320px"] {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 768px) {
    /* Full-bleed main padding */
    main {
        padding: var(--space-16) !important;
    }

    /* Dashboard filter sidebar: collapsible on mobile */
    #filter-sidebar {
        position: static !important;
        height: auto !important;
        max-height: none !important;
        overflow: visible !important;
    }

    /* Group cards: single column */
    #in-radius-groups,
    #out-radius-groups,
    .groups-grid {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }

    /* Sort select: full width on mobile */
    #sort-select {
        width: 100% !important;
    }
}

/* ── Cards — Mobile ──────────────────────────────────────────────────────── */
@media (max-width: 480px) {
    .card {
        border-radius: var(--radius-md) !important;
    }

    /* Group detail hero */
    #gd-hero-color,
    [id="gd-hero-color"] {
        height: 180px !important;
    }
}

/* ── Forms — Mobile ──────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .input,
    .textarea,
    .select,
    select {
        font-size: 16px !important; /* Prevents iOS/Android zoom on focus */
    }

    /* Full-width buttons on small screens */
    .btn-lg {
        width: 100%;
        min-height: 52px;
    }

    /* Auth pages: remove extra padding */
    body[style*="height: 100vh"] > div {
        margin: var(--space-16);
        padding: var(--space-24) !important;
    }
}

/* ── Hero Buttons ─────────────────────────────────────────────────────────── */
@media (max-width: 480px) {
    header div[style*="display: flex; gap"] {
        flex-direction: column !important;
        gap: var(--space-12) !important;
    }
}

/* ── Group Manager — Mobile ──────────────────────────────────────────────── */
@media (max-width: 768px) {
    /* Stack group list and panel vertically */
    main > div[style*="grid-template-columns: 300px"] {
        grid-template-columns: 1fr !important;
    }

    #groups-list {
        position: static !important;
        flex-direction: row !important;
        overflow-x: auto !important;
        gap: 8px !important;
        padding-bottom: 8px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    #groups-list::-webkit-scrollbar { display: none; }

    #groups-list button {
        flex-shrink: 0 !important;
        width: 200px !important;
    }
}

/* ── Notification Dropdown — Mobile ─────────────────────────────────────── */
@media (max-width: 480px) {
    #notif-dropdown {
        width: calc(100vw - 32px) !important;
        right: -16px !important;
    }
}

/* ── Swipe-friendly Modals ───────────────────────────────────────────────── */
@media (max-width: 768px) {
    /* Time selection modal: bottom sheet on mobile */
    #time-modal > div {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0 !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding-bottom: calc(var(--space-24) + env(safe-area-inset-bottom)) !important;
        animation: slideUpSheet 0.3s ease;
    }

    @keyframes slideUpSheet {
        from { transform: translateY(100%); }
        to   { transform: translateY(0); }
    }
}

/* ── Safe Area Insets (iPhone X / Android notch) ─────────────────────────── */
@supports (padding: max(0px)) {
    nav {
        padding-left:  max(var(--space-16), env(safe-area-inset-left));
        padding-right: max(var(--space-16), env(safe-area-inset-right));
    }

    #mobile-bottom-nav {
        padding-bottom: env(safe-area-inset-bottom);
        height: calc(60px + env(safe-area-inset-bottom));
    }

    body {
        padding-bottom: calc(60px + env(safe-area-inset-bottom));
    }
}

/* ── PWA Install Banner ──────────────────────────────────────────────────── */
#pwa-install-banner {
    display: none;
    position: fixed;
    bottom: 68px;  /* above bottom nav */
    left: 16px;
    right: 16px;
    z-index: 300;
    background: var(--surface-100);
    border: 1px solid var(--primary-500);
    border-radius: var(--radius-lg);
    padding: 14px 16px;
    box-shadow: var(--shadow-lg);
    flex-direction: row;
    align-items: center;
    gap: 12px;
    animation: slideUp 0.4s ease;
}

#pwa-install-banner.visible {
    display: flex;
}

#pwa-install-banner img {
    width: 40px;
    height: 40px;
    border-radius: 10px;
}

#pwa-install-banner .banner-text {
    flex: 1;
    min-width: 0;
}

#pwa-install-banner .banner-text strong {
    display: block;
    font-size: 13px;
    color: var(--base-white);
    margin-bottom: 2px;
}

#pwa-install-banner .banner-text span {
    font-size: 11px;
    color: var(--text-muted);
}

#pwa-install-banner .banner-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

/* ── Scrollbar — Mobile Clean ────────────────────────────────────────────── */
@media (max-width: 768px) {
    ::-webkit-scrollbar {
        width: 0;
        height: 0;
    }
}

/* ── Input: number type — fix Android spinner ─────────────────────────────── */
input[type="number"] {
    -moz-appearance: textfield;
}
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
}

/* ── Profile Setup — Mobile scroll fix ───────────────────────────────────── */
@media (max-width: 768px) {
    /* Ensure tall profile setup form is scrollable */
    .profile-setup-container {
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* ── Availability Chips — mobile horizontal scroll ───────────────────────── */
@media (max-width: 480px) {
    .availability-chip-list {
        flex-wrap: nowrap !important;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 4px;
        scrollbar-width: none;
    }
    .availability-chip-list::-webkit-scrollbar { display: none; }
}

/* ── FAB (Floating Action Button) — mobile pos ───────────────────────────── */
@media (max-width: 768px) {
    /* Ensure FAB is above bottom nav */
    a[style*="position: fixed; bottom: 32px; right: 32px"] {
        bottom: 76px !important;
    }
}


/* --- ACCESSIBILITY ENHANCEMENTS --- */

/* Skip to main content link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary-500);
    color: var(--base-black);
    padding: 8px 16px;
    text-decoration: none;
    border-radius: var(--radius-md);
    font-weight: 600;
}

.skip-link:focus {
    top: 8px;
    left: 8px;
    z-index: 10000;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --base-white: #000000;
        --surface-200: #B0C4DE;
        --primary-500: #0050A0;
    }

    html.dark {
        --base-white: #FFFFFF;
        --primary-500: #80CFFF;
    }

    .btn,
    .input,
    .card {
        border-width: 3px;
    }
}
/* ============================================================
   SSSCRIPT.APP VISIONOS AESTHETIC OVERRIDES
   Injecting deep modern glassmorphism into all components
   ============================================================ */

/* Force dark mode background globally */
html, body {
    background-color: var(--surface-50);
    color: var(--base-white);
    background-image: var(--bg-gradient);
    background-attachment: fixed;
}

/* Glassmorphism Cards and Containers */
.dashboard-card, 
.card, 
.panel, 
.modal-content, 
.sidebar, 
.profile-sidebar,
.profile-content,
.navbar,
.bottom-nav, 
.group-card, 
.login-card,
#mobile-bottom-nav {
    background: var(--card-bg) !important;
    backdrop-filter: blur(24px) saturate(150%) !important;
    -webkit-backdrop-filter: blur(24px) saturate(150%) !important;
    border: 1px solid var(--card-border) !important;
    border-top: 1px solid var(--card-border-top) !important;
    box-shadow: var(--card-shadow) !important;
    border-radius: var(--radius-lg);
}

/* Fix header container spacing bug */
.dashboard-header {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    margin-bottom: var(--space-24);
}

/* Modernize Inputs */
.input, .textarea, .select {
    background: var(--input-bg) !important;
    border: 1px solid var(--input-border) !important;
    color: var(--base-white) !important;
    backdrop-filter: blur(12px) !important;
    border-radius: var(--radius-md) !important;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
}

.input:focus, .textarea:focus, .select:focus {
    background: rgba(255, 255, 255, 0.05) !important;
    border-color: rgba(255, 255, 255, 0.3) !important;
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.05) !important;
}

/* Buttons like macOS / VisionOS */
.btn-primary {
    background: var(--btn-primary-bg) !important;
    color: var(--btn-primary-text) !important;
    border: none !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), inset 0 -1px 1px rgba(255, 255, 255, 0.2) !important;
    font-weight: 600 !important;
    border-radius: var(--radius-md) !important;
}

.btn-primary:hover {
    background: var(--btn-primary-hover) !important;
    transform: scale(1.02) !important;
}

.btn-secondary {
    background: var(--btn-secondary-bg) !important;
    color: var(--base-white) !important;
    border: 1px solid var(--input-border) !important;
    backdrop-filter: blur(12px) !important;
}

.btn-secondary:hover {
    background: var(--btn-secondary-hover) !important;
}

/* Make headers adaptive */
h1, h2, h3, h4, .brand, .logo-text, .login-logo {
    color: var(--base-white) !important;
}

.text-muted, p, label {
    color: var(--text-description) !important;
}

/* Traffic light window controls for sidebars and cards if needed */
.window-controls {
    display: flex;
    gap: 8px;
    padding: 12px;
}
.window-controls span {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}
.window-controls .close { background: #ff5f56; }
.window-controls .minimize { background: #ffbd2e; }
.window-controls .maximize { background: #27c93f; }

body.page-bg-logo {
    background-image: var(--bg-logo-url);
    background-repeat: no-repeat;
    background-position: center center;
    background-size: min(80vw, 800px); /* Responsive sizing */
    background-attachment: fixed;
    background-color: var(--surface-50);
}

body.page-bg-logo::after {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -1;
    background: var(--bg-gradient);
    opacity: 0.95; /* Fades the logo heavily so it acts as a subtle watermark */
}
