:root {
    --bg-dark: #0f172a;
    --primary: #3b82f6;
    --secondary: #8b5cf6;
    --accent: #06b6d4;
    --text-light: #f8fafc;
    --text-dim: #94a3b8;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shine: rgba(255, 255, 255, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-light);
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Background Animation */
.background-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.6;
    animation: float 10s infinite ease-in-out;
}

.orb-1 {
    width: 400px;
    height: 400px;
    background: var(--primary);
    top: -100px;
    left: -100px;
    animation-delay: 0s;
}

.orb-2 {
    width: 300px;
    height: 300px;
    background: var(--secondary);
    bottom: -50px;
    right: -50px;
    animation-delay: 2s;
}

.orb-3 {
    width: 200px;
    height: 200px;
    background: var(--accent);
    top: 40%;
    left: 40%;
    animation-delay: 4s;
}

@keyframes float {
    0% {
        transform: translate(0, 0);
    }

    50% {
        transform: translate(30px, 50px);
    }

    100% {
        transform: translate(0, 0);
    }
}

/* Navbar */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem 5%;
    backdrop-filter: blur(10px);
    position: relative;
    z-index: 100;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 1px;
}

.logo span {
    color: var(--accent);
}

.nav-links {
    display: flex;
    gap: 1rem;
}

.nav-btn {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-light);
    padding: 0.5rem 1.5rem;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.nav-btn:hover,
.nav-btn.active {
    background: var(--glass-shine);
    border-color: var(--accent);
    box-shadow: 0 0 15px rgba(6, 182, 212, 0.3);
}

/* Main Layout */
.main-container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0 5%;
}

.content-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 1200px;
    gap: 4rem;
    flex-wrap: wrap;
}

/* Text Section */
.text-section {
    flex: 1;
    min-width: 300px;
}

.hero-title {
    font-size: 4rem;
    line-height: 1.1;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.gradient-text {
    background: linear-gradient(135deg, var(--accent), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: 1.2rem;
    color: var(--text-dim);
    margin-bottom: 2.5rem;
    max-width: 500px;
}

.cta-primary {
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    border-radius: 30px;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    font-weight: 600;
}

.cta-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(59, 130, 246, 0.4);
}

/* Auth Section */
.auth-section {
    flex: 1;
    display: flex;
    justify-content: flex-end;
    min-width: 350px;
}

.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    padding: 2rem;
    box-sizing: border-box;
    border-radius: 24px;
    width: 100%;
    max-width: 450px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: hidden;
    transition: height 0.4s ease;
}

/* Mika Tabs Global Styles */
.mika-tabs-container {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 2px;
}

.mika-tab-btn {
    padding: 1rem 2rem;
    background: transparent;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    border-bottom: 3px solid transparent;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    white-space: nowrap;
}

.mika-tab-btn i {
    font-size: 1.2rem;
    opacity: 0.8;
}

.mika-tab-btn:hover {
    color: var(--text-light);
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px 12px 0 0;
}

.mika-tab-btn.active {
    color: var(--text-light);
    border-bottom-color: #10b981;
}

.mika-tab-btn.active i {
    color: #10b981;
    opacity: 1;
}

.glass-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
}

.auth-form {
    display: none;
    flex-direction: column;
    gap: 1.5rem;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.4s ease;
}

.auth-form.active {
    display: flex;
    opacity: 1;
    transform: translateY(0);
}

.auth-form h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.form-subtitle {
    color: var(--text-dim);
    margin-top: -1rem;
    margin-bottom: 1rem;
}

.input-group {
    position: relative;
}

.input-group i {
    position: absolute;
    left: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-dim);
    transition: color 0.3s ease;
}

.input-group .toggle-password {
    left: auto;
    right: 1.5rem;
    cursor: pointer;
}

.input-group .toggle-password:hover {
    color: var(--accent);
}

.input-group input,
.input-group select {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    padding: 1rem 1rem 1rem 3.5rem;
    border-radius: 12px;
    color: var(--text-light);
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
}

.input-group input:focus,
.input-group select:focus {
    border-color: var(--accent);
    background: rgba(0, 0, 0, 0.4);
}

.input-group input:focus+i,
.input-group select:focus+i {
    color: var(--accent);
}

.submit-btn {
    background: var(--text-light);
    color: var(--bg-dark);
    padding: 1rem;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}

.submit-btn:hover {
    background: var(--accent);
    color: white;
    transform: translateY(-2px);
}

.switch-auth {
    text-align: center;
    color: var(--text-dim);
    margin-top: 1rem;
    font-size: 0.9rem;
}

.switch-auth span {
    color: var(--primary);
    cursor: pointer;
    font-weight: 600;
    transition: color 0.3s ease;
}

.switch-auth span:hover {
    color: var(--accent);
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 900px) {
    .content-wrapper {
        flex-direction: column;
        gap: 2rem;
        text-align: center;
    }

    .text-section {
        margin-top: 2rem;
    }

    .hero-title {
        font-size: 3rem;
    }

    .hero-subtitle {
        margin: 0 auto 2.5rem auto;
    }

    .auth-section {
        width: 100%;
        justify-content: center;
    }
}

/* Calendar Redesign - Light Minimal & Responsive */
.calendar-container.minimal-theme {
    background: linear-gradient(135deg, #fdfbf7 0%, #fff 100%);
    border-radius: 24px;
    padding: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
    color: #1e1e1e;
    width: 100%;
    box-sizing: border-box;
    margin: 0 auto;
}

.calendar-top-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid rgba(0, 0, 0, 0.03);
}

#calendar-month-title {
    font-size: 3rem;
    font-weight: 800;
    text-transform: uppercase;
    color: #1e1e1e;
    letter-spacing: -2px;
    line-height: 1;
    margin: 0;
    background: linear-gradient(45deg, #1e1e1e, #4b5563);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.calendar-year-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #fff;
    padding: 0.25rem;
    border-radius: 50px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

#calendar-year-pill {
    padding: 0.5rem 1.25rem;
    background: #1e1e1e;
    color: #fff;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 700;
}

.nav-arrow {
    background: none;
    border: none;
    color: #1e1e1e;
    font-size: 1rem;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-arrow:hover {
    background: rgba(0, 0, 0, 0.05);
    transform: scale(1.1);
}

.calendar-days-header {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    margin-bottom: 1rem;
    text-align: center;
    width: 100%;
}

.day-pill {
    background: #1e1e1e;
    color: #fff;
    padding: 0.5rem 0.25rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    width: 95%;
    margin: 0 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    justify-content: center;
    align-items: center;
}

.day-pill .d-short {
    display: none;
    font-size: 0.65rem;
}

.day-pill .d-long {
    display: block;
}

.calendar-grid.minimal-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    background: transparent;
    gap: 8px;
    width: 100%;
    /* Spaced cells instead of bordered grid */
    border: none;
    box-sizing: border-box;
}

.calendar-grid.minimal-grid .calendar-day {
    background: #fff;
    min-height: 120px;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    border-radius: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(0, 0, 0, 0.03);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
    overflow: hidden;
    min-width: 0;
    /* Important for grid shrinkage */
}

.calendar-grid.minimal-grid .calendar-day:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
    border-color: rgba(0, 0, 0, 0.08);
    z-index: 5;
}

.calendar-grid.minimal-grid .calendar-day.empty {
    background: rgba(255, 255, 255, 0.4);
    border: none;
    box-shadow: none;
}

.calendar-grid.minimal-grid .calendar-day.today {
    background: #fff;
    border: 2px solid #3b82f6;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.calendar-day-number {
    text-align: right;
    font-size: 1rem;
    color: #1f2937;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.calendar-grid.minimal-grid .mission-pill {
    margin-top: 0;
    border: none;
    box-shadow: none;
    font-size: 0.7rem;
    text-align: left;
    padding: 4px 8px;
    border-radius: 6px;
    font-weight: 600;
}

/* Offre d'emploi : forme triangle (encoche à gauche) */
.calendar-grid.minimal-grid .mission-pill.mission-pill-triangle {
    clip-path: polygon(0 50%, 10px 0, 100% 0, 100% 100%, 10px 100%);
    padding-left: 12px;
}

/* Check-in : forme étoile (5 branches) */
.calendar-grid.minimal-grid .mission-pill.mission-pill-star {
    clip-path: polygon(50% 0%, 61% 38%, 100% 38%, 69% 61%, 82% 100%, 50% 77%, 18% 100%, 31% 61%, 0% 38%, 39% 38%);
    padding: 4px 10px;
}

/* Base styles for footer legend */
.calendar-legend {
    margin-top: 2rem;
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
    font-size: 0.85rem;
    color: #4b5563;
    font-weight: 500;
}

/* Responsive Optimizations */
@media (max-width: 768px) {
    .calendar-container.minimal-theme {
        padding: 1rem;
        border-radius: 16px;
    }

    .calendar-top-section {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        margin-bottom: 1.5rem;
    }

    #calendar-month-title {
        font-size: 2.5rem;
    }

    .calendar-year-controls {
        width: 100%;
        justify-content: space-between;
        background: transparent;
        border: none;
        box-shadow: none;
        padding: 0;
    }

    #calendar-year-pill {
        flex: 1;
        text-align: center;
        background: #1e1e1e;
        padding: 0.5rem;
    }

    .nav-arrow {
        background: #fff;
        width: 36px;
        height: 36px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }

    .day-pill {
        border-radius: 8px;
        font-size: 0.7rem;
        padding: 0.3rem 0;
        width: 95%;
    }

    .day-pill .d-long {
        display: none;
    }

    .day-pill .d-short {
        display: block;
    }

    .calendar-grid.minimal-grid {
        gap: 4px;
    }

    .calendar-grid.minimal-grid .calendar-day {
        min-height: 80px;
        padding: 0.4rem;
        border-radius: 10px;
        gap: 0.25rem;
    }

    .calendar-day-number {
        font-size: 0.8rem;
    }

    .calendar-grid.minimal-grid .mission-pill {
        padding: 2px 4px;
        font-size: 0.6rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* On very small screens, maybe show just a dot for mission? 
       For now, let's keep text but make it tiny */
}

/* --- Global Mobile Optimizations for All Dashboards --- */
@media (max-width: 768px) {

    /* Layout & Containers */
    .main-container {
        padding: 0 1rem;
        min-height: calc(100vh - 80px);
    }

    .glass-card {
        padding: 1.5rem !important;
        border-radius: 16px;
        max-width: 100% !important;
    }

    .content-wrapper {
        gap: 1.5rem;
        flex-direction: column;
    }

    /* Typography - Mobile Optimized */
    h1,
    .hero-title {
        font-size: 2rem !important;
        line-height: 1.2;
        margin-bottom: 1rem !important;
    }

    h2 {
        font-size: 1.5rem !important;
        margin-bottom: 1rem !important;
    }

    h3 {
        font-size: 1.25rem !important;
        margin-bottom: 0.75rem !important;
    }

    p {
        font-size: 0.95rem;
        line-height: 1.6;
    }

    /* Navbar - Mobile Friendly */
    .navbar {
        padding: 1rem;
        flex-direction: column;
        gap: 1rem;
        background: rgba(15, 23, 42, 0.98);
        backdrop-filter: blur(10px);
        position: sticky;
        top: 0;
        z-index: 1000;
    }

    .logo {
        font-size: 1.25rem;
        text-align: center;
    }

    .nav-links {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .nav-btn {
        flex: 1;
        min-width: 120px;
        text-align: center;
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }

    /* Sync Status - Compact */
    .sync-status {
        font-size: 0.85rem !important;
        padding: 0.5rem 0.75rem !important;
    }

    /* Tabs (Mika & others) - Touch Optimized */
    .mika-tabs-container,
    .tabs-container {
        display: flex !important;
        overflow-x: auto;
        padding: 0 1rem 0.5rem 1rem;
        margin: 0 -1.5rem 2rem -1.5rem;
        gap: 0.5rem;
        border-bottom: 2px solid rgba(255, 255, 255, 0.1);
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        scroll-snap-type: x proximity;
    }

    .mika-tabs-container::-webkit-scrollbar,
    .tabs-container::-webkit-scrollbar {
        display: none;
    }

    .mika-tab-btn,
    .tab-btn {
        padding: 0.75rem 1.25rem !important;
        font-size: 0.95rem !important;
        gap: 0.5rem;
        min-width: fit-content;
        scroll-snap-align: start;
        flex-shrink: 0;
    }

    .mika-tab-btn i,
    .tab-btn i {
        font-size: 1rem;
    }

    /* Forms - Touch Friendly (44px minimum touch target) */
    form {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
        display: grid !important;
    }

    /* Targets any grid with columns inside a form or general layout */
    form>div[style*="grid-template-columns"],
    div[style*="display: grid"][style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }

    /* Input Fields - Prevent Zoom & Touch Optimized */
    .input-group input,
    .input-group select,
    textarea,
    input[type="date"],
    input[type="time"],
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="password"],
    select {
        font-size: 16px !important;
        padding: 0.875rem 1rem !important;
        width: 100%;
        min-height: 44px;
        border-radius: 10px !important;
    }

    .input-group {
        margin-bottom: 0.5rem;
    }

    .input-group input {
        padding-left: 3rem !important;
    }

    /* Buttons - Touch Optimized */
    button,
    .btn,
    .submit-btn,
    .cta-primary {
        min-height: 44px !important;
        padding: 0.875rem 1.5rem !important;
        font-size: 1rem !important;
        border-radius: 12px !important;
        cursor: pointer;
        touch-action: manipulation;
    }

    button[type="submit"],
    .submit-btn {
        width: 100% !important;
        justify-content: center;
        margin-top: 0.5rem;
    }

    /* Stat Cards - Mobile Grid */
    div[style*="grid-template-columns: repeat(auto-fit"] {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }

    .stat-card {
        padding: 1.25rem !important;
        text-align: center;
    }

    /* Missions List Items - Card Style */
    ul li {
        padding: 1rem !important;
        margin-bottom: 0.75rem !important;
        border-radius: 12px !important;
        background: rgba(255, 255, 255, 0.05) !important;
        border: 1px solid rgba(255, 255, 255, 0.1) !important;
    }

    /* Modals - Full Screen on Mobile */
    #photo-upload-modal>div,
    #photo-validation-modal>div,
    #report-modal>div,
    .modal>div {
        margin: 0 !important;
        height: 100vh;
        max-height: 100vh;
        width: 100vw !important;
        max-width: 100vw !important;
        border-radius: 0 !important;
        border: none !important;
        padding: 1rem !important;
        overflow-y: auto;
    }

    .modal-header {
        position: sticky;
        top: 0;
        background: var(--bg-dark);
        z-index: 10;
        padding-bottom: 1rem;
        margin-bottom: 1rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    #photo-upload-content {
        padding-bottom: 100px;
    }

    /* Close buttons - Larger touch target */
    .close-modal,
    button[onclick*="close"] {
        min-width: 44px !important;
        min-height: 44px !important;
        padding: 0.75rem !important;
    }

    /* Tables - Responsive */
    table {
        font-size: 0.85rem;
        min-width: 600px;
    }

    table th,
    table td {
        padding: 0.75rem 0.5rem !important;
        white-space: nowrap;
    }

    /* Table wrapper for horizontal scroll */
    .table-wrapper,
    div[style*="overflow-x: auto"] {
        margin-left: -1.5rem;
        margin-right: -1.5rem;
        padding-left: 1.5rem;
        padding-right: 1.5rem;
        width: calc(100% + 3rem);
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Photo Upload - Mobile Optimized */
    .photo-preview {
        max-width: 100% !important;
        height: auto !important;
    }

    .photo-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }

    /* Action Buttons Group */
    .action-buttons,
    div[style*="display: flex"][style*="gap"] {
        flex-direction: column !important;
        gap: 0.75rem !important;
    }

    .action-buttons button {
        width: 100% !important;
    }

    /* Auth Section - Mobile */
    .auth-section {
        width: 100% !important;
        min-width: 100% !important;
    }

    .text-section {
        text-align: center;
        padding: 1rem 0;
    }

    /* Tech Section Cards */
    .tech-section {
        padding: 2rem 1rem !important;
    }

    .start-card {
        margin-bottom: 1rem;
    }

    /* Carousel Arrows - Touch Friendly */
    .carousel-arrow {
        width: 40px !important;
        height: 40px !important;
        font-size: 1.1rem !important;
    }

    /* Mission Pills in Lists */
    .mission-item {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 0.5rem !important;
    }

    /* Status Badges */
    .status-badge,
    .badge {
        font-size: 0.8rem !important;
        padding: 0.4rem 0.8rem !important;
    }

    /* Search and Filter Inputs */
    input[type="search"],
    .search-input {
        width: 100% !important;
        margin-bottom: 1rem !important;
    }

    /* Flatpickr Calendar - Mobile */
    .flatpickr-calendar {
        width: 100% !important;
        max-width: 100vw !important;
    }

    /* Loading States */
    .loading-spinner {
        font-size: 2rem !important;
    }

    /* Tooltips - Disabled on Mobile */
    [title]:hover::after {
        display: none !important;
    }

    /* Prevent Text Selection on Buttons */
    button,
    .btn {
        -webkit-user-select: none;
        user-select: none;
        -webkit-tap-highlight-color: transparent;
    }

    /* Improve Touch Scrolling */
    * {
        -webkit-overflow-scrolling: touch;
    }

    /* Fix iOS Input Zoom */
    @supports (-webkit-touch-callout: none) {

        input,
        select,
        textarea {
            font-size: 16px !important;
        }
    }

    /* Report Modal - Mobile Optimized */
    #report-modal>div {
        margin: 0 !important;
        max-width: 100% !important;
        border-radius: 0 !important;
        padding: 1rem !important;
        min-height: 100vh;
    }

    #report-content {
        gap: 1rem !important;
    }

    #report-content>div {
        padding: 1rem !important;
    }

    /* Alert Modal - Mobile */
    .alert-modal-content {
        width: 95% !important;
        max-width: 95% !important;
        padding: 1.5rem !important;
    }

    .alert-item {
        padding: 0.75rem !important;
        font-size: 0.9rem !important;
    }

    /* Logements Grid - Mobile Stack */
    #logements-grid {
        grid-template-columns: 1fr !important;
    }

    /* Report Button - Larger Touch Target */
    .report-btn {
        padding: 0.6rem 1rem !important;
        font-size: 0.85rem !important;
        min-height: 36px !important;
    }

    /* Day Details Modal - Mobile */
    #day-details-modal>div {
        margin: 1rem !important;
        max-width: calc(100% - 2rem) !important;
        padding: 1.5rem !important;
    }

    /* Photo Grid in Reports */
    #report-content div[style*="grid-template-columns"] {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.5rem !important;
    }

    /* Monthly Stats - Mobile */
    #monthly-list {
        flex-direction: column !important;
        gap: 0.5rem !important;
    }

    #monthly-list>div {
        width: 100% !important;
        text-align: center !important;
    }

    /* Filter Group - Stack on Mobile */
    .filter-group {
        flex-direction: column !important;
        width: 100% !important;
    }

    .filter-group select,
    .filter-group input {
        width: 100% !important;
    }

    .search-box {
        width: 100% !important;
    }

    .search-box input {
        width: 100% !important;
    }

    /* Section Headers - Mobile */
    .section-header {
        flex-direction: column !important;
        align-items: flex-start !important;
    }

    /* Glass Card Images */
    .glass-card img {
        max-width: 100%;
        height: auto;
    }

    /* Stat Card Hover - Disable on Touch */
    @media (hover: none) {
        .stat-card:hover {
            transform: none !important;
        }
    }
}

/* Carousel Navigation */
.carousel-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    margin-bottom: 2rem;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    padding: 0 1rem;
    /* Add padding for arrows space if needed */
}

.carousel-track {
    display: flex;
    overflow-x: auto;
    scroll-behavior: smooth;
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE 10+ */
    gap: 1rem;
    flex: 1;
    align-items: center;
    padding-bottom: 0px;
    /* Adjust if scrollbar covers content */
}

.carousel-track::-webkit-scrollbar {
    display: none;
    /* Chrome/Safari */
}

.tab-btn {
    padding: 1rem 2rem;
    background: none;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    /* Prepare for active state */
    font-weight: 600;
    white-space: nowrap;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
}

.tab-btn:hover {
    color: var(--text-light);
    background: rgba(255, 255, 255, 0.05);
}

.tab-btn.active {
    color: var(--text-light);
    border-bottom: 2px solid var(--primary);
}

.carousel-arrow {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--glass-border);
    color: var(--text-light);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    /* Hidden by default via JS or media query strategies if needed, currently controlled by JS */
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
    z-index: 10;
}

.carousel-arrow:hover {
    background: var(--primary);
    transform: scale(1.1);
}

.carousel-arrow.left {
    margin-right: 0.5rem;
}

.carousel-arrow.right {
    margin-left: 0.5rem;
}

/* More Pills indicator */
.more-pills {
    cursor: pointer;
    transition: background 0.2s ease;
    font-weight: 700;
}

.more-pills:hover {
    background: rgba(0, 0, 0, 0.2) !important;
}

/* Mobile Modal Adjustments & Dot Styling */
@media (max-width: 768px) {
    #day-details-modal>div {
        max-width: 90%;
        margin: 5rem auto !important;
        /* Center vertically roughly */
        max-height: 80vh;
        overflow-y: auto;
    }

    /* Transform pills to dots on mobile */
    .calendar-grid.minimal-grid .calendar-day {
        display: block !important;
        /* Flow layout for inline dots */
        padding: 6px !important;
        min-height: 70px !important;
        /* Fixed height for consistency */
    }

    .calendar-day-number {
        margin-bottom: 4px;
        font-size: 0.9rem;
    }

    .calendar-grid.minimal-grid .mission-pill {
        width: 8px !important;
        height: 8px !important;
        min-width: 8px !important;
        padding: 0 !important;
        border-radius: 50% !important;
        color: transparent !important;
        /* Hide text */
        display: inline-block !important;
        margin: 2px !important;
        vertical-align: bottom;
        font-size: 0 !important;
    }

    .calendar-grid.minimal-grid .mission-pill.mission-pill-triangle {
        clip-path: none !important;
        padding-left: 0 !important;
    }

    .calendar-grid.minimal-grid .mission-pill.mission-pill-star {
        clip-path: none !important;
    }

    .more-pills {
        font-size: 0.7rem !important;
        padding: 0 4px !important;
        margin-top: 2px !important;
        display: inline-block !important;
        width: auto !important;
        height: auto !important;
        background: transparent !important;
        color: var(--text-dim) !important;
        vertical-align: middle;
    }
}

/* Mission Blur */
.mission-blur-container {
    position: relative;
    overflow: hidden;
}

.mission-blur-overlay {
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 100;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 1.5rem;
    border-radius: 12px;
    text-align: center;
    color: white;
    margin-top: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.price-blur {
    filter: blur(6px);
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 8px;
    border-radius: 4px;
    display: inline-block;
}

.mission-blurred-content {
    /* No longer used for full blur, but kept for legacy if needed */
    transition: all 0.3s ease;
}

/* Double protection: blur the actual content underneath as well */
/* Rule removed to allow interaction */

.conditions-box {
    background: rgba(0, 0, 0, 0.9);
    padding: 1rem;
    border-radius: 12px;
    font-size: 0.85rem;
    max-width: 90%;
    max-height: 85%;
    overflow-y: auto;
    margin-bottom: 1rem;
    text-align: left;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}

.conditions-box h4 {
    margin: 0 0 0.5rem 0;
    color: #ef4444;
    font-size: 1rem;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.conditions-box ul {
    padding-left: 1.2rem;
    margin: 0.5rem 0;
}

.conditions-box li {
    margin-bottom: 0.25rem;
    color: #e5e7eb;
}

.conditions-box p {
    margin: 0.5rem 0;
    color: #9ca3af;
}

.conditions-box strong {
    color: white;
}

/* --- Mobile Performance Optimizations --- */
@media (max-width: 768px) {

    /* Disable heavy blur effects */
    .glass-card,
    .mission-blur-overlay,
    .navbar,
    #photo-upload-modal>div,
    #photo-validation-modal>div,
    #day-details-modal>div {
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }

    /* Use solid backgrounds instead of blur */
    .glass-card {
        background: rgba(15, 23, 42, 0.98) !important;
        border: 1px solid rgba(255, 255, 255, 0.1);
    }

    .navbar {
        background: #0f172a !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .mission-blur-overlay {
        background: #0f172a !important;
        /* Solid dark background */
        opacity: 0.98;
    }

    /* Simplify Orbs to static gradients or remove blur if needed */
    .orb {
        filter: blur(40px) !important;
        /* Reduce blur radius */
        opacity: 0.4 !important;
        animation-duration: 20s !important;
        /* Slow down animation */
    }

    /* Mission Item improvements */
    .mission-blur-container {
        /* Remove transparent background to reduce blending calc */
        background: #1e293b !important;
        box-shadow: none !important;
    }

    /* Touch Action for better scrolling */
    .main-container,
    .content-wrapper,
    body {
        touch-action: pan-y;
    }
}

/* Calendar Filters */
.calendar-filters {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.filter-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-dim);
    padding: 0.5rem 1.5rem;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.filter-btn:hover,
.filter-btn.active {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

/* Mobile Modal Fixes */
@media (max-width: 768px) {

    #day-missions-modal>div,
    #photo-upload-modal>div,
    #photo-validation-modal>div,
    #earnings-modal>div,
    #missions-history-modal>div,
    #day-details-modal>div {
        width: 95% !important;
        max-width: 95% !important;
        margin: 1rem auto !important;
        padding: 1.5rem !important;
        max-height: 85vh !important;
        top: 20px !important;
        position: relative !important;
        /* Ensure it respects auto margins if needed, though centered often works better with fixed/flex */
    }

    /* Ensure close button is touch-friendly */
    .modal-close-btn,
    button[onclick^="close"] {
        padding: 0.5rem;
        font-size: 1.5rem;
    }
}

/* Missing Modal Base Class */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    /* High z-index to overlay everything */
    display: none;
    /* Hidden by default */
    justify-content: center;
    /* Center content if flex is used */
    align-items: center;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

/* Ensure modal content is scrollable if needed */
.modal>div {
    max-height: 90vh;
    overflow-y: auto;
}