@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;600;700&family=Roboto:wght@300;400;500;700&display=swap');

:root {
    --primary-color: #2563eb;
    --secondary-color: #10b981;
    --dark-blue: #1e40af;
    --light-blue: #dbeafe;
    --white: #ffffff;
    --light-gray: #f8fafc;
    --gray: #64748b;
    --dark-gray: #334155;
    --border-color: #e2e8f0;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.15);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    overflow-x: hidden;
    width: 100%;
}

body {
    font-family: 'Cairo', 'Roboto', sans-serif;
    line-height: 1.6;
    color: var(--dark-gray);
    background-color: var(--light-gray);
}

body[dir="ltr"] {
    font-family: 'Roboto', sans-serif;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.header {
    background: linear-gradient(135deg, var(--primary-color), var(--dark-blue));
    color: var(--white);
    padding: 1.5rem 0;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
    font-weight: 700;
}

.logo i {
    font-size: 2rem;
}

.lang-toggle {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid var(--white);
    color: var(--white);
    padding: 8px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}

.lang-toggle:hover {
    background: var(--white);
    color: var(--primary-color);
}

.appointments-btn {
    position: relative;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid var(--white);
    color: var(--white);
    padding: 8px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}

.appointments-btn:hover {
    background: var(--white);
    color: var(--primary-color);
}

.appointments-count {
    background: #ef4444;
    color: var(--white);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    position: absolute;
    top: -8px;
    right: -8px;
}

[dir="ltr"] .appointments-count {
    right: auto;
    left: -8px;
}

.hero {
    background: linear-gradient(135deg, #0ea5e9 0%, #2563eb 100%);
    color: var(--white);
    padding: 4rem 0;
    text-align: center;
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.hero-subtitle {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.search-container {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    gap: 10px;
    background: var(--white);
    padding: 8px;
    border-radius: 50px;
    box-shadow: var(--shadow-lg);
}

.search-input {
    flex: 1;
    border: none;
    padding: 12px 20px;
    font-size: 1rem;
    border-radius: 50px;
    outline: none;
    font-family: inherit;
}

.search-btn {
    background: var(--secondary-color);
    color: var(--white);
    border: none;
    padding: 12px 25px;
    border-radius: 50px;
    cursor: pointer;
    font-size: 1.1rem;
    transition: var(--transition);
}

.search-btn:hover {
    background: #059669;
    transform: scale(1.05);
}

.doctors-section {
    padding: 3rem 0;
}

.specialty-group {
    margin-bottom: 3rem;
    background: var(--white);
    border-radius: 15px;
    padding: 2rem;
    box-shadow: var(--shadow);
}

.specialty-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 3px solid var(--light-blue);
}

.specialty-icon {
    font-size: 2.5rem;
    color: var(--primary-color);
}

.specialty-title {
    font-size: 1.8rem;
    color: var(--dark-blue);
    font-weight: 700;
}

.specialty-count {
    background: var(--light-blue);
    color: var(--primary-color);
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-right: auto;
}

[dir="ltr"] .specialty-count {
    margin-right: 0;
    margin-left: auto;
}

.doctors-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.doctor-card {
    background: var(--white);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    transition: var(--transition);
    cursor: pointer;
}

.doctor-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.doctor-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 1rem;
}

.doctor-avatar {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 2rem;
    overflow: hidden;
    flex-shrink: 0;
}

.doctor-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    image-rendering: auto;
    -ms-interpolation-mode: bicubic;
    image-rendering: smooth;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    transform: translateZ(0);
}

.doctor-info h3 {
    font-size: 1.3rem;
    color: var(--dark-blue);
    margin-bottom: 5px;
}

.doctor-specialty {
    color: var(--gray);
    font-size: 0.9rem;
}

.doctor-rating {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 1rem;
}

.stars {
    color: #fbbf24;
    font-size: 1rem;
}

.rating-count {
    color: var(--gray);
    font-size: 0.85rem;
}

.doctor-schedule {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 1rem;
    padding: 1rem;
    background: var(--light-gray);
    border-radius: 8px;
}

.schedule-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--dark-gray);
}

.schedule-item i {
    color: var(--primary-color);
    width: 20px;
}

.doctor-actions {
    display: flex;
    gap: 10px;
}

.btn {
    flex: 1;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: inherit;
}

.btn-primary {
    background: var(--primary-color);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--dark-blue);
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--secondary-color);
    color: var(--white);
}

.btn-secondary:hover {
    background: #059669;
    transform: translateY(-2px);
}

.contact-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 1rem;
}

.btn-call {
    background: linear-gradient(135deg, #10b981, #059669);
    color: var(--white);
    text-decoration: none;
}

.btn-call:hover {
    background: linear-gradient(135deg, #059669, #047857);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.btn-whatsapp {
    background: linear-gradient(135deg, #25d366, #128c7e);
    color: var(--white);
    text-decoration: none;
}

.btn-whatsapp:hover {
    background: linear-gradient(135deg, #128c7e, #075e54);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
}

.price-item {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    padding: 8px 12px !important;
    border-radius: 8px;
    margin-top: 8px;
}

.price-item i {
    color: #f59e0b !important;
}

.price-item span {
    color: #92400e;
    font-weight: 600;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background-color: var(--white);
    margin: 5% auto;
    padding: 2rem;
    border-radius: 15px;
    width: 90%;
    max-width: 700px;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    animation: slideIn 0.3s;
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.close, .close-booking, .close-appointments {
    color: var(--gray);
    float: left;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    transition: var(--transition);
}

[dir="ltr"] .close,
[dir="ltr"] .close-booking,
[dir="ltr"] .close-appointments {
    float: right;
}

.close:hover,
.close-booking:hover,
.close-appointments:hover {
    color: var(--primary-color);
}

.doctor-details-header {
    text-align: center;
    margin-bottom: 2rem;
}

.doctor-details-avatar {
    width: 150px;
    height: 150px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 3rem;
    margin: 0 auto 1rem;
    overflow: hidden;
    flex-shrink: 0;
}

.doctor-details-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    image-rendering: auto;
    -ms-interpolation-mode: bicubic;
    image-rendering: smooth;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    transform: translateZ(0);
}

.doctor-details-name {
    font-size: 2rem;
    color: var(--dark-blue);
    margin-bottom: 0.5rem;
}

.doctor-details-specialty {
    color: var(--gray);
    font-size: 1.2rem;
}

.details-section {
    margin-bottom: 2rem;
}

.details-section h3 {
    color: var(--dark-blue);
    font-size: 1.3rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.details-section h3 i {
    color: var(--primary-color);
}

.reviews-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.review-card {
    background: var(--light-gray);
    padding: 1rem;
    border-radius: 10px;
    border-right: 4px solid var(--primary-color);
}

[dir="ltr"] .review-card {
    border-right: none;
    border-left: 4px solid var(--primary-color);
}

.review-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.review-author {
    font-weight: 600;
    color: var(--dark-blue);
}

.review-date {
    color: var(--gray);
    font-size: 0.85rem;
}

.review-text {
    color: var(--dark-gray);
    line-height: 1.6;
}

.add-review-form {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: var(--light-gray);
    border-radius: 10px;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--dark-blue);
    font-weight: 600;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: var(--transition);
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.star-rating {
    display: flex;
    gap: 5px;
    font-size: 1.5rem;
}

.star-rating i {
    color: #d1d5db;
    cursor: pointer;
    transition: var(--transition);
}

.star-rating i:hover,
.star-rating i.active {
    color: #fbbf24;
}

.booking-form-header {
    text-align: center;
    margin-bottom: 2rem;
}

.booking-form-header h2 {
    color: var(--dark-blue);
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

.booking-form-header p {
    color: var(--gray);
}

.success-message {
    background: #d1fae5;
    color: #065f46;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.error-message {
    background: #fee2e2;
    color: #991b1b;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.appointments-header {
    text-align: center;
    margin-bottom: 2rem;
}

.appointments-header h2 {
    color: var(--dark-blue);
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

.appointments-empty {
    text-align: center;
    padding: 3rem;
    color: var(--gray);
}

.appointments-empty i {
    font-size: 4rem;
    margin-bottom: 1rem;
    color: var(--border-color);
}

.appointment-card {
    background: var(--light-gray);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    transition: var(--transition);
}

.appointment-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow);
}

.appointment-card.upcoming {
    border-right: 4px solid var(--secondary-color);
}

[dir="ltr"] .appointment-card.upcoming {
    border-right: none;
    border-left: 4px solid var(--secondary-color);
}

.appointment-card.past {
    opacity: 0.7;
    border-right: 4px solid var(--gray);
}

[dir="ltr"] .appointment-card.past {
    border-right: none;
    border-left: 4px solid var(--gray);
}

.appointment-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.appointment-doctor {
    flex: 1;
}

.appointment-doctor h3 {
    color: var(--dark-blue);
    font-size: 1.3rem;
    margin-bottom: 0.25rem;
}

.appointment-specialty {
    color: var(--gray);
    font-size: 0.9rem;
}

.appointment-status {
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.appointment-status.upcoming {
    background: #d1fae5;
    color: #065f46;
}

.appointment-status.past {
    background: #e5e7eb;
    color: var(--gray);
}

.appointment-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.appointment-info-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--dark-gray);
}

.appointment-info-item i {
    color: var(--primary-color);
    width: 20px;
}

.appointment-actions {
    display: flex;
    gap: 10px;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.btn-small {
    padding: 6px 15px;
    font-size: 0.85rem;
    border-radius: 6px;
}

.btn-danger {
    background: #ef4444;
    color: var(--white);
}

.btn-danger:hover {
    background: #dc2626;
}

.reminder-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #fef3c7;
    color: #92400e;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    margin-top: 0.5rem;
}

.reminder-badge i {
    color: #f59e0b;
    width: auto;
}

.tabs-section {
    background: var(--white);
    border-bottom: 2px solid var(--border-color);
    padding: 1rem 0;
    position: sticky;
    top: 80px;
    z-index: 90;
}

.tabs-nav {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.tab-btn {
    background: transparent;
    border: none;
    padding: 12px 20px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray);
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: inherit;
    white-space: nowrap;
    flex: 1;
    min-width: fit-content;
    justify-content: center;
}

.tab-btn:hover {
    color: var(--primary-color);
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.tab-btn i {
    font-size: 1.2rem;
}

.laboratories-section,
.pharmacies-section {
    padding: 3rem 0;
}

.lab-group {
    margin-bottom: 3rem;
    background: var(--white);
    border-radius: 15px;
    padding: 2rem;
    box-shadow: var(--shadow);
}

.lab-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.lab-card {
    background: var(--white);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    transition: var(--transition);
    cursor: pointer;
}

.lab-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: #10b981;
}

.lab-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 1rem;
}

.lab-avatar {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, #10b981, #059669);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 2rem;
}

.lab-info h3 {
    font-size: 1.3rem;
    color: var(--dark-blue);
    margin-bottom: 5px;
}

.lab-type {
    color: var(--gray);
    font-size: 0.9rem;
}

.lab-address {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 1rem;
    color: var(--gray);
    font-size: 0.9rem;
}

.lab-address i {
    color: #10b981;
    width: 20px;
}

.lab-services {
    margin-bottom: 1rem;
    padding: 1rem;
    background: var(--light-gray);
    border-radius: 8px;
}

.lab-services-title {
    font-weight: 600;
    color: var(--dark-blue);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.lab-services-list {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.service-tag {
    background: #d1fae5;
    color: #065f46;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

.footer {
    background: var(--dark-blue);
    color: var(--white);
    text-align: center;
    padding: 2rem 0;
    margin-top: 3rem;
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 1.8rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .specialty-header {
        flex-wrap: wrap;
    }

    .specialty-title {
        font-size: 1.4rem;
    }

    .doctors-grid {
        grid-template-columns: 1fr;
    }

    .modal-content {
        width: 95%;
        margin: 10% auto;
        padding: 1.5rem;
    }

    .doctor-actions {
        flex-direction: column;
    }

    .tabs-nav {
        gap: 5px;
        padding: 0 10px;
    }

    .tab-btn {
        padding: 10px 12px;
        font-size: 0.9rem;
        gap: 5px;
        flex: 1;
        min-width: 0;
    }

    .tab-btn i {
        font-size: 1rem;
    }

    .tab-btn span {
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 10px;
    }

    .tabs-nav {
        gap: 3px;
        padding: 0 5px;
    }

    .tab-btn {
        padding: 8px 8px;
        font-size: 0.8rem;
        gap: 4px;
    }

    .tab-btn i {
        font-size: 0.9rem;
    }

    .tab-btn span {
        font-size: 0.75rem;
    }
}

.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: var(--white);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.mb-1 {
    margin-bottom: 1rem;
}

.mb-2 {
    margin-bottom: 2rem;
}

