/* Booking Platform CSS - Mobile-First Teal Theme */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    background: linear-gradient(135deg, #14b8a6 0%, #0d9488 50%, #0f766e 100%);
    min-height: 100vh;
    padding: 16px;
    color: #0f172a;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* Header Styles */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.header h1 {
    color: #0f172a;
    margin-bottom: 8px;
    font-size: 1.875rem;
    font-weight: 700;
    background: linear-gradient(135deg, #14b8a6, #0d9488);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header p {
    color: #64748b;
    font-size: 1rem;
    margin-bottom: 16px;
}

/* Authentication Styles */
.auth-section {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 32px 24px;
    margin: 80px auto;
    max-width: 400px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.15);
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.login-form {
    margin-top: 24px;
}

/* Tab Styles */
.tabs {
    display: flex;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    margin-bottom: 20px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    flex-wrap: wrap;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.tab {
    flex: 1;
    min-width: 120px;
    padding: 16px 20px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    transition: all 0.3s ease;
    text-align: center;
    border-right: 1px solid rgba(226, 232, 240, 0.5);
}

.tab:last-child {
    border-right: none;
}

.tab.active {
    background: linear-gradient(135deg, #14b8a6, #0d9488);
    color: white;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.tab:hover:not(.active) {
    background: rgba(20, 184, 166, 0.1);
    color: #0d9488;
}

/* Content Sections */
.tab-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 32px 24px;
    margin-bottom: 20px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.1);
    display: none;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.tab-content.active {
    display: block;
}

.tab-content h2 {
    color: #0f172a;
    margin-bottom: 24px;
    font-size: 1.5rem;
    font-weight: 700;
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #374151;
    font-size: 14px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: white;
    color: #0f172a;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #14b8a6;
    box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.1);
    transform: translateY(-1px);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

/* Button Styles */
.btn {
    background: linear-gradient(135deg, #14b8a6, #0d9488);
    color: white;
    padding: 14px 28px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    box-shadow: 0 4px 15px rgba(20, 184, 166, 0.3);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(20, 184, 166, 0.4);
    background: linear-gradient(135deg, #0d9488, #0f766e);
}

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

.btn-secondary {
    background: linear-gradient(135deg, #6b7280, #4b5563);
    box-shadow: 0 4px 15px rgba(107, 114, 128, 0.3);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #4b5563, #374151);
    box-shadow: 0 8px 25px rgba(107, 114, 128, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    box-shadow: 0 8px 25px rgba(239, 68, 68, 0.4);
}

.btn-small {
    padding: 10px 20px;
    font-size: 14px;
    min-height: 36px;
}

/* Card Styles */
.property-card,
.booking-card {
    background: rgba(248, 250, 252, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 20px;
    border: 2px solid rgba(226, 232, 240, 0.5);
    transition: all 0.3s ease;
}

.property-card:hover,
.booking-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.1);
    border-color: #14b8a6;
    background: rgba(255, 255, 255, 0.95);
}

.property-card h3,
.booking-card h4 {
    color: #0f172a;
    margin-bottom: 12px;
    font-size: 1.25rem;
    font-weight: 700;
}

.property-details {
    color: #64748b;
    margin-bottom: 20px;
    line-height: 1.6;
    font-size: 14px;
}

/* Status Badges */
.status {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-block;
}

.status-confirmed {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.status-pending {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

.status-cancelled {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* Alert Styles */
.alert {
    padding: 16px 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-weight: 600;
    font-size: 14px;
    border: 1px solid;
}

.alert-success {
    background: #ecfdf5;
    color: #065f46;
    border-color: #a7f3d0;
}

.alert-error {
    background: #fef2f2;
    color: #991b1b;
    border-color: #fecaca;
}

.alert-info {
    background: #eff6ff;
    color: #1e40af;
    border-color: #bfdbfe;
}

.alert-warning {
    background: #fffbeb;
    color: #92400e;
    border-color: #fed7aa;
}

/* Stats Grid */
.stats {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    padding: 24px;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: #14b8a6;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #14b8a6, #0d9488);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    color: #64748b;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Calendar Styles - Mobile First */
.calendar-controls {
    background: rgba(248, 250, 252, 0.9);
    backdrop-filter: blur(10px);
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 16px;
    border: 2px solid rgba(226, 232, 240, 0.5);
}

.property-multiselect {
    position: relative;
    margin-bottom: 16px;
}

.property-multiselect label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #374151;
    font-size: 14px;
}

.multiselect-dropdown {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    padding: 12px 14px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 44px;
    transition: all 0.3s ease;
    font-size: 14px;
}

.multiselect-dropdown:hover {
    border-color: #14b8a6;
}

.multiselect-dropdown:focus {
    outline: none;
    border-color: #14b8a6;
    box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.1);
}

.multiselect-options {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 2px solid #e5e7eb;
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 180px;
    overflow-y: auto;
    z-index: 20;
    display: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.multiselect-options.open {
    display: block;
}

.multiselect-option {
    padding: 12px 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid #f1f5f9;
    transition: background-color 0.2s ease;
    min-height: 44px;
}

.multiselect-option:hover {
    background: #f8fafc;
}

.multiselect-option:last-child {
    border-bottom: none;
}

.multiselect-option input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #14b8a6;
    cursor: pointer;
}

.multiselect-option label {
    cursor: pointer;
    font-weight: 500;
    color: #374151;
    margin: 0;
    flex: 1;
}

/* Calendar Header Mobile */
.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

.calendar-nav {
    display: flex;
    gap: 4px;
}

.calendar-nav button {
    background: #14b8a6;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(20, 184, 166, 0.3);
    white-space: nowrap;
}

.calendar-nav button:hover {
    background: #0d9488;
    box-shadow: 0 2px 6px rgba(20, 184, 166, 0.4);
}

.calendar-month {
    font-size: 1.125rem;
    font-weight: 700;
    color: #0f172a;
    text-align: center;
    flex: 1;
    min-width: 150px;
}

/* Mobile Calendar Container */
.calendar-container {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Calendar Grid - Mobile First */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    width: 100%;
    min-width: 0;
}

.calendar-day-header {
    background: linear-gradient(135deg, #14b8a6, #0d9488);
    color: white;
    padding: 8px 4px;
    text-align: center;
    font-weight: 700;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.2px;
    min-height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.calendar-day {
    background: white;
    min-height: 80px;
    padding: 4px 2px;
    position: relative;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
}

.calendar-day:hover {
    background: #f8fafc;
    z-index: 2;
}

.calendar-day.other-month {
    background: #f9fafb;
    color: #9ca3af;
}

.calendar-day.today {
    background: #ecfdf5;
    border: 1px solid #14b8a6;
    box-shadow: inset 0 0 0 1px #14b8a6;
}

.day-number {
    font-weight: 700;
    font-size: 12px;
    margin-bottom: 4px;
    color: #0f172a;
    text-align: center;
    flex-shrink: 0;
}

.calendar-day.other-month .day-number {
    color: #9ca3af;
}

.calendar-day.today .day-number {
    color: #065f46;
}

/* Mobile Calendar Bookings */
.calendar-booking {
    background: #14b8a6;
    color: white;
    padding: 2px 4px;
    border-radius: 3px;
    font-size: 8px;
    font-weight: 600;
    margin-bottom: 1px;
    cursor: pointer;
    transition: all 0.2s ease;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    line-height: 1.2;
    min-height: 12px;
    display: flex;
    align-items: center;
}

.calendar-booking:hover {
    z-index: 10;
    opacity: 0.8;
}

.calendar-booking.booking-start {
    border-left: 2px solid #000;
    padding-left: 2px;
}

.calendar-booking.booking-end {
    border-right: 2px solid #000;
    padding-right: 2px;
}

/* Platform-specific booking colors */
.calendar-booking.source-airbnb {
    background: #ff5a5f;
}

.calendar-booking.source-booking_com {
    background: #003580;
}

.calendar-booking.source-direct {
    background: #14b8a6;
}

.calendar-booking.source-vrbo {
    background: #ff8c00;
}

/* Property-based colors for calendar bookings */
.property-1 { background-color: #FF6B6B !important; }
.property-2 { background-color: #4ECDC4 !important; }
.property-3 { background-color: #45B7D1 !important; }
.property-4 { background-color: #96CEB4 !important; }
.property-5 { background-color: #FECA57 !important; }
.property-6 { background-color: #FF9FF3 !important; }
.property-7 { background-color: #54A0FF !important; }
.property-8 { background-color: #5F27CD !important; }
.property-9 { background-color: #00D2D3 !important; }
.property-10 { background-color: #FF9F43 !important; }

.property-badge {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 6px;
    border: 2px solid white;
    box-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.booking-card .property-indicator {
    width: 8px;
    height: 100%;
    position: absolute;
    left: 0;
    top: 0;
    border-radius: 4px 0 0 4px;
}

.booking-card {
    position: relative;
    padding-left: 16px !important;
}

/* More "+" indicator for multiple bookings */
.calendar-booking-more {
    background: #6c757d;
    color: white;
    font-size: 8px;
    text-align: center;
    padding: 2px;
    border-radius: 2px;
    cursor: pointer;
    margin-top: 1px;
}

/* Calendar Pricing */
.day-price {
    background: rgba(20, 184, 166, 0.1);
    color: #0f766e;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    margin-bottom: 2px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    border: 1px solid rgba(20, 184, 166, 0.2);
}

.day-price:hover {
    background: rgba(20, 184, 166, 0.2);
    transform: scale(1.05);
}

.day-price.custom-price {
    background: rgba(251, 146, 60, 0.1);
    color: #ea580c;
    border-color: rgba(251, 146, 60, 0.3);
    font-weight: 700;
}

.day-price.custom-price:hover {
    background: rgba(251, 146, 60, 0.2);
}

.price-amount {
    font-weight: 700;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    z-index: 1000;
    padding: 8px;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 12px;
    padding: 20px 16px;
    max-width: 600px;
    width: 100%;
    max-height: 95vh;
    overflow-y: auto;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid #e5e7eb;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #0f172a;
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #6b7280;
    padding: 4px;
    border-radius: 8px;
    transition: all 0.2s ease;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    background: #f3f4f6;
    color: #0f172a;
    transform: scale(1.1);
}

/* Booking Details */
.booking-details {
    display: grid;
    gap: 20px;
}

.detail-group {
    background: #f8fafc;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
}

.detail-label {
    font-weight: 700;
    color: #374151;
    font-size: 14px;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-value {
    color: #0f172a;
    font-size: 16px;
    line-height: 1.5;
}

/* Tables */
.bookings-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 24px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.bookings-table th {
    background: linear-gradient(135deg, #14b8a6, #0d9488);
    color: white;
    padding: 16px 12px;
    text-align: left;
    font-weight: 700;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.bookings-table td {
    padding: 16px 12px;
    border-bottom: 1px solid #e5e7eb;
    background: white;
    vertical-align: top;
}

.bookings-table tr:hover td {
    background: #f8fafc;
}

.bookings-table tr:last-child td {
    border-bottom: none;
}

/* iCal URLs */
.ical-urls {
    background: rgba(248, 250, 252, 0.9);
    padding: 24px;
    border-radius: 12px;
    margin-top: 24px;
    border: 1px solid #e5e7eb;
}

.ical-export-item {
    margin-bottom: 15px;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
}

.ical-url {
    background: white;
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 13px;
    word-break: break-all;
    border: 1px solid #d1d5db;
    color: #374151;
}

.ical-url:last-child {
    margin-bottom: 0;
}

/* Very Small Mobile Screens */
@media (max-width: 480px) {
    body {
        padding: 8px;
    }
    
    .tab-content {
        padding: 16px 12px;
        overflow-x: hidden;
    }
    
    .calendar-container {
        margin: 0 -12px;
        padding: 0 12px;
    }
    
    .calendar-day {
        min-height: 70px;
        padding: 2px 1px;
    }
    
    .day-number {
        font-size: 11px;
        margin-bottom: 2px;
    }
    
    .calendar-booking {
        font-size: 7px;
        padding: 1px 2px;
        min-height: 10px;
        text-indent: -9999px;
    }
    
    .calendar-booking::after {
        content: "•";
        text-indent: 0;
        font-size: 12px;
        font-weight: bold;
        display: flex;
        align-items: center;
        justify-content: center;
        height: 100%;
    }
    
    .calendar-day-header {
        font-size: 9px;
        padding: 6px 2px;
        min-height: 28px;
    }
    
    .calendar-month {
        font-size: 1rem;
    }
    
    .calendar-nav button {
        padding: 6px 8px;
        font-size: 11px;
    }
    
    .calendar-legend {
        display: none;
    }
    
    .header h1 {
        font-size: 1.5rem;
    }
}

/* Tablet Responsive */
@media (min-width: 640px) {
    body {
        padding: 24px;
    }

    .form-row {
        grid-template-columns: repeat(2, 1fr);
    }

    .stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .header h1 {
        font-size: 2.25rem;
    }

    .tabs {
        flex-wrap: nowrap;
    }

    .tab {
        min-width: auto;
        padding: 18px 24px;
    }

    .calendar-controls {
        padding: 24px;
    }
    
    .calendar-grid {
        gap: 2px;
        border-radius: 12px;
    }
    
    .calendar-day {
        min-height: 100px;
        padding: 12px 8px;
    }
    
    .calendar-day-header {
        padding: 16px 8px;
        font-size: 14px;
        min-height: auto;
    }
    
    .day-number {
        font-size: 16px;
        margin-bottom: 8px;
    }
    
    .calendar-booking {
        font-size: 11px;
        padding: 4px 8px;
        margin-bottom: 2px;
        min-height: 16px;
        text-indent: 0;
    }
    
    .calendar-booking::after {
        display: none;
    }
    
    .calendar-booking:hover {
        transform: scale(1.05);
        opacity: 1;
    }
    
    .calendar-month {
        font-size: 1.5rem;
    }

    .calendar-header {
        flex-wrap: nowrap;
    }
    
    .modal {
        padding: 16px;
    }
    
    .modal-content {
        padding: 32px 24px;
        border-radius: 20px;
        max-height: 90vh;
    }
    
    .modal-title {
        font-size: 1.5rem;
    }
    
    .close-btn {
        font-size: 28px;
        width: 40px;
        height: 40px;
    }
}

@media (min-width: 768px) {
    .stats {
        grid-template-columns: repeat(4, 1fr);
    }

    .auth-section {
        padding: 40px;
    }

    .calendar-day {
        min-height: 120px;
    }

    .calendar-booking {
        font-size: 12px;
        padding: 6px 10px;
    }

    .day-number {
        font-size: 18px;
    }

    .tab-content {
        padding: 40px 32px;
    }

    .modal-content {
        padding: 40px 32px;
    }
}

@media (min-width: 1024px) {
    .form-row {
        grid-template-columns: repeat(3, 1fr);
    }

    .container {
        padding: 0 24px;
    }

    .calendar-day {
        min-height: 140px;
        padding: 16px 12px;
    }

    .calendar-booking {
        font-size: 13px;
        padding: 6px 12px;
    }
}

/* Loading States */
.loading {
    text-align: center;
    padding: 40px;
    color: #64748b;
}

.loading-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid #e5e7eb;
    border-radius: 50%;
    border-top-color: #14b8a6;
    animation: spin 1s ease-in-out infinite;
    margin-bottom: 16px;
}

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

/* Utility Classes */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.mb-4 {
    margin-bottom: 1rem;
}

.mt-4 {
    margin-top: 1rem;
}

.flex {
    display: flex;
}

.flex-wrap {
    flex-wrap: wrap;
}

.gap-2 {
    gap: 0.5rem;
}

.gap-4 {
    gap: 1rem;
}

/* Mobile-Friendly Calendar Legend Styles */

/* Calendar Legend Container */
.calendar-legend {
    background: rgba(248, 250, 252, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
    border: 2px solid rgba(226, 232, 240, 0.5);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.calendar-legend h4 {
    margin: 0 0 12px 0;
    font-size: 14px;
    font-weight: 700;
    color: #374151;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Legend Items Container - Mobile First */
.legend-items {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: white;
    border-radius: 8px;
    border: 1px solid rgba(226, 232, 240, 0.8);
    transition: all 0.2s ease;
    min-height: 40px; /* Touch-friendly height */
}

.legend-item:hover {
    background: #f8fafc;
    border-color: #14b8a6;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Legend Color Indicator */
.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
}

/* Legend Text */
.legend-item span {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    flex: 1;
    line-height: 1.3;
}

/* Compact Mobile Legend - for very small screens */
.legend-compact {
    display: none;
}

.legend-compact .legend-items {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
}

.legend-compact .legend-item {
    padding: 6px 8px;
    min-height: 32px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.9);
    flex: 0 0 auto;
    min-width: 0;
}

.legend-compact .legend-color {
    width: 12px;
    height: 12px;
}

.legend-compact .legend-item span {
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100px;
}

/* Toggle Button for Legend */
.legend-toggle {
    background: #14b8a6;
    color: white;
    border: none;
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    display: none;
    margin: 0 auto 16px auto;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(20, 184, 166, 0.3);
}

.legend-toggle:hover {
    background: #0d9488;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(20, 184, 166, 0.4);
}

.legend-toggle.active {
    background: #dc2626;
}

/* Legend States */
.calendar-legend.collapsed {
    display: none;
}

/* Responsive Legend Styles */
@media (max-width: 480px) {
    /* Very small screens - show compact legend by default */
    .legend-toggle {
        display: block;
    }
    
    .calendar-legend {
        padding: 12px;
        margin-bottom: 12px;
    }
    
    .calendar-legend h4 {
        font-size: 12px;
        margin-bottom: 8px;
    }
    
    .legend-items {
        gap: 6px;
    }
    
    .legend-item {
        padding: 6px 8px;
        min-height: 36px;
        gap: 8px;
    }
    
    .legend-color {
        width: 14px;
        height: 14px;
    }
    
    .legend-item span {
        font-size: 13px;
    }
    
    /* Show compact version on very small screens */
    .calendar-legend.compact-mode {
        display: block;
    }
    
    .calendar-legend.compact-mode .legend-items {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        justify-content: center;
    }
    
    .calendar-legend.compact-mode .legend-item {
        padding: 4px 8px;
        min-height: 28px;
        border-radius: 14px;
        flex: 0 0 auto;
    }
    
    .calendar-legend.compact-mode .legend-color {
        width: 10px;
        height: 10px;
    }
    
    .calendar-legend.compact-mode .legend-item span {
        font-size: 11px;
        max-width: 80px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

@media (min-width: 481px) and (max-width: 640px) {
    /* Small screens - 2 columns */
    .legend-items {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .legend-item span {
        font-size: 13px;
    }
}

@media (min-width: 641px) and (max-width: 768px) {
    /* Medium screens - 3 columns */
    .legend-items {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 769px) {
    /* Large screens - 4 columns */
    .legend-items {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .calendar-legend {
        padding: 20px;
        margin-bottom: 20px;
    }
    
    .legend-item {
        padding: 10px 14px;
        min-height: 44px;
    }
    
    .legend-color {
        width: 18px;
        height: 18px;
    }
    
    .legend-item span {
        font-size: 15px;
    }
}