* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden; /* Prevent horizontal scroll */
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

/* Header Styles */
header {
    background: #2c3e50;
    color: white;
    padding: 15px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000; /* Increased z-index */
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    z-index: 1001; /* Above mobile menu */
}

.logo i {
    font-size: 2rem;
    color: #3498db;
}

.logo h1 {
    font-size: 1.8rem;
    font-weight: 700;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 25px;
    align-items: center;
}

/* Auth Buttons in Nav */
.auth-btn {
    background: #3498db;
    padding: 12px 25px;
    border-radius: 25px;
    font-size: 0.95rem;
    border: 2px solid #3498db;
    cursor: pointer;
    white-space: nowrap;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.auth-btn:hover {
    background: transparent;
    color: #3498db !important;
}

.user-profile {
    display: none;
    align-items: center;
    gap: 15px;
}

.user-name {
    font-weight: 600;
    color: #ecf0f1;
}

/* Profile Dropdown Styles */
.profile-dropdown {
    position: relative;
    display: inline-block;
}

.profile-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    background: none;
    border: none;
    color: #ecf0f1;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 8px;
    transition: background-color 0.3s ease;
    font-size: 0.95rem;
}

.profile-btn:hover,
.profile-btn[aria-expanded="true"] {
    background-color: rgba(255, 255, 255, 0.1);
}

.profile-btn .user-name {
    font-weight: 600;
    color: #ecf0f1;
    margin: 0;
}

.profile-btn i.fa-user-circle {
    font-size: 1.2rem;
    color: #3498db;
}

.dropdown-icon {
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

.profile-btn[aria-expanded="true"] .dropdown-icon {
    transform: rotate(180deg);
}

.profile-menu {
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 180px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    border: 1px solid #e9ecef;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    margin-top: 8px;
}

.profile-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.profile-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px 16px;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    color: #2c3e50;
    font-size: 0.95rem;
    font-weight: 500;
    transition: background-color 0.3s ease;
    border-radius: 6px;
    margin: 4px 8px;
}

.profile-menu-item:hover {
    background-color: #f8f9fa;
    color: #e74c3c;
}

.profile-menu-item.logout-btn:hover {
    background-color: #ffeaea;
    color: #e74c3c;
}

.profile-menu-item i {
    font-size: 1rem;
    width: 16px;
    text-align: center;
}

/* Mobile Profile Dropdown */
@media (max-width: 768px) {
    .profile-menu {
        right: -10px;
        min-width: 200px;
    }

    .profile-btn {
        padding: 10px 15px;
    }

    .profile-menu-item {
        padding: 14px 18px;
        font-size: 1rem;
    }
}


.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.8rem;
    cursor: pointer;
    z-index: 1001;
}

/* Hero Section */
.hero {
    position: relative;
    background: linear-gradient(rgba(44, 62, 80, 0.9), rgba(52, 152, 219, 0.8));
    color: white;
    padding: 120px 0;
    text-align: center;
    margin-top: -1px; /* Fix gap */
    contain: layout style paint;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.hero-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    filter: brightness(0.7);
}

.hero h2 {
    font-size: 3rem;
    margin-bottom: 25px;
    line-height: 1.2;
}

.hero p {
    font-size: 1.3rem;
    max-width: 700px;
    margin: 0 auto 40px;
    opacity: 0.9;
}






.btn {
    display: inline-block;
    background: #3498db;
    color: white;
    padding: 15px 35px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.4);
}

.btn:hover {
    background: #2980b9;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(52, 152, 219, 0.6);
}

/* Services Section */
.services {
    padding: 80px 0;
}

.section-title {
    text-align: center;
    margin-bottom: 50px;
}

.section-title h2 {
    font-size: 2.5rem;
    color: #2c3e50;
    margin-bottom: 15px;
}

.section-title p {
    color: #7f8c8d;
    max-width: 600px;
    margin: 0 auto;
    font-size: 1.1rem;
}

/* Responsive Grid System Update */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.service-card {
    background: white;
    border-radius: 15px;
    padding: 40px 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    text-align: center;
}

.service-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

.service-card {
    will-change: transform;
    contain: layout style paint;
}

.service-card i {
    font-size: 3.5rem;
    color: #3498db;
    margin-bottom: 25px;
}

.service-card h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: #2c3e50;
}

/* Doctors Section */
.doctors {
    padding: 80px 0;
    background: #f8f9fa;
}

.doctors-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.doctor-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    transition: transform 0.3s;
    display: flex;
    flex-direction: column;
}

.doctor-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

.doctor-card {
    will-change: transform;
    contain: layout style paint;
}

.doctor-image img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    border-radius: 8px 8px 0 0;
}

.doctor-info {
    padding: 25px;
    text-align: center;
    flex-grow: 1; /* Pushes button to bottom if needed */
}

.doctor-info h3 {
    font-size: 1.4rem;
    margin-bottom: 8px;
    color: #2c3e50;
}

.doctor-info p {
    color: #3498db;
    font-weight: 500;
    margin-bottom: 20px;
}

.doctor-info .btn {
    padding: 10px 20px;
    font-size: 0.9rem;
}

.doctor-info .rating i {
    color: gold;
}

/* Gallery Section */
.gallery {
    padding: 80px 0;
    background: linear-gradient(135deg, #7ed6a5 0%, #5cb85c 100%);
    color: white;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.gallery-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    transition: transform 0.3s;
    display: flex;
    flex-direction: column;
}

.gallery-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

.gallery-card {
    will-change: transform;
    contain: layout style paint;
}

.gallery-image img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    border-radius: 8px 8px 0 0;
}

.gallery-info {
    padding: 25px;
    text-align: center;
    flex-grow: 1;
}

.gallery-info h4 {
    font-size: 1.4rem;
    margin-bottom: 15px;
    color: #2c3e50;
}

.gallery-info .description {
    color: #7f8c8d;
    font-size: 0.95rem;
    line-height: 1.5;
}

.gallery-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
    transition: transform 0.3s;
}

.gallery-card-link:hover {
    text-decoration: none;
    color: inherit;
    transform: translateY(-5px);
}

/* Gallery Detail Page */
.gallery-detail {
    padding: 80px 0;
    background: #f8f9fa;
}

.gallery-detail-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.gallery-detail-image img {
    width: 100%;
    height: auto;
    display: block;
}

.gallery-detail-content {
    padding: 40px;
}

.gallery-title {
    font-size: 2.5rem;
    color: #2c3e50;
    margin-bottom: 20px;
    font-weight: 700;
}

.gallery-description p {
    font-size: 1.1rem;
    line-height: 1.6;
    color: #555;
    margin-bottom: 30px;
}

.gallery-meta {
    border-top: 1px solid #eee;
    padding-top: 20px;
}

.gallery-date {
    color: #7f8c8d;
    font-size: 0.95rem;
}

.gallery-date i {
    margin-right: 8px;
    color: #3498db;
}

.gallery-navigation {
    text-align: center;
}

.gallery-navigation .btn {
    margin: 0 10px;
}

/* Appointment Section */
.appointment {
    position: relative;
    padding: 80px 0;
    background: linear-gradient(rgba(52, 152, 219, 0.9), rgba(41, 128, 185, 0.8));
    color: white;
    contain: layout style paint;
    overflow: hidden;
}

.appointment-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.appointment-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    filter: brightness(0.7);
}

.appointment-full {
    min-height: 100vh;
    background: linear-gradient(rgba(52, 152, 219, 0.9), rgba(41, 128, 185, 0.8)), url('https://images.unsplash.com/photo-1538108149393-fbbd81895907?ixlib=rb-4.0.3&auto=format&fit=crop&w=1950&q=80') center/cover;
    background-attachment: fixed;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 0; /* Add padding to prevent footer overlap */
}

.appointment-form {
    max-width: 650px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.15);
    padding: 45px;
    border-radius: 15px;
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255,255,255,0.3);
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    font-size: 1rem;
}

.form-control {
    width: 100%;
    padding: 15px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    background: rgba(255,255,255,0.95);
    transition: outline 0.2s;
}

.form-control:focus {
    outline: 3px solid #f1c40f; /* High visibility focus */
    outline-offset: 2px;
}

/* Form validation styles */
.form-control.is-invalid {
    border-color: #dc3545;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%23dc3545' viewBox='0 0 12 12'%3e%3cpath d='M6 6L1 1M6 6L11 1M6 6L6 11'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

.form-control.is-valid {
    border-color: #28a745;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%2328a745' viewBox='0 0 12 12'%3e%3cpath d='M1 6L5 10L11 1'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

.error-message {
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    font-weight: 500;
}

.error-message:not(.sr-only) {
    display: block;
}

.form-group.has-error .form-control {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

.form-group.has-success .form-control {
    border-color: #28a745;
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25);
}

/* Loading spinner for buttons */
.btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    position: relative;
}

.btn:disabled .btn-text {
    opacity: 0;
}

.btn:disabled .loading-spinner {
    display: inline-block !important;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

.btn:disabled .loading-spinner::after {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid #ffffff;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Lazy loading styles */
.lazy {
    background-color: #f0f0f0;
    background-image: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

.lazy.loaded {
    background-image: none;
    animation: none;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Footer */
footer {
    background: #2c3e50;
    color: white;
    padding: 70px 0 30px;
    margin-top: auto;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-col h3 {
    font-size: 1.4rem;
    margin-bottom: 25px;
    position: relative;
    padding-bottom: 10px;
}

.footer-col h3::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 60px;
    height: 3px;
    background: #3498db;
}

/* Social Links */
.social-links {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: #bdc3c7;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.social-link:hover {
    background: #3498db;
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.4);
}

.social-link i {
    font-size: 1.2rem;
}

/* Mobile-friendly social links */
@media (max-width: 768px) {
    .social-links {
        justify-content: center;
        gap: 20px;
        margin-top: 25px;
    }

    .social-link {
        width: 50px;
        height: 50px;
        border: 2px solid rgba(255, 255, 255, 0.3);
    }

    .social-link i {
        font-size: 1.4rem;
    }

    .social-link:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 20px rgba(52, 152, 219, 0.5);
    }
}

@media (max-width: 480px) {
    .social-links {
        gap: 15px;
        margin-top: 20px;
    }

    .social-link {
        width: 45px;
        height: 45px;
    }

    .social-link i {
        font-size: 1.3rem;
    }
}

.footer-col ul {
    list-style: none;
}

.footer-col ul li {
    margin-bottom: 12px;
}

.footer-col ul li a {
    color: #ecf0f1;
    text-decoration: none;
    transition: color 0.3s;
    display: inline-block;
}

.footer-col ul li a:hover {
    color: #3498db;
    transform: translateX(5px);
}

.copyright {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid #34495e;
    font-size: 0.95rem;
    color: #bdc3c7;
}

/* --- AUTH PAGE STYLES --- */
.auth-page-container {
    display: none;
    min-height: 80vh;
    align-items: center;
    justify-content: center;
    background: linear-gradient(rgba(44, 62, 80, 0.6), rgba(52, 152, 219, 0.6)), url('https://images.unsplash.com/photo-1519494026892-80bbd2d6fd0d?ixlib=rb-4.0.3&auto=format&fit=crop&w=1950&q=80') center/cover;
    padding: 40px 20px;
}

.auth-card {
    background: white;
    border-radius: 15px;
    width: 100%;
    max-width: 480px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.25);
}

.auth-tabs {
    display: flex;
    margin-bottom: 30px;
    border-radius: 8px;
    overflow: hidden;
    background: #f8f9fa;
}

.auth-tab {
    flex: 1;
    padding: 12px;
    border: none;
    background: #e9ecef;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.3s;
}

.auth-tab.active {
    background: #3498db;
    color: white;
}

.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
}

.auth-btn-submit {
    width: 100%;
    padding: 15px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.3s;
}

.auth-btn-submit:hover {
    background: #2980b9;
}

/* Skip Links for Accessibility */
.skip-link {
    position: absolute;
    left: -9999px;
    z-index: 999999;
    padding: 8px 16px;
    background: #2980b9;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    border: 2px solid #1f5f99;
}

.skip-link:focus {
    left: 6px;
    top: 7px;
    outline: 3px solid #f1c40f;
    outline-offset: 2px;
}

/* Screen Reader Only Content */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Enhanced focus styles for accessibility */
.auth-btn:focus,
.btn:focus,
.mobile-menu-btn:focus,
.social-link:focus,
.form-control:focus,
select:focus,
textarea:focus,
input[type="date"]:focus,
input[type="time"]:focus {
    outline: 3px solid #3498db;
    outline-offset: 2px;
    box-shadow: 0 0 0 1px #fff, 0 0 0 4px #3498db;
}

/* Focus styles for interactive cards */
.service-card:focus,
.doctor-card:focus,
.gallery-card:focus,
.dashboard-doctor-card:focus,
.appointment-card:focus,
.dashboard-service-card:focus {
    outline: 3px solid #3498db;
    outline-offset: 2px;
    box-shadow: 0 0 0 1px #fff, 0 0 0 4px #3498db;
    transform: translateY(-2px);
}

/* Focus styles for navigation links */
.nav-links a:focus,
.footer-col ul li a:focus {
    outline: 3px solid #3498db;
    outline-offset: 2px;
    background-color: rgba(52, 152, 219, 0.1);
    border-radius: 4px;
}

/* Skip link focus styles */
.skip-link:focus {
    position: static;
    left: auto;
    top: auto;
    width: auto;
    height: auto;
    padding: 8px 16px;
    background: #3498db;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    z-index: 999999;
    font-weight: bold;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

/* Focus within for form groups */
.form-group:focus-within {
    position: relative;
}

.form-group:focus-within::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border: 2px solid #3498db;
    border-radius: 6px;
    z-index: 1;
    pointer-events: none;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .hero {
        background: linear-gradient(rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.8)), url('https://images.unsplash.com/photo-1576091160550-2173dba999ef?ixlib=rb-4.0.3&auto=format&fit=crop&w=1950&q=80') center/cover;
    }

    .btn {
        border: 2px solid currentColor;
    }

    .service-card,
    .doctor-card,
    .gallery-card,
    .dashboard-doctor-card,
    .appointment-card,
    .dashboard-service-card {
        border: 2px solid currentColor;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Better color contrast for text */
.section-title h2 {
    color: #2c3e50;
}

.section-title p {
    color: #2c3e50;
}

/* Required field indicators */
.required {
    color: #dc3545;
    font-weight: bold;
}

/* Improve color contrast for better accessibility */
.btn {
    background: #2980b9; /* Darker blue for better contrast */
    color: #ffffff;
}

.btn:hover {
    background: #1f5f99; /* Even darker for hover */
}

.auth-btn {
    background: #2980b9; /* Consistent with btn */
    color: #ffffff;
}

.auth-btn:hover {
    background: #1f5f99;
}

/* Better contrast for links */
.nav-links a:hover {
    color: #ffffff;
}

.footer-col ul li a:hover {
    color: #3498db;
}

/* Improve focus visibility */
.btn:focus,
.auth-btn:focus,
.form-control:focus {
    outline: 3px solid #f1c40f;
    outline-offset: 2px;
    box-shadow: 0 0 0 1px #fff, 0 0 0 4px #2980b9;
}

/* Ensure sufficient color contrast for links */
.nav-links a:hover,
.footer-col ul li a:hover {
    text-decoration: underline;
}

.form-control:focus {
    outline: 3px solid #f1c40f;
}

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {
    .service-card,
    .doctor-card,
    .gallery-card,
    .dashboard-doctor-card,
    .appointment-card,
    .dashboard-service-card {
        transition: transform 0.2s ease;
    }

    .service-card:active,
    .doctor-card:active,
    .gallery-card:active,
    .dashboard-doctor-card:active,
    .appointment-card:active,
    .dashboard-service-card:active {
        transform: scale(0.98);
    }
}

/* Mobile-specific optimizations */
@media (max-width: 768px) {
    /* Improve touch targets */
    .btn, .auth-btn, .mobile-menu-btn {
        min-height: 48px;
        min-width: 48px;
        padding: 12px 16px;
    }

    /* Better spacing for mobile */
    .container {
        padding: 0 15px;
    }

    /* Optimize hero section for mobile */
    .hero {
        padding: 60px 0;
        text-align: center;
    }

    .hero h2 {
        font-size: 2rem;
        line-height: 1.3;
    }

    .hero p {
        font-size: 1rem;
        margin-bottom: 30px;
    }

    /* Improve form inputs for mobile */
    .form-control {
        font-size: 16px; /* Prevent zoom on iOS */
        padding: 12px 16px;
        min-height: 48px;
    }

    /* Better modal handling on mobile */
    .modal-dialog {
        margin: 10px;
        max-width: calc(100vw - 20px);
    }

    /* Optimize navigation buttons */
    .gallery-navigation .btn {
        width: 100%;
        margin: 5px 0;
    }

    /* Improve card layouts */
    .service-card,
    .doctor-card,
    .gallery-card {
        margin-bottom: 20px;
    }
}

/* Extra small mobile optimizations */
@media (max-width: 480px) {
    .hero h2 {
        font-size: 1.75rem;
    }

    .section-title h2 {
        font-size: 1.5rem;
    }

    .btn {
        font-size: 0.9rem;
        padding: 10px 20px;
    }

    /* Stack navigation buttons vertically */
    .gallery-navigation {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    /* Improve footer layout */
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .footer-col h3::after {
        display: none; /* Hide decorative lines on very small screens */
    }
}

/* --- RESPONSIVE MEDIA QUERIES --- */

/* Tablet & Mobile (Up to 768px) */
@media (max-width: 768px) {
    .mobile-menu-btn {
        display: block;
    }

    /* Mobile menu overlay */
    .mobile-menu-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.5);
        z-index: 999;
        transition: opacity 0.3s ease;
    }

    .mobile-menu-overlay.active {
        display: block;
    }

    .nav-links {
        display: none;
        flex-direction: column;
        position: fixed;
        top: 0;
        right: 0; /* Slide from right */
        width: 280px; /* Side drawer width */
        height: 100vh;
        background: #2c3e50;
        padding: 80px 20px 20px;
        text-align: center;
        z-index: 1000;
        overflow-y: auto;
        transform: translateX(100%); /* Hidden by default */
        transition: transform 0.3s ease;
        box-shadow: -2px 0 10px rgba(0,0,0,0.3);
    }

    .nav-links.active {
        display: flex;
        transform: translateX(0); /* Show drawer */
    }

    .nav-links.active {
        display: flex;
    }

    .nav-links li {
        width: 100%;
        margin: 10px 0;
    }

    .nav-links a {
        font-size: 1.2rem;
        display: block;
        padding: 10px;
    }

    .auth-btn {
        display: block;
        width: 100%;
        margin-top: 10px;
    }

    .hero {
        padding: 80px 0;
    }

    .hero h2 {
        font-size: 2.2rem;
    }

    .section-title h2 {
        font-size: 2rem;
    }

    /* Horizontal scroll for services on mobile */
    .services-grid {
        display: flex;
        overflow-x: auto;
        gap: 20px;
        padding-bottom: 10px;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
    }

    .service-card {
        flex: 0 0 280px;
        scroll-snap-align: start;
    }

    /* Horizontal scroll for doctors on home page mobile */
    .home-doctors-grid {
        display: flex;
        overflow-x: auto;
        gap: 20px;
        padding-bottom: 10px;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
    }

    .home-doctors-grid .doctor-card {
        flex: 0 0 300px;
        scroll-snap-align: start;
    }

    /* Horizontal scroll for gallery on mobile */
    .gallery-grid {
        display: flex;
        overflow-x: auto;
        gap: 20px;
        padding-bottom: 10px;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
    }

    .gallery-card-link {
        flex: 0 0 280px;
        scroll-snap-align: start;
    }

    .appointment {
        background-attachment: scroll; /* Disable parallax on mobile for performance */
    }

    .footer-grid {
        text-align: center;
    }

    .footer-col h3::after {
        left: 50%;
        transform: translateX(-50%);
    }
}

/* Small Mobile (Up to 480px) */
@media (max-width: 480px) {
    .logo i {
        font-size: 1.5rem;
    }

    .logo h1 {
        font-size: 1.4rem;
    }

    .hero {
        padding: 60px 0;
    }

    .hero h2 {
        font-size: 1.8rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .btn {
        padding: 12px 25px;
        font-size: 1rem;
        width: 100%;
        text-align: center;
        min-height: 48px;
    }

    .section-title h2 {
        font-size: 1.8rem;
    }

    /* Services, doctors, gallery now use horizontal scroll on mobile */

    .appointment-form {
        padding: 25px 20px;
    }

    .auth-card {
        padding: 30px 20px;
    }

    .form-control {
        font-size: 16px; /* Prevent zoom on iOS */
        padding: 16px;
        min-height: 48px;
    }

    .notification {
        /* Keep notification visible on small screens */
    }
}

/* Toast Notifications */
.toast-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    min-width: 350px;
    max-width: 500px;
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
    color: white;
    padding: 16px 20px;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(46, 204, 113, 0.3);
    transform: translateX(400px);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 9999;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
}

.toast-notification.show {
    transform: translateX(0);
}

.toast-notification.error {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    box-shadow: 0 8px 32px rgba(231, 76, 60, 0.3);
}

.toast-notification.warning {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    box-shadow: 0 8px 32px rgba(243, 156, 18, 0.3);
}

.toast-notification.info {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    box-shadow: 0 8px 32px rgba(52, 152, 219, 0.3);
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.toast-content i {
    font-size: 1.2rem;
    flex-shrink: 0;
    opacity: 0.9;
}

.toast-content span {
    flex: 1;
    font-weight: 500;
    line-height: 1.4;
}

.toast-close {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    transition: all 0.3s ease;
    opacity: 0.7;
    flex-shrink: 0;
}

.toast-close:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.toast-close i {
    font-size: 0.8rem;
}

/* Mobile responsive toasts */
@media (max-width: 768px) {
    .toast-notification {
        left: 20px;
        right: 20px;
        min-width: auto;
        max-width: none;
        transform: translateY(-100px);
    }

    .toast-notification.show {
        transform: translateY(0);
    }
}

/* Multiple toasts stacking */
.toast-notification:nth-child(2) {
    top: 90px;
}

.toast-notification:nth-child(3) {
    top: 160px;
}

.toast-notification:nth-child(4) {
    top: 230px;
}

/* Legacy notification (keeping for compatibility) */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    left: 20px; /* Full width on mobile mostly */
    background: #2ecc71;
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.3);
    transform: translateY(-150%); /* Slide from top */
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 2000;
    text-align: center;
}

@media (min-width: 769px) {
    .notification {
        left: auto;
        width: auto;
        max-width: 400px;
        transform: translateX(150%); /* Slide from right on desktop */
    }
    .notification.show {
        transform: translateX(0);
    }
}

.notification.show {
    transform: translateY(0); /* For mobile */
}

.notification.error {
    background: #e74c3c;
}

.loading-spinner {
    text-align: center;
    padding: 20px;
    font-size: 1.2rem;
    color: #7f8c8d;
    grid-column: 1 / -1;
}

.nav-links a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
    font-size: 1.05rem;
}

.nav-links a:hover {
    color: #3498db;
}

/* --- DASHBOARD STYLES --- */

/* Dashboard Hero Section */
.dashboard-hero {
    background: linear-gradient(rgba(44, 62, 80, 0.9), rgba(52, 152, 219, 0.8)), url('https://images.unsplash.com/photo-1576091160550-2173dba999ef?ixlib=rb-4.0.3&auto=format&fit=crop&w=1950&q=80') center/cover;
    color: white;
    padding: 80px 0;
    text-align: center;
    margin-top: -1px;
}

.dashboard-hero h1 {
    font-size: 2.8rem;
    margin-bottom: 15px;
    line-height: 1.2;
}

.dashboard-hero p {
    font-size: 1.2rem;
    max-width: 600px;
    margin: 0 auto 30px;
    opacity: 0.9;
}

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 40px;
}

.stat-card {
    background: rgba(255, 255, 255, 0.15);
    padding: 25px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
    text-align: center;
}

.stat-card h3 {
    font-size: 2.5rem;
    margin-bottom: 8px;
    color: #f1c40f;
}

.stat-card p {
    font-size: 1rem;
    opacity: 0.9;
    margin: 0;
}

/* Dashboard Sections */
.dashboard-section {
    padding: 60px 0;
}

.dashboard-section:nth-child(even) {
    background: #f8f9fa;
}

.dashboard-section .section-title {
    margin-bottom: 40px;
}

/* Appointments Section */
.appointments-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
}

.appointment-card {
    background: white;
    padding: 25px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    border-left: 4px solid #3498db;
    transition: transform 0.3s, box-shadow 0.3s;
}

.appointment-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.15);
}

.appointment-card h4 {
    color: #2c3e50;
    margin-bottom: 12px;
    font-size: 1.2rem;
}

.appointment-card p {
    color: #7f8c8d;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.appointment-card .status {
    display: inline-block;
    padding: 4px 12px;
    font-size: 0.85rem;
    font-weight: 500;
    text-transform: uppercase;
}

.appointment-card .status.pending {
    background: #f39c12;
    color: white;
}

.appointment-card .status.confirmed {
    background: #27ae60;
    color: white;
}

.appointment-card .status.completed {
    background: #3498db;
    color: white;
}

.appointment-card .status.cancelled {
    background: #e74c3c;
    color: white;
}

/* Dashboard Services Grid */
.dashboard-services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
}

.dashboard-service-card {
    background: white;
    padding: 30px 20px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    text-align: center;
    cursor: pointer;
}

.dashboard-service-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.15);
}

.dashboard-service-card i {
    font-size: 3rem;
    color: #3498db;
    margin-bottom: 20px;
}

.dashboard-service-card h4 {
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 1.3rem;
}

/* Dashboard Doctors Grid */
.dashboard-doctors-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
}

.dashboard-doctor-card {
    background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08), 0 1px 8px rgba(0,0,0,0.1);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
    position: relative;
    border: 1px solid rgba(255,255,255,0.8);
}

.dashboard-doctor-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #3498db, #2980b9, #1abc9c);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.dashboard-doctor-card:hover::before {
    transform: scaleX(1);
}

.dashboard-doctor-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 25px 50px rgba(0,0,0,0.15), 0 5px 15px rgba(52, 152, 219, 0.1);
}

.dashboard-doctor-image {
    height: 220px;
    width: 100%;
    background-position: center;
    background-size: cover;
    background-color: #f1f3f4;
    position: relative;
    overflow: hidden;
}

.doctor-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    background: rgba(52, 152, 219, 0.9);
    color: white;
    padding: 15px;
    border-radius: 50%;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 2;
}

.doctor-overlay i {
    font-size: 1.5rem;
}

.dashboard-doctor-card:hover .doctor-overlay {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.dashboard-doctor-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.1) 0%, rgba(26, 188, 156, 0.1) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.dashboard-doctor-card:hover .dashboard-doctor-image::after {
    opacity: 1;
}

.dashboard-doctor-info {
    padding: 25px;
    text-align: center;
    flex-grow: 1;
    position: relative;
}

.dashboard-doctor-info h4 {
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 1.4rem;
    font-weight: 600;
    position: relative;
}

.dashboard-doctor-info h4::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #3498db, #1abc9c);
    transition: width 0.3s ease;
}

.dashboard-doctor-card:hover .dashboard-doctor-info h4::after {
    width: 60px;
}

.dashboard-doctor-info p {
    color: #3498db;
    font-weight: 600;
    margin-bottom: 18px;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dashboard-doctor-info .rating {
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2px;
}

.dashboard-doctor-info .rating i {
    color: #ffd700;
    font-size: 1.1rem;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.1));
    transition: transform 0.2s ease;
}

.dashboard-doctor-info .rating i:hover {
    transform: scale(1.2);
}

.dashboard-doctor-info .rating span {
    margin-left: 8px;
    color: #7f8c8d;
    font-weight: 500;
    font-size: 0.9rem;
}

.dashboard-doctor-card .btn {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    border: none;
    border-radius: 25px;
    padding: 12px 30px;
    font-size: 0.95rem;
    font-weight: 600;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

.dashboard-doctor-card .btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.dashboard-doctor-card .btn:hover::before {
    left: 100%;
}

.dashboard-doctor-card .btn:hover {
    background: linear-gradient(135deg, #2980b9 0%, #1f5f99 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(52, 152, 219, 0.4);
}

.dashboard-doctor-card .btn i {
    margin-right: 8px;
    font-size: 0.9rem;
}

/* Dashboard Appointment Form */
.dashboard-appointment-form {
    max-width: 600px;
    margin: 0 auto;
    background: white;
    padding: 40px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
}

.dashboard-appointment-form .form-group {
    margin-bottom: 20px;
}

.dashboard-appointment-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
}

.dashboard-appointment-form .form-control {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #ecf0f1;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.dashboard-appointment-form .form-control:focus {
    outline: none;
    border-color: #3498db;
}

.dashboard-appointment-form .btn {
    width: 100%;
    padding: 15px;
    font-size: 1.1rem;
    margin-top: 10px;
}

/* Book Appointment Modal Styles */
#bookAppointmentModal .modal-dialog {
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px) scale(0.95);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

#bookAppointmentModal .modal-backdrop {
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
}

#bookAppointmentModal .modal-content {
    border: none;
    border-radius: 25px;
    box-shadow: 0 25px 80px rgba(0,0,0,0.2), 0 0 0 1px rgba(255,255,255,0.1);
    overflow: hidden;
    background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);
}

#bookAppointmentModal .modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    padding: 30px;
    position: relative;
    overflow: hidden;
}

#bookAppointmentModal .modal-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: headerGlow 3s ease-in-out infinite alternate;
}

@keyframes headerGlow {
    0% { transform: scale(1); }
    100% { transform: scale(1.1); }
}

#bookAppointmentModal .modal-title {
    font-weight: 700;
    font-size: 1.5rem;
    color: white;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    position: relative;
    z-index: 2;
}

#bookAppointmentModal .modal-body {
    padding: 35px;
    background: white;
}

#bookAppointmentModal .text-center.mb-4 {
    margin-bottom: 30px !important;
}

#bookAppointmentModal .text-center.mb-4 i {
    font-size: 4rem;
    color: #667eea;
    margin-bottom: 15px;
    animation: iconBounce 2s ease-in-out infinite;
}

@keyframes iconBounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

#bookAppointmentModal .text-center.mb-4 h6 {
    color: #6c757d;
    font-weight: 500;
    font-size: 1rem;
}

#bookAppointmentModal .form-group {
    margin-bottom: 28px;
    position: relative;
}

#bookAppointmentModal .form-label {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    font-size: 0.95rem;
    transition: color 0.3s ease;
}

#bookAppointmentModal .form-label i {
    margin-right: 8px;
    color: #667eea;
    transition: transform 0.3s ease;
}

#bookAppointmentModal .form-group:focus-within .form-label {
    color: #667eea;
}

#bookAppointmentModal .form-group:focus-within .form-label i {
    transform: scale(1.1);
}

#bookAppointmentModal .form-control {
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 14px 18px;
    font-size: 0.95rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: #f8f9fa;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
}

#bookAppointmentModal .form-control:focus {
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1), 0 4px 12px rgba(102, 126, 234, 0.15);
    transform: translateY(-2px);
}

#bookAppointmentModal .form-control:hover {
    border-color: #bdc3c7;
    background: white;
}

#bookAppointmentModal textarea.form-control {
    resize: vertical;
    min-height: 90px;
    line-height: 1.5;
}

#bookAppointmentModal select.form-control {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 12px center;
    background-repeat: no-repeat;
    background-size: 16px;
    padding-right: 40px;
}

#bookAppointmentModal .modal-footer {
    border: none;
    padding: 30px 35px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-top: 1px solid rgba(0,0,0,0.05);
}

#bookAppointmentModal .btn {
    border-radius: 25px;
    padding: 14px 35px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    min-width: 130px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

#bookAppointmentModal .btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.6s ease;
}

#bookAppointmentModal .btn:hover::before {
    left: 100%;
}

#bookAppointmentModal .btn-secondary {
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
    color: white;
}

#bookAppointmentModal .btn-secondary:hover {
    background: linear-gradient(135deg, #5a6268 0%, #495057 100%);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(108, 117, 125, 0.3);
}

#bookAppointmentModal .btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.3);
}

#bookAppointmentModal .btn-primary:hover {
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(102, 126, 234, 0.4);
}

#bookAppointmentModal .btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1) !important;
}

/* Form row spacing */
#bookAppointmentModal .row {
    margin-bottom: 10px;
}

#bookAppointmentModal .row:last-child {
    margin-bottom: 0;
}

/* Input focus animations */
#bookAppointmentModal .form-control:focus + .form-label,
#bookAppointmentModal .form-control:focus ~ .form-label {
    color: #667eea;
}

/* Loading state */
#bookAppointmentModal .btn i.fa-spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Form validation styles */
#bookAppointmentModal .form-control.is-valid {
    border-color: #28a745;
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.1);
}

#bookAppointmentModal .form-control.is-invalid {
    border-color: #dc3545;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

#bookAppointmentModal .invalid-feedback {
    display: block;
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 5px;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Success state styling */
#bookAppointmentModal .form-control.is-valid:focus {
    border-color: #28a745;
    box-shadow: 0 0 0 4px rgba(40, 167, 69, 0.15);
}

/* Modal close button enhancement */
#bookAppointmentModal .btn-close {
    filter: brightness(0) invert(1);
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

#bookAppointmentModal .btn-close:hover {
    opacity: 1;
}

/* Floating background decorations */
.modal-background-decoration {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
}

.floating-shapes {
    position: absolute;
    width: 100%;
    height: 100%;
}

.shape {
    position: absolute;
    border-radius: 50%;
    background: linear-gradient(45deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
    animation: float 6s ease-in-out infinite;
}

.shape-1 {
    width: 80px;
    height: 80px;
    top: 10%;
    left: 10%;
    animation-delay: 0s;
}

.shape-2 {
    width: 60px;
    height: 60px;
    top: 60%;
    right: 15%;
    animation-delay: 2s;
    background: linear-gradient(45deg, rgba(40, 167, 69, 0.1), rgba(52, 152, 219, 0.1));
}

.shape-3 {
    width: 100px;
    height: 100px;
    bottom: 20%;
    left: 20%;
    animation-delay: 4s;
    background: linear-gradient(45deg, rgba(255, 193, 7, 0.1), rgba(220, 53, 69, 0.1));
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
        opacity: 0.5;
    }
    50% {
        transform: translateY(-20px) rotate(180deg);
        opacity: 0.8;
    }
}

/* Responsive enhancements */
@media (max-width: 576px) {
    #bookAppointmentModal .modal-dialog {
        margin: 10px;
        max-width: calc(100vw - 20px);
    }

    #bookAppointmentModal .modal-header,
    #bookAppointmentModal .modal-body,
    #bookAppointmentModal .modal-footer {
        padding: 20px;
    }

    #bookAppointmentModal .modal-title {
        font-size: 1.3rem;
    }

    #bookAppointmentModal .text-center.mb-4 i {
        font-size: 3rem;
    }

    #bookAppointmentModal .btn {
        width: 100%;
        margin-bottom: 10px;
    }

    .floating-shapes {
        display: none; /* Hide floating shapes on mobile for performance */
    }
}

/* Loading spinner animation */
.fa-spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive modal */
@media (max-width: 768px) {
    #bookAppointmentModal .modal-dialog {
        margin: 10px;
    }

    #bookAppointmentModal .modal-body {
        padding: 20px;
    }

    #bookAppointmentModal .modal-header,
    #bookAppointmentModal .modal-footer {
        padding: 20px;
    }

    #bookAppointmentModal .form-control {
        padding: 10px 14px;
    }
}

/* Responsive Dashboard Styles */
@media (max-width: 768px) {
    .dashboard-hero {
        padding: 60px 0;
    }

    .dashboard-hero h1 {
        font-size: 2.2rem;
    }

    .dashboard-stats {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 15px;
    }

    .stat-card {
        padding: 20px;
    }

    .stat-card h3 {
        font-size: 2rem;
    }

    .appointments-grid,
    .dashboard-services-grid,
    .dashboard-doctors-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .dashboard-doctor-card {
        margin-bottom: 10px;
    }

    .dashboard-doctor-info {
        padding: 20px;
    }

    .dashboard-doctor-info h4 {
        font-size: 1.2rem;
    }

    .dashboard-doctor-card .btn {
        padding: 10px 25px;
        font-size: 0.9rem;
    }

    .gallery-detail-content {
        padding: 30px 20px;
    }

    .gallery-title {
        font-size: 2rem;
    }

    .gallery-description p {
        font-size: 1rem;
    }

    .gallery-navigation .btn {
        display: block;
        width: 100%;
        margin: 10px 0;
    }

    .dashboard-appointment-form {
        padding: 30px 20px;
    }
}

@media (max-width: 480px) {
    .dashboard-hero h1 {
        font-size: 1.8rem;
    }

    .dashboard-section {
        padding: 40px 0;
    }

    .appointment-card,
    .dashboard-service-card,
    .dashboard-doctor-card {
        margin-bottom: 15px;
    }
}