/**
 * Professional Modal System CSS for Kavala Medical Website
 * Extracted from appointment.css for reusability across pages
 * 
 * Features:
 * - Beautiful responsive modals with medical theme
 * - Smooth animations and transitions
 * - Multiple modal types with color coding
 * - Loading animations with heartbeat effect
 * - Mobile responsive design
 */

/* ========== MODAL OVERLAY AND BASE STYLES ========== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(26, 54, 93, 0.6);
    backdrop-filter: blur(4px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

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

.modal {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(26, 54, 93, 0.3);
    max-width: 480px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    transform: scale(0.8) translateY(20px);
    transition: all 0.3s ease;
    border: 1px solid rgba(74, 144, 164, 0.2);
}

.modal-overlay.show .modal {
    transform: scale(1) translateY(0);
}

/* ========== MODAL HEADER ========== */
.modal-header {
    padding: 24px 24px 16px;
    border-bottom: 1px solid #e2e8f0;
    background: linear-gradient(135deg, #f8fafc, #edf2f7);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.modal-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #1a365d;
    font-family: 'Playfair Display', serif;
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.modal-title i {
    color: #4a90a4;
    font-size: 1.1rem;
}

.modal-close {
    background: none;
    border: none;
    color: #a0aec0;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    margin-left: 12px;
    flex-shrink: 0;
}

.modal-close:hover {
    background: rgba(74, 144, 164, 0.1);
    color: #4a90a4;
    transform: scale(1.1);
}

.modal-close:active {
    transform: scale(0.95);
}

/* ========== MODAL BODY ========== */
.modal-body {
    padding: 24px;
    max-height: 400px;
    overflow-y: auto;
}

.modal-text {
    color: #4a5568;
    line-height: 1.6;
    margin: 0;
    font-size: 1rem;
}

.modal-details {
    background: #f8fafc;
    border-radius: 8px;
    padding: 16px;
    margin: 16px 0;
    border-left: 4px solid #4a90a4;
}

.modal-detail-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.modal-detail-row:last-child {
    margin-bottom: 0;
}

.modal-detail-label {
    font-weight: 600;
    color: #1a365d;
}

.modal-detail-value {
    color: #4a5568;
    text-align: right;
}

/* ========== MODAL ACTIONS ========== */
.modal-actions {
    padding: 16px 24px 24px;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    background: #f8fafc;
}

.modal-btn {
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    font-family: 'Inter', sans-serif;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 100px;
    justify-content: center;
}

.modal-btn-secondary {
    background: white;
    color: #4a5568;
    border: 1.5px solid #e2e8f0;
}

.modal-btn-secondary:hover {
    background: #f7fafc;
    border-color: #4a90a4;
    color: #2d5a87;
    transform: translateY(-1px);
}

.modal-btn-primary {
    background: linear-gradient(135deg, #4a90a4, #2d5a87);
    color: white;
    border: 1.5px solid transparent;
}

.modal-btn-primary:hover {
    background: linear-gradient(135deg, #2d5a87, #1a365d);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(74, 144, 164, 0.3);
}

.modal-btn-danger {
    background: linear-gradient(135deg, #4a90a4, #2d5a87);
    color: white;
    border: 1.5px solid transparent;
}

.modal-btn-danger:hover {
    background: linear-gradient(135deg, #2d5a87, #1a365d);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(74, 144, 164, 0.3);
}

.modal-btn-success {
    background: linear-gradient(135deg, #4a90a4, #2d5a87);
    color: white;
    border: 1.5px solid transparent;
}

.modal-btn-success:hover {
    background: linear-gradient(135deg, #2d5a87, #1a365d);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(74, 144, 164, 0.3);
}

/* Loading state for buttons */
.modal-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none !important;
}

.modal-btn .spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ========== MODAL TYPE VARIATIONS ========== */
.modal.error .modal-header {
    background: linear-gradient(135deg, #f8fafc, #edf2f7);
}

.modal.error .modal-title i {
    color: #1a365d;
}

.modal.warning .modal-header {
    background: linear-gradient(135deg, #f8fafc, #edf2f7);
}

.modal.warning .modal-title i {
    color: #2d5a87;
}

.modal.success .modal-header {
    background: linear-gradient(135deg, #f8fafc, #edf2f7);
}

.modal.success .modal-title i {
    color: #4a90a4;
}

.modal.info .modal-header {
    background: linear-gradient(135deg, #f8fafc, #edf2f7);
}

.modal.info .modal-title i {
    color: #4a90a4;
}

.modal.confirm .modal-header {
    background: linear-gradient(135deg, #f8fafc, #edf2f7);
}

.modal.confirm .modal-title i {
    color: #1a365d;
}

/* ========== PAGE LOADER STYLES ========== */
.loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    backdrop-filter: blur(2px);
}

.loading svg {
    margin-bottom: 16px;
}

.loading svg polyline {
    fill: none;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.loading svg polyline#back {
    fill: none;
    stroke: rgba(26, 54, 93, 0.2);
}

.loading svg polyline#front {
    fill: none;
    stroke: #1a365d;
    stroke-dasharray: 48, 144;
    stroke-dashoffset: 192;
    animation: dash_682 1.4s linear infinite;
}

@keyframes dash_682 {
    72.5% {
        opacity: 0;
    }
    to {
        stroke-dashoffset: 0;
    }
}

.loading-text {
    margin-top: 16px;
    color: #1a365d;
    font-weight: 500;
    font-size: 1rem;
    text-align: center;
    font-family: 'Inter', sans-serif;
}

/* ========== MOBILE RESPONSIVE ========== */
@media (max-width: 768px) {
    .modal {
        max-width: 95%;
        margin: 20px;
    }
    
    .modal-header {
        padding: 20px 20px 12px;
    }
    
    .modal-title {
        font-size: 1.1rem;
    }
    
    .modal-body {
        padding: 20px;
    }
    
    .modal-actions {
        padding: 12px 20px 20px;
        flex-direction: column;
    }
    
    .modal-btn {
        width: 100%;
        margin-bottom: 8px;
    }
    
    .modal-detail-row {
        flex-direction: column;
        gap: 4px;
    }
    
    .modal-detail-value {
        text-align: left;
        font-weight: 500;
    }
}

@media (max-width: 480px) {
    .modal {
        max-width: 98%;
        margin: 10px;
    }
    
    .modal-header {
        padding: 16px 16px 12px;
    }
    
    .modal-title {
        font-size: 1rem;
        gap: 8px;
    }
    
    .modal-title i {
        font-size: 1rem;
    }
    
    .modal-body {
        padding: 16px;
    }
    
    .modal-text {
        font-size: 0.95rem;
    }
    
    .modal-actions {
        padding: 12px 16px 16px;
    }
    
    .modal-btn {
        padding: 14px 16px;
        font-size: 0.9rem;
    }
    
    .modal-close {
        width: 28px;
        height: 28px;
        font-size: 1rem;
    }
} 