/* Frontend Styles */
.ffsm-date-group {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.ffsm-group-header {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f1f5f9;
}

.ffsm-group-title {
    margin: 0 0 10px 0;
    color: #1e293b;
    font-size: 22px;
    font-weight: 600;
}

.ffsm-group-description {
    color: #64748b;
    margin: 0 0 10px 0;
    line-height: 1.6;
}

.ffsm-group-price {
    display: inline-block;
    background: #3b82f6;
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 14px;
}

/* Date Grid Layout - 4 columns with tighter spacing */
.ffsm-group-dates.grid-layout {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

@media (max-width: 1200px) {
    .ffsm-group-dates.grid-layout {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .ffsm-group-dates.grid-layout {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .ffsm-group-dates.grid-layout {
        grid-template-columns: 1fr;
    }
}

/* Date Items - Enhanced Compact Design */
.ffsm-date-item {
    position: relative;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    padding: 0;
    transition: all 0.2s ease;
    cursor: pointer;
    overflow: hidden;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.ffsm-date-item:hover {
    border-color: #3b82f6;
    box-shadow: 0 2px 6px rgba(59, 130, 246, 0.15);
    transform: translateY(-1px);
}

.ffsm-date-item.available:has(input:checked),
.ffsm-date-item.available input:checked + label {
    border-color: #10b981;
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.2);
}

.ffsm-date-item.waitlist,
.ffsm-date-item.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: #f8fafc;
    border-color: #cbd5e1;
}

.ffsm-date-item input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.ffsm-date-item label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    margin: 0;
    cursor: pointer;
    width: 100%;
    min-height: 50px;
}

.ffsm-date-item.disabled label,
.ffsm-date-item.waitlist label {
    cursor: not-allowed;
}

.ffsm-date-label {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1;
}

.date-text {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    display: block;
    line-height: 1.3;
}

.ffsm-date-item.waitlist .date-text {
    color: #64748b;
}

.ffsm-slot-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 12px;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.ffsm-slot-indicator:not(.waitlist) {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.ffsm-date-item:has(input:checked) .ffsm-slot-indicator:not(.waitlist),
.ffsm-date-item input:checked + label .ffsm-slot-indicator:not(.waitlist) {
    background: #10b981;
    color: white;
    border-color: #10b981;
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.3);
}

.ffsm-slot-indicator.waitlist {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fcd34d;
    cursor: pointer;
}

.ffsm-slot-indicator.waitlist:hover {
    background: #f59e0b;
    color: white;
    border-color: #f59e0b;
}

.ffsm-date-price {
    font-size: 15px;
    font-weight: 700;
    color: #3b82f6;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    padding: 5px 10px;
    border-radius: 5px;
    min-width: 70px;
    text-align: center;
    border: 1px solid #bfdbfe;
    white-space: nowrap;
}

/* Selection Counter */
.ffsm-selection-counter {
    background: #f1f5f9;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    font-size: 15px;
    color: #475569;
    margin-top: 20px;
    border: 1px solid #e2e8f0;
}

.ffsm-selection-counter .selected-count {
    font-weight: 700;
    color: #10b981;
    font-size: 18px;
}

.ffsm-selection-counter .max-selection {
    font-weight: 700;
    color: #3b82f6;
}

/* Waitlist Popup */
.ffsm-waitlist-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 999999;
    padding: 20px;
}

.ffsm-waitlist-popup {
    background: white;
    border-radius: 12px;
    padding: 30px;
    width: 90%;
    max-width: 450px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

.ffsm-waitlist-popup h3 {
    margin: 0 0 10px 0;
    color: #1e293b;
    font-size: 20px;
}

.ffsm-waitlist-popup p {
    color: #64748b;
    margin-bottom: 25px;
    line-height: 1.6;
}

.ffsm-waitlist-email {
    width: 100%;
    padding: 14px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 15px;
    margin-bottom: 20px;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.ffsm-waitlist-email:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.ffsm-waitlist-buttons {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.ffsm-waitlist-submit,
.ffsm-waitlist-cancel {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.ffsm-waitlist-submit {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
}

.ffsm-waitlist-submit:hover {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
}

.ffsm-waitlist-cancel {
    background: #f1f5f9;
    color: #64748b;
}

.ffsm-waitlist-cancel:hover {
    background: #e2e8f0;
    color: #475569;
}

/* Error States */
.ffsm-error {
    color: #ef4444;
    background: #fef2f2;
    padding: 10px 15px;
    border-radius: 6px;
    border: 1px solid #fecaca;
}

/* Responsive */
@media (max-width: 768px) {
    .ffsm-date-item label {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding: 10px 12px;
        min-height: auto;
    }
    
    .ffsm-date-price {
        align-self: flex-end;
        font-size: 16px;
        padding: 4px 10px;
    }
    
    .ffsm-waitlist-popup {
        padding: 20px;
    }
    
    .ffsm-waitlist-buttons {
        flex-direction: column;
    }
    
    .ffsm-waitlist-submit,
    .ffsm-waitlist-cancel {
        width: 100%;
    }
}