/**
 * Modal Styles - Unified across all pages
 * StyleCuts Barber Booking App
 */

/* ============================================
   BASE MODAL OVERLAY
   ============================================ */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.modal.active,
.modal.show {
    display: flex;
    opacity: 1;
    pointer-events: auto;
}

/* ============================================
   MODAL CONTENT BOX
   ============================================ */
.modal-content {
    background-color: white;
    padding: 30px;
    border-radius: 20px;
    max-width: 380px;
    width: 90%;
    text-align: center;
    transform: scale(0.9);
    transition: transform 0.3s ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal.active .modal-content {
    transform: scale(1);
}

/* ============================================
   MODAL ICON
   ============================================ */
.modal-icon {
    width: 70px;
    height: 70px;
    margin: 0 auto 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
}

.modal-icon.warning {
    background: #fee2e2;
}

.modal-icon.success {
    background: #d1fae5;
}

.modal-icon.info {
    background: #e0f2fe;
}

/* ============================================
   MODAL HEADER (for modals with close button)
   ============================================ */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    text-align: left;
}

.modal-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #999;
    padding: 0;
    line-height: 1;
    transition: color 0.2s;
}

.modal-close:hover {
    color: #333;
}

/* ============================================
   MODAL TITLE & TEXT
   ============================================ */
.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 12px;
}

.modal-message {
    font-size: 0.95rem;
    color: #666;
    margin-bottom: 24px;
    line-height: 1.5;
}

/* ============================================
   MODAL BUTTONS
   ============================================ */
.modal-buttons {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.modal-btn {
    flex: 1;
    padding: 14px 20px;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.modal-btn:hover {
    transform: translateY(-1px);
}

.modal-btn-primary {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
}

.modal-btn-primary:hover {
    box-shadow: 0 4px 15px rgba(30, 60, 114, 0.4);
}

.modal-btn-secondary {
    background: #f0f0f0;
    color: #666;
}

.modal-btn-secondary:hover {
    background: #e5e5e5;
}

.modal-btn-danger {
    background: linear-gradient(135deg, #dc2626 0%, #ef4444 100%);
    color: white;
}

.modal-btn-danger:hover {
    box-shadow: 0 4px 15px rgba(220, 38, 38, 0.4);
}

/* Full width button variant */
.modal-btn-full {
    width: 100%;
    margin-top: 12px;
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    transform: translateX(150%);
    padding: 14px 24px;
    border-radius: 12px;
    color: white;
    font-weight: 500;
    font-size: 14px;
    z-index: 1001;
    max-width: 300px;
    width: auto;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.toast.show {
    transform: translateX(0);
    opacity: 1;
}

.toast.success {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
}

.toast.error {
    background: linear-gradient(135deg, #dc2626 0%, #ef4444 100%);
}

.toast.info {
    background: linear-gradient(135deg, #0891b2 0%, #06b6d4 100%);
}

.toast.warning {
    background: linear-gradient(135deg, #d97706 0%, #f59e0b 100%);
}

.toast-icon {
    font-size: 18px;
}

.toast-message {
    flex: 1;
}

/* ============================================
   CLEAR HISTORY MODAL (appointments page)
   ============================================ */
.clear-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.clear-modal.show {
    opacity: 1;
    visibility: visible;
}

.clear-modal-content {
    background: white;
    border-radius: 20px;
    padding: 30px;
    width: 90%;
    max-width: 340px;
    text-align: center;
    transform: scale(0.8);
    transition: transform 0.3s ease;
}

.clear-modal.show .clear-modal-content {
    transform: scale(1);
}

.clear-modal-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 20px;
    background: #ffebee;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
}

.clear-modal-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 10px;
}

.clear-modal-text {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 24px;
    line-height: 1.5;
}

.clear-modal-buttons {
    display: flex;
    gap: 12px;
}

.clear-modal-btn {
    flex: 1;
    padding: 14px;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.clear-modal-btn.secondary {
    background: #f0f0f0;
    color: #666;
}

.clear-modal-btn.secondary:hover {
    background: #e5e5e5;
}

.clear-modal-btn.danger {
    background: linear-gradient(135deg, #dc2626 0%, #ef4444 100%);
    color: white;
}

.clear-modal-btn.danger:hover {
    box-shadow: 0 4px 15px rgba(220, 38, 38, 0.3);
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes modalFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes modalSlideIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */
@media (max-width: 400px) {
    .modal-content {
        padding: 24px 20px;
        margin: 0 10px;
    }
    
    .modal-buttons {
        flex-direction: column;
    }
    
    .modal-btn {
        width: 100%;
    }
    
   
    
    .toast.show {
        transform: translateX(0) translateY(0);
    }
}
