/* Base Styles */
:root {
    --primary-color: #1e88e5;
    --primary-dark: #1565c0;
    --primary-light: #64b5f6;
    --secondary-color: #4caf50;
    --secondary-dark: #6df374;
    --secondary-light: #81c784;
    --text-color: #333;
    --text-light: #666;
    --background-color: #f8f9fa;
    --white: #ffffff;
    --gray-light: #f1f1f1;
    --gray: #ddd;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
    --border-radius: 8px;
}

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

html {
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Roboto', sans-serif;
    color: var(--text-color);
    line-height: 1.6;
    background-color: var(--background-color);
    overflow-x: hidden;
}

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

a {
    text-decoration: none;
    color: var(--primary-color);
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

ul {
    list-style: none;
}

.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: var(--border-radius);
    font-weight: 500;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    border: none;
}

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

.primary-btn:hover {
    background-color: var(--primary-dark);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

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

.secondary-btn:hover {
    background-color: var(--secondary-dark);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.section-title {
    text-align: center;
    margin-bottom: 40px;
    font-size: 2.5rem;
    color: var(--primary-color);
    position: relative;
    padding-bottom: 15px;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background-color: var(--primary-color);
    border-radius: 2px;
}

/* Header Styles */
.header {
    background-color: var(--white);
    box-shadow: var(--shadow);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 15px 0;
    overflow-x: hidden;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.logo-container {
    display: flex;
    align-items: center;
}

.clinic-logo {
    width: 80px;
    height: 80px;
    margin-right: 15px;
    border-radius: 50%;
    object-fit: contain;
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.logo {
    font-size: 1.8rem;
    color: var(--primary-color);
    margin: 0;
}

.slogan {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-top: 5px;
}

.main-nav {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.main-nav ul {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: flex-start;
}

.nav-link {
    background-color: #4caf50;
    color: white;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: var(--border-radius);
    transition: var(--transition);
    display: inline-block;
    white-space: nowrap; /* Tên tab hiển thị 1 dòng như Đặt lịch khám, Liên hệ tư vấn */
}

.nav-link:hover {
    background-color: #388e3c;
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

/* Ẩn ô checkbox nav-toggle cạnh logo (trang chủ, links) - vẫn giữ chức năng mở/đóng menu */
.nav-toggle {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    margin: 0;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, var(--primary-light), var(--primary-color));
    color: var(--white);
    padding: 150px 0 100px;
    text-align: center;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.hero-content h2 {
    font-size: 2.8rem;
    margin-bottom: 20px;
}

.service-highlight {
    font-size: 1.5rem;
    margin-bottom: 10px;
    font-weight: 300;
}

.service-highlight-sub {
    font-size: 1.2rem;
    margin-bottom: 30px;
    font-weight: 300;
    color: var(--white);
}

.cta-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 30px;
}

/* Services Section */
.services-section {
    padding: 80px 0;
    background-color: var(--white);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.service-card {
    background-color: var(--white);
    border-radius: var(--border-radius);
    padding: 30px;
    box-shadow: var(--shadow);
    text-align: center;
    transition: var(--transition);
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.service-icon {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.service-card h3 {
    margin-bottom: 15px;
    color: var(--primary-dark);
}

/* Appointment Section */
.appointment-section {
    padding: 80px 0;
    background-color: var(--gray-light);
}

.appointment-container {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 40px;
}

.appointment-form {
    background-color: var(--white);
    border-radius: var(--border-radius);
    padding: 40px;
    box-shadow: var(--shadow);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.required {
    color: #e53935;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--gray);
    border-radius: var(--border-radius);
    font-family: 'Roboto', sans-serif;
    font-size: 1rem;
    transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(30, 136, 229, 0.2);
}

.dob-selects {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.dob-selects select {
    flex: 1;
    min-width: 70px;
}

.dob-selects select:last-child {
    min-width: 90px;
}

.submit-btn {
    width: 100%;
    padding: 14px;
    font-size: 1.1rem;
}

.appointment-info {
    display: flex;
    flex-direction: column;
}

.info-card {
    background-color: var(--white);
    border-radius: var(--border-radius);
    padding: 30px;
    box-shadow: var(--shadow);
    height: 100%;
}

.info-card h3 {
    color: var(--primary-color);
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.info-card p {
    margin-bottom: 15px;
}

.info-card i {
    color: var(--primary-color);
    margin-right: 10px;
}

.zalo-contact {
    margin-top: 30px;
}

.zalo-btn {
    display: flex;
    align-items: center;
    background-color: #0068ff;
    color: var(--white);
    padding: 10px 20px;
    border-radius: var(--border-radius);
    margin-top: 10px;
    transition: var(--transition);
}

.zalo-btn:hover {
    background-color: #0055cc;
    color: var(--white);
}

.zalo-btn img {
    width: 24px;
    height: 24px;
    margin-right: 10px;
}

/* Contact Section */
.contact-section {
    padding: 80px 0;
    background-color: var(--white);
}

.contact-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.info-item {
    display: flex;
    align-items: flex-start;
}

.info-item i {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-right: 15px;
    margin-top: 5px;
}

.info-item h3 {
    margin-bottom: 8px;
    color: var(--primary-dark);
}

.map-link {
    display: inline-block;
    margin-top: 10px;
    color: var(--primary-color);
}

.map-link i {
    font-size: 1rem;
    margin-right: 5px;
}

.social-links {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: var(--white);
    transition: var(--transition);
}

.social-link:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow);
}

.social-link.facebook {
    background-color: #1877f2;
}

.social-link.zalo {
    background-color: #0068ff;
    padding: 5px;
}

.social-link.zalo img {
    width: 100%;
    height: 100%;
}

.contact-map {
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.contact-map iframe {
    width: 100%;
    height: 100%;
    min-height: 400px;
    border: none;
}

/* Schedule Section */
.schedule-section {
    padding: 80px 0;
    background-color: var(--gray-light);
}

.schedule-container {
    background-color: var(--white);
    border-radius: var(--border-radius);
    padding: 40px;
    box-shadow: var(--shadow);
    overflow-x: auto;
}

.schedule-table {
    width: 100%;
    border-collapse: collapse;
}

.schedule-table th,
.schedule-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid var(--gray);
}

.schedule-table th {
    background-color: var(--primary-color);
    color: var(--white);
}

.schedule-table tr:hover {
    background-color: var(--gray-light);
}

/* Footer */
.footer {
    background-color: var(--primary-dark);
    color: var(--white);
    padding: 60px 0 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-logo h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.footer-logo .slogan {
    color: var(--primary-light);
}

.footer-links h4,
.footer-contact h4 {
    font-size: 1.2rem;
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 10px;
}

.footer-links h4::after,
.footer-contact h4::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 3px;
    background-color: var(--primary-light);
}

.footer-links ul {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer-links a {
    color: var(--white);
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--primary-light);
    padding-left: 5px;
}

.footer-contact p {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
}

.footer-contact i {
    margin-right: 10px;
    color: var(--primary-light);
}

.footer-contact a {
    color: var(--white);
}

.footer-contact a:hover {
    color: var(--primary-light);
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Floating Zalo Button */
.floating-zalo {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 999;
}

.floating-zalo a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: #0068ff;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: var(--transition);
}

.floating-zalo a:hover {
    transform: scale(1.1);
}

.floating-zalo img {
    width: 40px;
    height: 40px;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
}

/* Service categories */
.service-categories {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.service-category {
    background-color: #f5f5f5;
    padding: 1rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    }

.service-category:hover {
    background-color: #e3f2fd;
}

.service-category input[type="radio"] {
    display: none;
}

.service-category label {
    display: block;
    cursor: pointer;
    font-weight: 500;
    color: #333;
}

.service-category input[type="radio"]:checked + label {
    color: #1976d2;
}

/* Service list */
.service-list {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.service-item {
    padding: 0.5rem;
    border-bottom: 1px solid #e0e0e0;
}

.service-item:last-child {
    border-bottom: none;
}

.service-item label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.service-item label:hover {
    background-color: #f5f5f5;
}

.service-price {
    color: #666;
    font-size: 0.9em;
}

/* Modal actions */
.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 1.5rem;
}

/* Animations */
.animate__animated {
    animation-duration: 1s;
}

/* Notification modal animations */
@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes fadeOutScale {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.8);
    }
}

#notification-modal .modal-content {
    animation: fadeInScale 0.3s ease-out;
}

#notification-modal.hidden .modal-content {
    animation: fadeOutScale 0.2s ease-in;
}

[data-delay="200"] {
    animation-delay: 0.2s;
}

[data-delay="400"] {
    animation-delay: 0.4s;
}

[data-delay="600"] {
    animation-delay: 0.6s;
}

/* ========== RESPONSIVE - TABLET & SMARTPHONE ========== */
/* Breakpoints: Tablet 768-1024px | Smartphone < 768px | Small phone < 480px */

/* Tablet (768px - 1024px) */
@media (max-width: 1024px) {
    .container {
        padding: 0 16px;
    }
    
    .appointment-container,
    .contact-container {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .logo {
        font-size: 1.5rem;
    }
    
    .clinic-logo {
        width: 60px;
        height: 60px;
    }
    
    .main-nav ul {
        gap: 10px;
    }
    
    .nav-link {
        padding: 8px 12px;
        font-size: 0.9rem;
    }
    
    .hero-section {
        padding: 120px 0 80px;
    }
    
    .hero-content h2 {
        font-size: 2.2rem;
    }
    
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    .contact-map iframe {
        min-height: 350px;
    }
}

/* Smartphone (480px - 768px) */
@media (max-width: 768px) {
    .container {
        padding: 0 12px;
    }
    
    /* Header - chuẩn bị cho hamburger */
    .header {
        padding: 12px 0;
    }
    
    .header .container {
        flex-wrap: nowrap;
        justify-content: space-between;
        align-items: center;
        position: relative;
    }
    
    /* Hamburger button - ẩn trên desktop */
    .nav-toggle {
        display: none;
    }
    
    .nav-toggle-label {
        display: none;
        flex-direction: column;
        justify-content: center;
        gap: 5px;
        width: 44px;
        height: 44px;
        padding: 10px;
        cursor: pointer;
        background: var(--primary-color);
        color: white;
        border-radius: var(--border-radius);
        z-index: 1001;
        transition: var(--transition);
    }
    
    .nav-toggle-label span {
        display: block;
        width: 22px;
        height: 2px;
        background: currentColor;
        border-radius: 1px;
        transition: var(--transition);
    }
    
    .nav-toggle:checked ~ .nav-toggle-label span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    
    .nav-toggle:checked ~ .nav-toggle-label span:nth-child(2) {
        opacity: 0;
    }
    
    .nav-toggle:checked ~ .nav-toggle-label span:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -5px);
    }
    
    /* Mobile nav - dropdown khi có hamburger */
    .header.has-mobile-nav .nav-toggle-label {
        display: flex;
    }
    
    .header.has-mobile-nav .main-nav {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        width: min(85vw, 320px);
        background: var(--white);
        box-shadow: -4px 0 20px rgba(0,0,0,0.15);
        padding: 80px 20px 20px;
        transform: translateX(100%);
        transition: transform 0.3s ease;
        z-index: 1000;
        overflow-y: auto;
    }
    
    .nav-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.4);
        z-index: 999;
        cursor: pointer;
    }
    
    .nav-toggle:checked ~ .nav-overlay {
        display: block;
    }
    
    .header.has-mobile-nav .nav-toggle:checked ~ .main-nav {
        transform: translateX(0);
    }
    
    .header.has-mobile-nav .main-nav ul {
        flex-direction: column;
        gap: 0;
        align-items: stretch;
    }
    
    .header.has-mobile-nav .nav-link {
        display: block;
        padding: 14px 16px;
        min-height: 44px;
        border-radius: var(--border-radius);
        margin-bottom: 4px;
    }
    
    /* Fallback khi không có hamburger - nav wrap */
    .main-nav ul {
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
    }
    
    .logo-container {
        flex: 1;
        min-width: 0;
    }
    
    .logo {
        font-size: 1.3rem;
    }
    
    .slogan {
        font-size: 0.8rem;
    }
    
    /* Hero - giảm padding cho mobile */
    .hero-section {
        padding: 100px 0 60px;
        padding-top: max(100px, env(safe-area-inset-top));
    }
    
    .hero-content h2 {
        font-size: 1.75rem;
        line-height: 1.3;
        margin-bottom: 16px;
    }
    
    .service-highlight {
        font-size: 1.1rem;
    }
    
    .service-highlight-sub {
        font-size: 1rem;
        margin-bottom: 24px;
    }
    
    .cta-buttons {
        flex-direction: column;
        gap: 12px;
        margin-top: 24px;
    }
    
    .cta-buttons .btn {
        width: 100%;
        min-height: 44px;
        padding: 14px 20px;
    }
    
    .section-title {
        font-size: 1.75rem;
        margin-bottom: 28px;
    }
    
    .services-section,
    .appointment-section,
    .contact-section,
    .schedule-section {
        padding: 50px 0;
    }
    
    .services-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .service-card {
        padding: 24px 20px;
    }
    
    .appointment-form {
        padding: 24px 20px;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        min-height: 44px;
        font-size: 16px; /* Tránh zoom trên iOS */
    }
    
    /* Date picker responsive */
    .form-group div[style*="display: flex"] {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .form-group div[style*="display: flex"] select {
        flex: 1;
        min-width: 70px;
    }
    
    .info-card {
        padding: 24px 20px;
    }
    
    .contact-map iframe {
        min-height: 280px;
    }
    
    .schedule-container {
        padding: 20px 12px;
        margin: 0 -12px;
        border-radius: 0;
    }
    
    .schedule-table th,
    .schedule-table td {
        padding: 10px 8px;
        font-size: 0.9rem;
    }
    
    /* Floating Zalo - tránh notch */
    .floating-zalo {
        bottom: max(20px, env(safe-area-inset-bottom));
        right: max(16px, env(safe-area-inset-right));
    }
    
    .floating-zalo a {
        width: 52px;
        height: 52px;
        min-width: 44px;
        min-height: 44px;
    }
    
    .floating-zalo img {
        width: 32px;
        height: 32px;
    }
    
    .modal-content {
        width: 95%;
        max-height: 85vh;
        padding: 1.25rem;
        margin: 1rem;
    }
    
    .appointments-container {
        grid-template-columns: 1fr;
    }
    
    .services-list {
        grid-template-columns: 1fr;
    }
    
    .service-categories {
        grid-template-columns: 1fr;
    }
    
    .service-item,
    .contact-item {
        grid-template-columns: 1fr;
    }
    
    .delete-btn {
        width: 100%;
        margin-top: 0.5rem;
    }
    
    .admin-tabs {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .tab-btn {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }
}

/* Smartphone nhỏ (< 480px) */
@media (max-width: 480px) {
    .container {
        padding: 0 10px;
    }
    
    .clinic-logo {
        width: 50px;
        height: 50px;
    }
    
    .logo {
        font-size: 1.1rem;
    }
    
    .hero-content h2 {
        font-size: 1.5rem;
    }
    
    .service-highlight {
        font-size: 1rem;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .appointment-form,
    .info-card {
        padding: 20px 16px;
    }
    
    .btn {
        padding: 12px 20px;
        min-height: 44px;
    }
    
    .footer-content {
        gap: 24px;
        margin-bottom: 30px;
    }
    
    .footer-links h4,
    .footer-contact h4 {
        font-size: 1.1rem;
    }
}

/* Landscape smartphone - tối ưu chiều cao */
@media (max-height: 500px) and (orientation: landscape) {
    .hero-section {
        padding: 80px 0 40px;
    }
    
    .hero-content h2 {
        font-size: 1.5rem;
    }
    
    .cta-buttons {
        margin-top: 16px;
    }
}

/* Appointments Section */
.appointments-section {
    padding: 50px 0;
    background-color: var(--gray-light);
}

.appointment-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.appointment-list li {
    padding: 10px;
    background-color: var(--white);
    border: 1px solid var(--gray);
    border-radius: var(--border-radius);
    margin-bottom: 10px;
    box-shadow: var(--shadow);
}

/* Examination List Styles */
.examination-list {
    padding: 2rem 0;
}

.examination-list h2 {
    text-align: center;
    margin-bottom: 2rem;
    color: #2c3e50;
}

.appointments-container {
    display: grid;
    grid-template-columns: 2fr 0.45fr;
    gap: 2rem;
    margin-top: 2rem;
}

.appointments-list {
    background: #fff;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.search-box {
    margin-bottom: 1rem;
}

.search-box input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.appointments-table {
    overflow-x: auto;
}

.appointments-table table {
    width: 100%;
    border-collapse: collapse;
}

.appointments-table th,
.appointments-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.appointments-table th {
    background-color: #f8f9fa;
    font-weight: 600;
}

.appointments-table tr:hover {
    background-color: #f8f9fa;
}

.appointments-table tr.selected {
    background-color: #e3f2fd;
}

.clinical-services {
    background: #fff;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.services-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.service-item {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.service-info h4 {
    margin: 0 0 0.5rem 0;
    color: #2c3e50;
}

.service-info p {
    margin: 0;
    color: #666;
}

.service-info .price {
    color: #e74c3c;
    font-weight: 600;
    margin-top: 0.5rem;
}

.selected-services {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #ddd;
}

.selected-services h4 {
    margin-bottom: 1rem;
    color: #2c3e50;
}

#selected-services-list {
    margin-bottom: 1rem;
}

.selected-service-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid #eee;
}

.total-amount {
    display: flex;
    justify-content: space-between;
    padding: 1rem 0;
    font-weight: 600;
    font-size: 1.1rem;
    color: #2c3e50;
}

#print-clinical-service {
    width: 100%;
    margin-top: 1rem;
}

#print-clinical-service:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

/* Responsive Design */
@media (max-width: 768px) {
    .appointments-container {
        grid-template-columns: 1fr;
    }
    
    .services-list {
        grid-template-columns: 1fr;
    }
}

/* Admin Section Styles */
.admin-section {
    padding: 2rem 0;
}

.admin-section h2 {
    text-align: center;
    margin-bottom: 2rem;
    color: #2c3e50;
}

.admin-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid #ddd;
    padding-bottom: 1rem;
}

.tab-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 1rem;
    color: #666;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
}

.tab-btn:hover {
    color: #2c3e50;
}

.tab-btn.active {
    color: #1e88e5;
    border-bottom-color: #1e88e5;
}

.tab-content {
    display: none;
    background: #fff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.tab-content.active {
    display: block;
}

.admin-section .form-group {
    margin-bottom: 1.5rem;
}

.admin-section .form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #2c3e50;
}

.admin-section input[type="text"],
.admin-section input[type="number"],
.admin-section textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.admin-section input[type="text"]:focus,
.admin-section input[type="number"]:focus,
.admin-section textarea:focus {
    outline: none;
    border-color: #1e88e5;
}

.service-item,
.contact-item {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 4px;
}

.service-item {
    grid-template-columns: 1fr 1fr auto;
}

.contact-item {
    grid-template-columns: 1fr 1fr auto;
}

.delete-btn {
    background-color: #e74c3c;
    color: white;
    border: none;
    padding: 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.delete-btn:hover {
    background-color: #c0392b;
}

.examination-settings {
    max-width: 800px;
    margin: 0 auto;
}

/* Responsive Design */
@media (max-width: 768px) {
    .service-item,
    .contact-item {
        grid-template-columns: 1fr;
    }
    
    .delete-btn {
        width: 100%;
        margin-top: 0.5rem;
    }
}

/* Admin Link Styles */
.nav-link.admin-link {
    background-color: #4caf50;
    color: white !important;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.admin-link:hover {
    background-color: #388e3c;
    color: white !important;
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.admin-link i {
    font-size: 1rem;
}

.service-categories {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.service-category {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.service-category:hover {
    background: #e3f2fd;
}

.service-category input[type="radio"] {
    margin-right: 0.5rem;
}

.service-category label {
    cursor: pointer;
    font-weight: 500;
}

.service-list {
    margin-top: 1rem;
    max-height: 300px;
    overflow-y: auto;
    padding: 1rem;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.service-list label {
    display: block;
    padding: 0.5rem;
    margin-bottom: 0.5rem;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.service-list label:hover {
    background: #f8f9fa;
}

.service-list input[type="checkbox"] {
    margin-right: 0.5rem;
}

.service-list .no-services {
    text-align: center;
    color: #666;
    padding: 1rem;
    font-style: italic;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .service-categories {
        grid-template-columns: 1fr;
    }

    .modal-content {
        width: 95%;
        padding: 1rem;
    }
}

/* ========== RESPONSIVE CHO CÁC TRANG KHÁC (Admin, Booking, Lab, v.v.) ========== */

/* Admin header - examination-list, admin.html */
@media (max-width: 768px) {
    .admin-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding: 12px 16px !important;
    }
    
    .admin-header .logo {
        flex-wrap: wrap;
    }
    
    .admin-header .logo h1 {
        font-size: 1.2rem !important;
    }
    
    .admin-header nav {
        align-items: stretch !important;
    }
    
    .admin-header .nav-row {
        flex-direction: column;
        width: 100%;
    }
    
    .admin-header .nav-row a,
    .admin-header .header-nav-btn {
        width: 100%;
        justify-content: center;
        min-height: 44px;
        padding: 12px 16px !important;
    }
}

/* Bảng - scroll ngang trên mobile */
.appointments-table,
.appointments-table table,
#appointments-body,
table.data-table,
.examination-list table {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 768px) {
    .appointments-table,
    #appointments-body {
        display: block;
        overflow-x: auto;
    }
    
    .appointments-table th,
    .appointments-table td,
    #appointments-body th,
    #appointments-body td {
        padding: 10px 8px;
        font-size: 0.85rem;
        white-space: nowrap;
    }
    
    .appointment-row .actions {
        flex-wrap: wrap;
        gap: 6px;
    }
    
    .appointment-row .actions button {
        min-height: 36px;
        padding: 6px 10px;
    }
}

/* Work schedule - booking.html, schedule.html */
@media (max-width: 768px) {
    .work-schedule-section {
        margin: 1rem 12px;
        padding: 1rem 12px !important;
        border-radius: 12px;
    }
    
    .schedule-card {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 12px !important;
        padding: 1rem !important;
    }
    
    .schedule-register {
        min-width: unset !important;
        flex-direction: row !important;
        justify-content: flex-start !important;
        gap: 8px;
    }
    
    .register-btn {
        flex: 1;
        min-height: 44px;
    }
    
    .header .container[style*="flex"] {
        flex-direction: column !important;
        align-items: center !important;
        padding: 1rem 12px !important;
    }
    
    .logo {
        font-size: 1.2rem !important;
        text-align: center !important;
    }
    
    .clinic-subtitle,
    .slogan {
        font-size: 0.85rem !important;
    }
}

@media (max-width: 480px) {
    .work-schedule-section {
        margin: 0.5rem 8px;
        padding: 0.75rem 8px !important;
    }
    
    .schedule-date,
    .schedule-time,
    .schedule-doctor {
        font-size: 0.95rem !important;
    }
}

/* Links page */
@media (max-width: 768px) {
    .links-page {
        padding: 80px 12px 20px !important;
    }
    
    .links-header {
        flex-direction: column;
        align-items: stretch !important;
    }
    
    .links-header h1 {
        font-size: 1.25rem !important;
    }
    
    .links-header-actions {
        flex-wrap: wrap;
    }
    
    .links-grid {
        grid-template-columns: 1fr !important;
    }
}

/* Lab tests header */
@media (max-width: 768px) {
    .header[style*="sticky"] div,
    .header div[style*="flex"] {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 10px !important;
    }
    
    .header h2 {
        font-size: 1.1rem !important;
    }
    
    .provider-badge {
        display: block;
        margin-top: 4px;
    }
}

/* Examination list - filter & actions */
@media (max-width: 768px) {
    .examination-list > div[style*="flex"] {
        flex-direction: column !important;
        align-items: stretch !important;
    }
    
    .examination-list .btn {
        width: 100%;
        min-height: 44px;
    }
    
    .admin-main {
        padding: 1rem 12px !important;
    }
}

/* Search filters - patient-records, examination-list */
@media (max-width: 768px) {
    .search-filters {
        flex-direction: column !important;
        align-items: stretch !important;
        padding: 1rem !important;
    }
    
    .search-filters input[type="text"],
    .search-filters input[type="date"],
    .search-filters select {
        min-width: unset !important;
        width: 100% !important;
    }
}

/* Doctor schedule */
@media (max-width: 768px) {
    .header .container[style*="display:flex"] {
        flex-direction: column !important;
        text-align: center !important;
    }
    
    .header .logo-text {
        align-items: center !important;
    }
}

/* Patient records, forms */
@media (max-width: 768px) {
    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 16px !important; /* Tránh zoom iOS */
    }
    
    input[type="text"],
    input[type="tel"],
    input[type="date"],
    input[type="email"],
    select {
        min-height: 44px;
        font-size: 16px !important;
    }
    
    button,
    .btn {
        min-height: 44px;
    }
}

/* Modal đăng ký - booking */
@media (max-width: 480px) {
    #register-modal .modal-content,
    .modal-content {
        width: 95vw !important;
        max-width: none !important;
        padding: 1rem !important;
        margin: 1rem !important;
    }
    
    #register-type-first,
    #register-type-repeat {
        font-size: 1.1rem !important;
        padding: 14px 0 !important;
    }
}

/* Settings modal, clinical form modal */
@media (max-width: 768px) {
    .settings-card {
        width: 95% !important;
        padding: 1rem !important;
    }
    
    .settings-row {
        grid-template-columns: 1fr !important;
    }
    
    #clinical-form-modal .modal-content {
        width: 98% !important;
        max-height: 90vh !important;
    }
}

/* Pregnancy utilities, tabs */
@media (max-width: 768px) {
    .utilities-tabs,
    .tab-list {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .tab-btn,
    .utility-tab {
        flex: 1 1 auto;
        min-width: 120px;
    }
}

/* VR PACS, general pages */
@media (max-width: 768px) {
    .header-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .header-actions .btn {
        width: 100%;
    }
}

/* Booking - lịch slot grid */
@media (max-width: 768px) {
    .schedule-slots,
    .day-slots,
    [class*="slot-grid"] {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
    }
    
    .slot-btn,
    .time-slot {
        min-height: 44px;
        font-size: 0.9rem;
    }
}

/* Treatment plans, prescription, disease-tests */
@media (max-width: 768px) {
    .details-card,
    .info-group,
    .info-card {
        padding: 1rem !important;
    }
    
    .utility-card {
        padding: 1rem !important;
    }
}