/* Modern Cart Validation & Person Selector Modal */

/* Modal Overlay */
.vitriol-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 9999;
    animation: fadeIn 0.3s ease;
}

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

/* Modal Container */
.vitriol-modal {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
    position: relative;
}

/* Large Modal */
.vitriol-modal-large {
    max-width: 700px;
}

/* Modal Header */
.vitriol-modal-header {
    padding: 24px 24px 16px;
    border-bottom: 1px solid #E7E7E7;
}

.vitriol-modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #323232;
}

.vitriol-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
    transition: color 0.2s;
}

.vitriol-modal-close:hover {
    color: #323232;
}

/* Modal Body */
.vitriol-modal-body {
    padding: 24px;
}

.vitriol-modal-body p {
    margin: 0 0 20px;
    color: #666;
    font-size: 14px;
    line-height: 1.6;
}

/* Person Selector Grid */
.person-selector-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    margin-bottom: 24px;
}

.person-option {
    aspect-ratio: 1;
    border: 2px solid #E7E7E7;
    border-radius: 8px;
    background: #FAFAFA;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.person-option:hover {
    border-color: #246d66;
    background: #f0f9f8;
    transform: translateY(-2px);
}

.person-option.selected {
    border-color: #246d66;
    background: linear-gradient(135deg, #246d66 0%, #2A9D8F 100%);
    color: #fff;
    box-shadow: 0 4px 12px rgba(36, 109, 102, 0.3);
}

/* Date Cards Grid */
.date-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
}

.date-card {
    background: white;
    border: 2px solid #e7e7e7;
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    position: relative;
}

.date-card:hover:not(.disabled) {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.date-card.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f5f5f5;
}

.date-title {
    font-size: 16px;
    font-weight: 700;
    color: #323232;
    margin-bottom: 8px;
}

.date-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.date-checkmark {
    position: absolute;
    top: -8px;
    right: -8px;
    background: white;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.date-card.selected .date-checkmark {
    display: flex;
}

.date-checkmark i {
    font-size: 20px;
    color: #246d66;
}

/* Status Colors - High (Green) */
.date-status-high {
    border-color: #4CAF50;
}

.date-status-high:hover:not(.disabled) {
    border-color: #4CAF50;
    background: #f1f8f4;
}

.date-status-high.selected {
    border-color: #4CAF50;
    background: linear-gradient(135deg, #4CAF50 0%, #66BB6A 100%);
}

.date-status-high .date-badge {
    background: #d4edda;
    color: #155724;
}

.date-status-high.selected .date-title,
.date-status-high.selected .date-badge {
    color: white;
}

.date-status-high.selected .date-badge {
    background: rgba(255, 255, 255, 0.3);
}

/* Status Colors - Medium (Orange) */
.date-status-medium {
    border-color: #FF9800;
}

.date-status-medium:hover:not(.disabled) {
    border-color: #FF9800;
    background: #fff8e1;
}

.date-status-medium.selected {
    border-color: #FF9800;
    background: linear-gradient(135deg, #FF9800 0%, #FFB74D 100%);
}

.date-status-medium .date-badge {
    background: #fff3cd;
    color: #856404;
}

.date-status-medium.selected .date-title,
.date-status-medium.selected .date-badge {
    color: white;
}

.date-status-medium.selected .date-badge {
    background: rgba(255, 255, 255, 0.3);
}

/* Status Colors - Low (Red) */
.date-status-low {
    border-color: #F44336;
}

.date-status-low:hover:not(.disabled) {
    border-color: #F44336;
    background: #ffebee;
}

.date-status-low.selected {
    border-color: #F44336;
    background: linear-gradient(135deg, #F44336 0%, #EF5350 100%);
}

.date-status-low .date-badge {
    background: #f8d7da;
    color: #721c24;
}

.date-status-low.selected .date-title,
.date-status-low.selected .date-badge {
    color: white;
}

.date-status-low.selected .date-badge {
    background: rgba(255, 255, 255, 0.3);
}

/* Status Colors - Full (Gray) */
.date-status-full {
    border-color: #9E9E9E;
    background: #f5f5f5;
}

.date-status-full .date-title {
    color: #999;
}

.date-status-full .date-badge {
    background: #e0e0e0;
    color: #666;
}

/* Loading/Error States */
.date-loading,
.date-empty,
.date-error {
    padding: 40px 20px;
    text-align: center;
    color: #666;
    font-size: 14px;
}

.date-error {
    color: #721c24;
}

/* Modal Footer */
.vitriol-modal-footer {
    padding: 16px 24px 24px;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.vitriol-btn {
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.vitriol-btn-secondary {
    background: #F5F5F5;
    color: #666;
}

.vitriol-btn-secondary:hover {
    background: #E7E7E7;
}

.vitriol-btn-primary {
    background: linear-gradient(135deg, #246d66 0%, #2A9D8F 100%);
    color: #fff;
}

.vitriol-btn-primary:hover {
    box-shadow: 0 4px 12px rgba(36, 109, 102, 0.3);
    transform: translateY(-2px);
}

.vitriol-btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Person Count Display */
.vitriol-person-count {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #f0f9f8;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    color: #246d66;
    font-weight: 600;
    margin-bottom: 16px;
    cursor: pointer;
    transition: all 0.2s;
}

.vitriol-person-count:hover {
    background: #e0f2f1;
    transform: translateY(-1px);
}

.vitriol-person-count i {
    font-size: 16px;
}

/* Warning Alert */
.vitriol-warning-alert {
    display: none;
    background: linear-gradient(135deg, #FFF3CD 0%, #FFF8E1 100%);
    border-left: 4px solid #FFC107;
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    animation: slideDown 0.3s ease;
}

.vitriol-warning-alert.active {
    display: block;
}

.vitriol-warning-alert .alert-title {
    font-weight: 600;
    color: #856404;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.vitriol-warning-alert .alert-message {
    color: #856404;
    font-size: 14px;
    line-height: 1.6;
}

.vitriol-warning-alert i {
    font-size: 18px;
}

/* Checkout Button Disabled State */
#checkout-complete-shopping.vitriol-disabled {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
}

/* Alert Modal Specific Styles */
.vitriol-alert-modal {
    max-width: 400px;
}

.vitriol-alert-modal .vitriol-modal-body p {
    color: #323232;
    font-size: 15px;
}

.vitriol-alert-overlay {
    z-index: 10000;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    .vitriol-modal {
        max-width: 95%;
        border-radius: 12px;
    }

    .vitriol-modal-large {
        max-width: 95%;
    }

    .person-selector-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 8px;
    }

    .person-option {
        font-size: 14px;
    }

    .date-cards-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .vitriol-modal-header h3 {
        font-size: 18px;
        padding-right: 30px;
    }

    .vitriol-modal-body {
        padding: 20px 16px;
    }

    .vitriol-modal-footer {
        flex-direction: column;
        padding: 12px 16px 20px;
    }

    .vitriol-btn {
        width: 100%;
    }
}