/* css/appointment.css */
/* Appointment Page Specific Styles */

/* Page Header with Floating Elements */
.appointment-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: var(--white);
    padding: 6rem 0 4rem;
    margin-top: 70px;
    position: relative;
    overflow: hidden;
}

.appointment-header .page-header-content {
    position: relative;
    z-index: 2;
}

.header-appointment {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.appointment-wave {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100px;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 120" preserveAspectRatio="none"><path fill="rgba(255,255,255,0.1)" d="M0,0V46.29c47.79,22.2,103.59,32.17,158,28,70.36-5.37,136.33-33.31,206.8-37.5C438.64,32.43,512.34,53.67,583,72.05c69.27,18,138.3,24.88,209.4,13.08,36.15-6,69.85-17.84,104.45-29.34C989.49,25,1113-14.29,1200,52.47V0Z" opacity=".25"></path></svg>');
    animation: waveFloat 10s ease-in-out infinite;
}

.floating-calendar,
.floating-clock,
.floating-stethoscope {
    position: absolute;
    font-size: 2.5rem;
    color: rgba(255, 255, 255, 0.4);
    animation: floatAppointment 8s ease-in-out infinite;
}

.floating-calendar {
    top: 20%;
    left: 10%;
    animation-delay: 0s;
}

.floating-clock {
    top: 60%;
    right: 15%;
    animation-delay: 2s;
}

.floating-stethoscope {
    bottom: 30%;
    left: 20%;
    animation-delay: 4s;
}

@keyframes floatAppointment {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg);
    }
    25% {
        transform: translate(15px, -15px) rotate(90deg);
    }
    50% {
        transform: translate(-10px, 10px) rotate(180deg);
    }
    75% {
        transform: translate(12px, -8px) rotate(270deg);
    }
}

/* Appointment Process Section */
.appointment-process {
    padding: 4rem 0;
    background: var(--light);
}

.process-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.process-step {
    background: var(--white);
    padding: 3rem 2rem;
    border-radius: 20px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

.process-step::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--gradient);
    transition: left 0.4s ease;
    z-index: 1;
}

.process-step:hover::before {
    left: 0;
}

.process-step > * {
    position: relative;
    z-index: 2;
    transition: all 0.3s ease;
}

.process-step:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
    color: var(--white);
}

.step-number {
    position: absolute;
    top: 1rem;
    left: 1rem;
    font-size: 3rem;
    font-weight: 700;
    color: rgba(13, 71, 161, 0.1);
    transition: all 0.3s ease;
}

.process-step:hover .step-number {
    color: rgba(255, 255, 255, 0.3);
}

.step-icon {
    width: 80px;
    height: 80px;
    background: var(--gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    transition: all 0.3s ease;
}

.process-step:hover .step-icon {
    background: var(--white);
    transform: scale(1.1) rotate(5deg);
}

.step-icon i {
    font-size: 2rem;
    color: var(--white);
    transition: color 0.3s ease;
}

.process-step:hover .step-icon i {
    color: var(--primary);
}

.process-step h3 {
    margin-bottom: 1rem;
    font-size: 1.4rem;
    transition: color 0.3s ease;
}

.process-step p {
    color: var(--gray);
    line-height: 1.6;
    transition: color 0.3s ease;
}

.process-step:hover p {
    color: rgba(255, 255, 255, 0.9);
}

/* Appointment Main Section */
.appointment-main {
    padding: 5rem 0;
    background: var(--white);
}

.appointment-content {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 4rem;
}

/* Appointment Form Styles */
.appointment-form-section {
    background: var(--light);
    padding: 3rem;
    border-radius: 20px;
    box-shadow: var(--shadow);
}

.form-header {
    margin-bottom: 2rem;
    text-align: center;
}

.form-header h2 {
    font-size: 2rem;
    color: var(--dark);
    margin-bottom: 0.5rem;
}

.form-header p {
    color: var(--gray);
    font-size: 1.1rem;
}

.appointment-form {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.form-section {
    background: var(--white);
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.form-section .section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.3rem;
    color: var(--primary);
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-light);
}

.form-section .section-title i {
    font-size: 1.1rem;
}

.form-group {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-group .input-group {
    flex: 1;
    position: relative;
}

.form-group .input-group.full-width {
    flex: 1 1 100%;
}

.input-group {
    position: relative;
    margin-bottom: 1.5rem;
}

.input-group:last-child {
    margin-bottom: 0;
}

.input-group input,
.input-group select,
.input-group textarea {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    font-size: 1rem;
    background: var(--white);
    transition: all 0.3s ease;
    font-family: inherit;
}

.input-group textarea {
    resize: vertical;
    min-height: 100px;
    padding-top: 1.5rem;
}

.input-group label {
    position: absolute;
    top: 0.5rem;
    left: 3rem;
    color: var(--gray);
    font-size: 1rem;
    pointer-events: none;
    transition: all 0.3s ease;
    background: var(--white);
    padding: 0 0.5rem;
}

.input-group input:focus,
.input-group select:focus,
.input-group textarea:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(13, 71, 161, 0.1);
}

.input-group input:focus + label,
.input-group select:focus + label,
.input-group textarea:focus + label,
.input-group input:not(:placeholder-shown) + label,
.input-group select:not([value=""]) + label,
.input-group textarea:not(:placeholder-shown) + label {
    top: -0.5rem;
    left: 1rem;
    font-size: 0.8rem;
    color: var(--primary);
    font-weight: 600;
}

.input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray);
    transition: all 0.3s ease;
}

.input-group:focus-within .input-icon {
    color: var(--primary);
}

.input-group textarea ~ .input-icon {
    top: 1.5rem;
    transform: none;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.checkbox-group:last-child {
    margin-bottom: 0;
}

.checkbox-group input[type="checkbox"] {
    accent-color: var(--primary);
}

.checkbox-group label {
    font-size: 0.9rem;
    color: var(--gray);
    cursor: pointer;
    margin: 0;
}

.form-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 2rem;
}

.form-footer {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.form-footer p {
    font-size: 0.9rem;
    color: var(--gray);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
}

/* Appointment Info Sidebar */
.appointment-info-section {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.info-card {
    background: var(--white);
    border-radius: 15px;
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: all 0.3s ease;
}

.info-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.card-header {
    background: var(--gradient);
    color: var(--white);
    padding: 1.5rem 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.card-header i {
    font-size: 1.5rem;
}

.card-header h3 {
    margin: 0;
    font-size: 1.2rem;
}

.card-content {
    padding: 2rem;
}

.contact-methods {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.contact-method {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(13, 71, 161, 0.05);
    border-radius: 10px;
    transition: all 0.3s ease;
}

.contact-method:hover {
    background: rgba(13, 71, 161, 0.1);
    transform: translateX(5px);
}

.contact-method i {
    color: var(--primary);
    font-size: 1.2rem;
    width: 20px;
    text-align: center;
}

.contact-method strong {
    display: block;
    color: var(--dark);
    font-size: 0.9rem;
}

.contact-method a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.contact-method a:hover {
    color: var(--primary-dark);
}

.hours-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.hour-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.hour-item:last-child {
    border-bottom: none;
}

.hour-item span:first-child {
    color: var(--dark);
    font-weight: 500;
}

.hour-item span:last-child {
    color: var(--primary);
    font-weight: 600;
}

.tips-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.tips-list li {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem 0;
}

.tips-list i {
    color: var(--success);
    font-size: 0.9rem;
}

.tips-list span {
    color: var(--gray);
    font-size: 0.9rem;
}

.emergency-alert {
    background: linear-gradient(135deg, var(--danger) 0%, #c82333 100%);
    color: var(--white);
    padding: 2rem;
    border-radius: 15px;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    box-shadow: var(--shadow);
}

.alert-icon {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    backdrop-filter: blur(10px);
}

.alert-icon i {
    font-size: 1.5rem;
}

.alert-content {
    flex: 1;
}

.alert-content h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.3rem;
}

.alert-content p {
    margin: 0 0 1rem 0;
    opacity: 0.9;
}

/* FAQ Section */
.appointment-faq {
    padding: 5rem 0;
    background: var(--light);
}

.faq-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.faq-item {
    background: var(--white);
    border-radius: 15px;
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.faq-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.faq-question {
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.faq-question:hover {
    background: rgba(13, 71, 161, 0.05);
}

.faq-question h3 {
    margin: 0;
    color: var(--dark);
    font-size: 1.1rem;
    flex: 1;
}

.faq-question i {
    color: var(--primary);
    transition: transform 0.3s ease;
}

.faq-item.active .faq-question i {
    transform: rotate(180deg);
}

.faq-answer {
    padding: 0 2rem;
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s ease;
}

.faq-item.active .faq-answer {
    padding: 0 2rem 1.5rem;
    max-height: 200px;
}

.faq-answer p {
    color: var(--gray);
    line-height: 1.6;
    margin: 0;
}

.faq-cta {
    text-align: center;
    padding: 2rem;
    background: var(--white);
    border-radius: 15px;
    box-shadow: var(--shadow);
}

.faq-cta p {
    margin: 0;
    color: var(--gray);
    font-size: 1.1rem;
}

.faq-cta a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.faq-cta a:hover {
    text-decoration: underline;
}

/* Success Modal Enhancements */
.appointment-details {
    background: rgba(13, 71, 161, 0.05);
    padding: 1.5rem;
    border-radius: 10px;
    margin: 1.5rem 0;
    text-align: left;
}

.appointment-details h4 {
    color: var(--primary);
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.appointment-details .detail-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(13, 71, 161, 0.1);
}

.appointment-details .detail-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.appointment-details .detail-item strong {
    color: var(--dark);
}

.appointment-details .detail-item span {
    color: var(--gray);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .appointment-header {
        padding: 5rem 0 3rem;
    }
    
    .process-steps {
        grid-template-columns: 1fr;
    }
    
    .appointment-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .form-group {
        flex-direction: column;
        gap: 0;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .emergency-alert {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .faq-grid {
        grid-template-columns: 1fr;
    }
    
    .appointment-form-section {
        padding: 2rem;
    }
    
    .form-section {
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .appointment-form-section,
    .card-content {
        padding: 1.5rem;
    }
    
    .modal-content {
        padding: 2rem 1.5rem;
    }
    
    .modal-actions {
        flex-direction: column;
    }
    
    .form-header h2 {
        font-size: 1.5rem;
    }
    
    .process-step {
        padding: 2rem 1.5rem;
    }
}

/* Focus States for Accessibility */
.process-step:focus,
.faq-question:focus,
.info-card:focus,
.input-group input:focus,
.input-group select:focus,
.input-group textarea:focus {
    outline: 3px solid var(--primary-light);
    outline-offset: 2px;
}

/* Loading States */
.btn-loading {
    position: relative;
    pointer-events: none;
}

.btn-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Success Modal Styles - FIXED POSITIONING */
.success-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    box-sizing: border-box;
}

.success-modal.active {
    display: flex;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}

.modal-content {
    position: relative;
    background: white;
    border-radius: 20px;
    padding: 2.5rem;
    max-width: 550px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 10000;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-60px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-body {
    text-align: center;
    position: relative;
}

.success-icon {
    font-size: 4.5rem;
    color: var(--success, #28a745);
    margin-bottom: 1.5rem;
    animation: successBounce 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes successBounce {
    0% {
        opacity: 0;
        transform: scale(0.3) rotate(-180deg);
    }
    50% {
        transform: scale(1.2) rotate(10deg);
    }
    70% {
        transform: scale(0.9) rotate(-5deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

.modal-body h3 {
    color: var(--primary);
    margin-bottom: 1rem;
    font-size: 1.8rem;
    font-weight: 700;
}

.modal-body p {
    color: var(--gray);
    margin-bottom: 2rem;
    line-height: 1.6;
    font-size: 1.1rem;
}

.appointment-details {
    background: linear-gradient(135deg, rgba(13, 71, 161, 0.05) 0%, rgba(13, 71, 161, 0.02) 100%);
    padding: 2rem;
    border-radius: 15px;
    margin: 2rem 0;
    text-align: left;
    border-left: 4px solid var(--primary);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.appointment-details h4 {
    color: var(--primary);
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
    font-weight: 600;
    text-align: center;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 0;
    border-bottom: 1px solid rgba(13, 71, 161, 0.1);
    transition: all 0.3s ease;
}

.detail-item:hover {
    background: rgba(13, 71, 161, 0.03);
    margin: 0 -0.5rem;
    padding: 0.8rem 0.5rem;
    border-radius: 8px;
}

.detail-item:last-child {
    border-bottom: none;
}

.detail-item strong {
    color: var(--dark);
    font-weight: 600;
    font-size: 0.95rem;
}

.detail-item span {
    color: var(--gray);
    text-align: right;
    font-weight: 500;
    font-size: 0.9rem;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.modal-actions .btn {
    min-width: 140px;
    padding: 0.875rem 2rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.modal-actions .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

#modalClose {
    background: var(--primary);
    border: 2px solid var(--primary);
}

#modalClose:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

.confirmation-note {
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.1) 0%, rgba(40, 167, 69, 0.05) 100%);
    padding: 1.25rem;
    border-radius: 12px;
    margin-top: 1.5rem;
    border-left: 4px solid var(--success, #28a745);
}

.confirmation-note p {
    margin: 0;
    color: var(--success-dark, #1e7e34);
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    font-weight: 500;
}

.confirmation-note i {
    color: var(--success, #28a745);
    font-size: 1.1rem;
}

/* Close button hover effects */
#modalClose:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(13, 71, 161, 0.3);
}

/* Modal responsive design */
@media (max-width: 768px) {
    .success-modal {
        padding: 0.5rem;
    }
    
    .modal-content {
        padding: 2rem 1.5rem;
        max-height: 90vh;
    }
    
    .modal-body h3 {
        font-size: 1.5rem;
    }
    
    .modal-body p {
        font-size: 1rem;
    }
    
    .appointment-details {
        padding: 1.5rem;
    }
    
    .detail-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.3rem;
    }
    
    .detail-item span {
        text-align: left;
        width: 100%;
    }
    
    .modal-actions {
        flex-direction: column;
    }
    
    .modal-actions .btn {
        width: 100%;
        min-width: auto;
    }
    
    .success-icon {
        font-size: 3.5rem;
    }
}

@media (max-width: 480px) {
    .modal-content {
        padding: 1.5rem;
        border-radius: 15px;
    }
    
    .modal-body h3 {
        font-size: 1.3rem;
    }
    
    .appointment-details {
        padding: 1.25rem;
    }
    
    .appointment-details h4 {
        font-size: 1.1rem;
    }
    
    .confirmation-note p {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
}

/* Modal focus states for accessibility */
.modal-content:focus {
    outline: 3px solid var(--primary-light);
    outline-offset: 2px;
}

#modalClose:focus {
    outline: 3px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
}

/* Smooth scrolling for modal content */
.modal-content {
    scrollbar-width: thin;
    scrollbar-color: var(--primary-light) transparent;
}

.modal-content::-webkit-scrollbar {
    width: 6px;
}

.modal-content::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 3px;
}

.modal-content::-webkit-scrollbar-thumb {
    background: var(--primary-light);
    border-radius: 3px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* Loading state for modal actions */
.modal-actions .btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* Print styles for appointment confirmation */
@media print {
    .success-modal {
        position: static;
        display: block !important;
    }
    
    .modal-overlay {
        display: none;
    }
    
    .modal-content {
        box-shadow: none;
        border: 2px solid #000;
    }
    
    .modal-actions {
        display: none;
    }
}