/* CSS Custom Properties */
:root {
    --primary-color: #2E8B57; /* Sea Green - Khas Sumbar */
    --secondary-color: #DAA520; /* Golden Rod - Kuning Sumbar */
    --accent-color: #4682B4; /* Steel Blue */
    --text-primary: #1a1a1a;
    --text-secondary: #666;
    --background-white: #ffffff;
    --background-light: #f8f9fa;
    --border-color: #e0e0e0;
    --shadow-light: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-medium: 0 4px 12px rgba(0,0,0,0.15);
    --shadow-heavy: 0 8px 24px rgba(0,0,0,0.2);
    --border-radius: 8px;
    --transition: all 0.3s ease;
    --font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-family);
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--background-white);
    overflow-x: hidden;
}

.unselectable {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
}

/* Header Styles */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
    color: white;
    padding: 1rem 0;
    z-index: 1000;
    box-shadow: var(--shadow-medium);
    transition: var(--transition);
}

.header.scrolled {
    padding: 0.5rem 0;
    backdrop-filter: blur(10px);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.logo-section .logo h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.logo-section .slogan {
    font-size: 0.875rem;
    opacity: 0.9;
    font-style: italic;
    margin: 0;
}

.header-info {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.digital-clock {
    text-align: right;
    font-family: 'Courier New', monospace;
}

.digital-clock #currentDate {
    display: block;
    font-size: 0.875rem;
    opacity: 0.9;
}

.digital-clock #currentTime {
    display: block;
    font-size: 1.25rem;
    font-weight: 600;
}

.emergency-contact {
    background: rgba(255,255,255,0.2);
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255,255,255,0.3);
}

.emergency-contact strong {
    color: var(--secondary-color);
}

/* Running Text */
.running-text-container {
    position: relative;
    background: var(--secondary-color);
    color: white;
    padding: 0.75rem 0;
    overflow: hidden;
    margin-top: 6rem;
}

.running-text {
    white-space: nowrap;
    animation: scroll-left 30s linear infinite;
    font-weight: 500;
}

.running-text.paused {
    animation-play-state: paused;
}

@keyframes scroll-left {
    0% { transform: translateX(100%); }
    100% { transform: translateX(-100%); }
}

.running-text-control {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    padding: 0.5rem;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
}

.running-text-control:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-50%) scale(1.1);
}

/* Quick Actions */
.quick-actions {
    background: var(--background-light);
    padding: 2rem 0;
    text-align: center;
}

.quick-actions .btn-primary,
.quick-actions .btn-secondary {
    margin: 0 0.5rem;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    border-radius: var(--border-radius);
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    display: inline-block;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    box-shadow: var(--shadow-light);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--secondary-color), #FFD700);
    color: var(--text-primary);
    box-shadow: var(--shadow-light);
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

/* Main Content */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.section {
    padding: 4rem 0;
    border-bottom: 1px solid var(--border-color);
}

.section:last-child {
    border-bottom: none;
}

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

.section h2 {
    text-align: center;
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 3rem;
    position: relative;
}

.section h2::after {
    content: '';
    position: absolute;
    bottom: -0.5rem;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 2px;
}

/* About Section */
.about-text {
    font-size: 1.1rem;
    line-height: 1.8;
    text-align: center;
    max-width: 800px;
    margin: 0 auto 3rem;
}

.vision-mission {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    margin-top: 3rem;
}

.vision, .mission {
    background: var(--background-light);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-light);
}

.vision h3, .mission h3 {
    color: var(--primary-color);
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.mission ul {
    list-style: none;
    padding-left: 0;
}

.mission li {
    padding: 0.5rem 0;
    position: relative;
    padding-left: 1.5rem;
}

.mission li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--primary-color);
    font-weight: bold;
}

/* Services Section */
.services-section {
    background: var(--background-light);
}

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

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

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-medium);
}

.service-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.service-card h3 {
    color: var(--primary-color);
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

/* Doctor Schedule Section */
.doctor-filters {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.filter-select {
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    background: var(--background-white);
    cursor: pointer;
    transition: var(--transition);
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(46, 139, 87, 0.1);
}

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

.doctor-card {
    background: var(--background-white);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-light);
    transition: var(--transition);
}

.doctor-card:hover {
    box-shadow: var(--shadow-medium);
    transform: translateY(-2px);
}

.doctor-card.available {
    border-left: 4px solid var(--primary-color);
}

.doctor-card.unavailable {
    border-left: 4px solid #ccc;
    opacity: 0.7;
}

.doctor-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.doctor-specialty {
    color: var(--primary-color);
    font-weight: 500;
    margin-bottom: 1rem;
}

.doctor-schedule {
    margin-bottom: 1rem;
}

.doctor-days {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.doctor-hours {
    font-weight: 600;
    color: var(--text-primary);
}

.doctor-status {
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: 500;
}

.status-available {
    background: #d4edda;
    color: #155724;
}

.status-unavailable {
    background: #f8d7da;
    color: #721c24;
}

/* Articles Section */
.articles-section {
    background: var(--background-light);
}

.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.article-card {
    background: var(--background-white);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-light);
    transition: var(--transition);
}

.article-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-medium);
}

.article-content {
    padding: 1.5rem;
}

.article-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 1rem;
    line-height: 1.4;
}

.article-preview {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.6;
}

.article-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.read-more-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
}

.read-more-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-light);
}

/* Testimonials Section */
.testimonials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.testimonial-card {
    background: var(--background-white);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-light);
    text-align: center;
    border: 1px solid var(--border-color);
}

.testimonial-avatar {
    width: 60px;
    height: 60px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 auto 1rem;
}

.testimonial-card p {
    font-style: italic;
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.testimonial-card h4 {
    color: var(--primary-color);
    margin-bottom: 0.25rem;
}

.testimonial-card span {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* FAQ Section */
.faq-section {
    background: var(--background-light);
}

.faq-list {
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    background: var(--background-white);
    margin-bottom: 1rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-light);
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition);
}

.faq-question {
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.faq-question h3 {
    color: var(--primary-color);
    font-size: 1.1rem;
}

.faq-toggle {
    font-size: 1.5rem;
    color: var(--primary-color);
    transition: var(--transition);
}

.faq-item.active .faq-toggle {
    transform: rotate(45deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.faq-item.active .faq-answer {
    max-height: 200px;
}

.faq-answer p {
    padding: 0 1.5rem 1.5rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Policies Section */
.policies-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.policy-card {
    background: var(--background-white);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-light);
    text-align: center;
    border: 1px solid var(--border-color);
}

.policy-card h3 {
    color: var(--primary-color);
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

/* BMI Calculator Section */
.bmi-section {
    background: var(--background-light);
}

.bmi-calculator {
    max-width: 600px;
    margin: 0 auto;
    background: var(--background-white);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-light);
}

.bmi-form {
    display: grid;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

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

.form-group input {
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: var(--transition);
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(46, 139, 87, 0.1);
}

.bmi-result {
    text-align: center;
    padding: 2rem;
    background: var(--background-light);
    border-radius: var(--border-radius);
    margin-top: 2rem;
}

.bmi-value {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 1rem 0;
}

.bmi-category {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.bmi-advice {
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Partners Section */
.partners-section {
    background: var(--background-light);
}

.partners-intro {
    text-align: center;
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.partners-button-container {
    text-align: center;
}

/* Footer */
.footer {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
    color: white;
    padding: 3rem 0 1rem;
}

.footer-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    margin-bottom: 2rem;
}

.footer-section h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--secondary-color);
}

.contact-info p {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

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

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.2);
    padding-top: 1rem;
    text-align: center;
    opacity: 0.8;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.6);
    backdrop-filter: blur(3px);
    animation: fadeIn 0.3s ease;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

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

.modal-content {
    background: var(--background-white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-heavy);
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9);
    animation: modalSlideIn 0.3s ease forwards;
}

@keyframes modalSlideIn {
    to {
        transform: scale(1);
    }
}

.modal-header {
    padding: 2rem 2rem 1rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    color: var(--primary-color);
    margin: 0;
    font-size: 1.5rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    padding: 0;
    line-height: 1;
}

.modal-close:hover {
    color: var(--primary-color);
    transform: scale(1.1);
}

.modal-body {
    padding: 2rem;
}

.article-meta {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.partners-list {
    display: grid;
    gap: 1.5rem;
}

.partner-item {
    padding: 1.5rem;
    background: var(--background-light);
    border-radius: var(--border-radius);
    border-left: 4px solid var(--primary-color);
}

.partner-item h3 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--primary-color);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-medium);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 3000;
    max-width: 300px;
}

.toast.show {
    transform: translateX(0);
}

/* Loading States */
.loading {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
    font-style: italic;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        gap: 1rem;
        padding: 0 1rem;
    }
    
    .header-info {
        width: 100%;
        justify-content: space-between;
    }
    
    .digital-clock {
        display: none;
    }
    
    .logo-section .logo h1 {
        font-size: 1.5rem;
    }
    
    .section h2 {
        font-size: 2rem;
    }
    
    .vision-mission {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .doctor-filters {
        flex-direction: column;
        align-items: center;
    }
    
    .filter-select {
        width: 100%;
        max-width: 300px;
    }
    
    .quick-actions .btn-primary,
    .quick-actions .btn-secondary {
        display: block;
        margin: 0.5rem auto;
        width: 90%;
        max-width: 300px;
    }
    
    .modal-content {
        margin: 1rem;
        max-height: calc(100vh - 2rem);
    }
    
    .modal-header,
    .modal-body {
        padding: 1.5rem;
    }
    
    .toast {
        right: 1rem;
        left: 1rem;
        max-width: none;
    }
}

@media (max-width: 480px) {
    .running-text-container {
        margin-top: 7rem;
    }
    
    .services-grid,
    .doctor-grid,
    .articles-grid {
        grid-template-columns: 1fr;
    }
    
    .section {
        padding: 2rem 0;
    }
    
    .section h2 {
        font-size: 1.75rem;
    }
}

/* Print Styles */
@media print {
    .header,
    .running-text-container,
    .quick-actions,
    .modal,
    .toast {
        display: none !important;
    }
    
    .main-content {
        margin-top: 0;
    }
    
    .section {
        page-break-inside: avoid;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    :root {
        --border-color: #000;
        --text-secondary: #333;
    }
    
    .service-card,
    .doctor-card,
    .article-card {
        border: 2px solid var(--border-color);
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .running-text {
        animation: none;
    }
    
    html {
        scroll-behavior: auto;
    }
}
