:root {
    --emr-primary: #0284c7;
    --emr-primary-dark: #0369a1;
    --emr-secondary: #0ea5e9;
    --emr-bg: #f8fafc;
    --emr-white: #ffffff;
    --emr-text: #1e293b;
    --emr-text-light: #64748b;
    --emr-border: #e2e8f0;
    --emr-shadow: 0 4px 20px rgba(15, 23, 42, 0.05);
    --emr-shadow-hover: 0 10px 30px rgba(15, 23, 42, 0.1);
    --emr-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --emr-radius: 12px;
}

.emr-landing-page {
    font-family: 'Inter', sans-serif;
    color: var(--emr-text);
    line-height: 1.6;
    background: var(--emr-bg);
}

.emr-landing-page * {
    box-sizing: border-box;
}

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

/* Typography */
.emr-landing-page h1, .emr-landing-page h2, .emr-landing-page h3 {
    margin-top: 0;
    font-weight: 700;
    color: #0f172a;
}

.emr-section-header {
    text-align: center;
    margin-bottom: 40px;
}

.emr-section-header h2 {
    font-size: 32px;
    margin-bottom: 15px;
    color: #0f172a;
    position: relative;
    display: inline-block;
}

.emr-section-header h2::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 4px;
    background: var(--emr-primary);
    border-radius: 2px;
}

.emr-section-header p {
    color: var(--emr-text-light);
    font-size: 16px;
    max-width: 700px;
    margin: 0 auto;
}

/* Sections */
.emr-section {
    padding: 60px 0;
}

.bg-light {
    background-color: #f1f5f9;
}

.emr-grid {
    display: grid;
    gap: 24px;
}
.emr-grid-3 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.emr-grid-4 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }

/* Buttons */
.emr-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 30px;
    font-weight: 500;
    text-decoration: none;
    transition: var(--emr-transition);
    cursor: pointer;
    border: none;
    font-size: 15px;
    text-align: center;
}

.emr-btn-primary {
    background: linear-gradient(135deg, var(--emr-primary) 0%, var(--emr-primary-dark) 100%);
    color: var(--emr-white) !important;
    box-shadow: 0 4px 14px rgba(2, 132, 199, 0.3);
}

.emr-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(2, 132, 199, 0.4);
    color: var(--emr-white) !important;
}

.emr-btn-outline {
    background: transparent;
    color: var(--emr-white) !important;
    border: 2px solid rgba(255, 255, 255, 0.6);
}

.emr-btn-outline:hover {
    background: var(--emr-white);
    color: var(--emr-primary-dark) !important;
    border-color: var(--emr-white);
    transform: translateY(-2px);
}

/* Hero Section */
.emr-hero {
    position: relative;
    padding: 50px 0 85px;
    background: url('https://images.unsplash.com/photo-1576091160550-2173dba999ef?auto=format&fit=crop&w=1920&q=80') center/cover no-repeat;
    color: var(--emr-white);
    text-align: center;
}

.emr-hero-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.9) 0%, rgba(3, 105, 161, 0.8) 100%);
    z-index: 1;
}

.emr-hero-content {
    position: relative;
    z-index: 2;
    max-width: 850px;
    margin: 0 auto;
}

.emr-badge-top {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 25px;
    backdrop-filter: blur(4px);
}

.emr-hero .emr-headline {
    font-size: 42px;
    color: var(--emr-white);
    margin-bottom: 15px;
    line-height: 1.25;
    font-weight: 800;
    letter-spacing: -0.5px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.emr-hero .emr-subheadline {
    font-size: 18px;
    margin-bottom: 25px;
    opacity: 0.9;
    font-weight: 300;
    line-height: 1.6;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.emr-hero-cta {
    display: flex;
    justify-content: center;
    gap: 16px;
}

/* Stats Section */
.emr-stats-section {
    position: relative;
    z-index: 5;
    margin-top: -40px;
    margin-bottom: 20px;
}

.emr-stats-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
}

.emr-stat-card {
    flex: 1 1 160px;
    max-width: 220px;
    background: var(--emr-white);
    border-radius: var(--emr-radius);
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    box-shadow: var(--emr-shadow);
    border: 1px solid rgba(226, 232, 240, 0.8);
    transition: var(--emr-transition);
    text-align: center;
    min-height: 160px;
    cursor: pointer;
}

.emr-stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
}

.emr-stat-card.active {
    border-color: var(--emr-primary);
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15), 0 10px 30px rgba(15, 23, 42, 0.1);
    background-color: rgba(2, 132, 199, 0.02);
}

.emr-stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.icon-pub { background: rgba(14, 165, 233, 0.1); color: #0284c7; }
.icon-priv { background: rgba(99, 102, 241, 0.1); color: #4f46e5; }
.icon-clinic { background: rgba(20, 184, 166, 0.1); color: #0d9488; }
.icon-spec { background: rgba(168, 85, 247, 0.1); color: #a855f7; }
.icon-station { background: rgba(245, 158, 11, 0.1); color: #d97706; }
.icon-other { background: rgba(100, 116, 139, 0.1); color: #64748b; }

.emr-stat-info {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.emr-stat-info h3 {
    margin: 0;
    font-size: 28px;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.2;
}

.emr-stat-info p {
    margin: 4px 0 0;
    font-size: 13px;
    color: var(--emr-text-light);
    font-weight: 600;
    line-height: 1.4;
}

/* Filter Card */
.emr-filter-card {
    background: var(--emr-white);
    border-radius: var(--emr-radius);
    padding: 24px;
    box-shadow: var(--emr-shadow);
    margin-bottom: 30px;
    border: 1px solid var(--emr-border);
}

.emr-form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
}

.emr-form-col {
    position: relative;
}

.search-input-col {
    flex: 2;
    min-width: 250px;
}

.select-input-col {
    flex: 1;
    min-width: 200px;
}

.btn-col {
    display: flex;
    gap: 10px;
}

.filter-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--emr-text-light);
    font-size: 15px;
}

.emr-filter-control {
    width: 100%;
    padding: 12px 15px 12px 42px;
    border: 1px solid var(--emr-border);
    border-radius: 25px;
    font-size: 15px;
    font-family: inherit;
    transition: var(--emr-transition);
    background-color: #f8fafc;
    color: var(--emr-text);
}

.emr-filter-control:focus {
    outline: none;
    border-color: var(--emr-primary);
    background-color: var(--emr-white);
    box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.12);
}

.emr-btn-search {
    background: var(--emr-primary);
    color: var(--emr-white) !important;
    padding: 12px 24px;
    font-size: 14px;
    border-radius: 25px;
}

.emr-btn-search:hover {
    background: var(--emr-primary-dark);
}

.emr-btn-reset {
    background: #e2e8f0;
    color: #475569 !important;
    padding: 12px 20px;
    font-size: 14px;
    border-radius: 25px;
}

.emr-btn-reset:hover {
    background: #cbd5e1;
}

/* Table Card & Responsive Table */
.emr-table-card {
    background: var(--emr-white);
    border-radius: var(--emr-radius);
    box-shadow: var(--emr-shadow);
    overflow: hidden;
    border: 1px solid var(--emr-border);
}

.emr-table-responsive {
    overflow-x: auto;
    width: 100%;
}

.emr-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.emr-table th, .emr-table td {
    padding: 16px 20px;
    border-bottom: 1px solid var(--emr-border);
    font-size: 15px;
}

.emr-table th {
    background-color: #f8fafc;
    font-weight: 600;
    color: #475569;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
}

.emr-table tr:last-child td {
    border-bottom: none;
}

.emr-table tbody tr {
    transition: var(--emr-transition);
}

.emr-table tbody tr:hover {
    background-color: #f8fafc;
}

/* Custom Table Cells */
.stt-col {
    font-weight: 500;
    color: var(--emr-text-light);
}

.facility-name-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.name-icon {
    color: var(--emr-primary);
    font-size: 16px;
    width: 20px;
}

.facility-address-cell {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #475569;
    font-size: 14px;
}

.address-icon {
    color: #ef4444;
    font-size: 14px;
}

.calendar-icon {
    color: #10b981;
    margin-right: 6px;
}

.publish-date-cell {
    color: #334155;
    font-size: 14px;
    font-weight: 500;
}

/* Badges for Facility Types */
.emr-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
}

.badge-pub-hospital { background: rgba(14, 165, 233, 0.1); color: #0284c7; }
.badge-priv-hospital { background: rgba(99, 102, 241, 0.1); color: #4f46e5; }
.badge-clinic { background: rgba(20, 184, 166, 0.1); color: #0d9488; }
.badge-station { background: rgba(245, 158, 11, 0.1); color: #d97706; }

/* Download Buttons */
.emr-btn-download {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(16, 185, 129, 0.1);
    color: #059669 !important;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: var(--emr-transition);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.emr-btn-download:hover {
    background: #10b981;
    color: var(--emr-white) !important;
    border-color: #10b981;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.2);
}

.no-doc {
    font-size: 13px;
    color: var(--emr-text-light);
    font-style: italic;
}

.emr-no-data {
    padding: 50px 20px !important;
}

/* Guide Cards */
.emr-guide-card {
    background: var(--emr-white);
    border-radius: var(--emr-radius);
    padding: 30px;
    position: relative;
    border: 1px solid var(--emr-border);
    box-shadow: var(--emr-shadow);
}

.guide-num {
    font-size: 48px;
    font-weight: 800;
    color: rgba(2, 132, 199, 0.12);
    position: absolute;
    top: 15px;
    right: 25px;
    line-height: 1;
}

.emr-guide-card h3 {
    font-size: 20px;
    margin-bottom: 12px;
    color: #0f172a;
    position: relative;
    z-index: 2;
}

.emr-guide-card p {
    margin: 0;
    color: var(--emr-text-light);
    font-size: 14px;
    position: relative;
    z-index: 2;
}

/* FAQ / Accordion */
.emr-faq {
    max-width: 900px;
    margin: 0 auto;
}

.emr-faq-item {
    margin-bottom: 15px;
    background: var(--emr-white);
    border-radius: var(--emr-radius);
    border: 1px solid var(--emr-border);
    box-shadow: var(--emr-shadow);
    overflow: hidden;
}

.emr-faq-question {
    width: 100%;
    text-align: left;
    padding: 20px 25px;
    background: none;
    border: none;
    font-size: 16px;
    font-weight: 600;
    color: #0f172a;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--emr-transition);
}

.emr-faq-question:hover {
    background-color: #f8fafc;
    color: var(--emr-primary);
}

.emr-faq-answer {
    padding: 0 25px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease, padding 0.35s ease;
    border-top: 0 solid var(--emr-border);
}

.emr-faq-answer p {
    margin: 0;
    color: var(--emr-text-light);
    font-size: 15px;
    line-height: 1.6;
}

.emr-faq-item.active .emr-faq-answer {
    padding: 20px 25px;
    max-height: 300px;
    border-top-width: 1px;
    background-color: #f8fafc;
}

.emr-faq-item.active .emr-faq-question {
    color: var(--emr-primary);
    background-color: #f8fafc;
}

.emr-faq-item.active .emr-faq-question i {
    transform: rotate(180deg);
    color: var(--emr-primary);
}

.emr-faq-question i {
    transition: var(--emr-transition);
    color: var(--emr-text-light);
}

/* Footer */
.emr-footer {
    background: #0f172a;
    color: #94a3b8;
    padding: 60px 0 25px;
    font-size: 14px;
}

.emr-footer h3 {
    color: var(--emr-white);
    font-size: 18px;
    margin-bottom: 20px;
    font-weight: 600;
}

.emr-footer ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.emr-footer ul li {
    margin-bottom: 12px;
}

.emr-footer a {
    color: #94a3b8;
    text-decoration: none;
    transition: var(--emr-transition);
}

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

.emr-footer-bottom {
    text-align: center;
    padding-top: 25px;
    margin-top: 45px;
    border-top: 1px solid #1e293b;
    color: #64748b;
    font-size: 13px;
}

/* Responsive Rules */
@media (max-width: 992px) {
    .emr-form-row { flex-direction: column; align-items: stretch; }
    .search-input-col, .select-input-col { width: 100%; }
    .btn-col { justify-content: flex-end; }
    .emr-hero .emr-headline { font-size: 32px; }
}

@media (max-width: 768px) {
    .emr-section { padding: 40px 0; }
    .emr-section-header h2 { font-size: 26px; }
}

@media (max-width: 576px) {
    .emr-stat-card {
        flex: 1 1 100%;
        max-width: 100%;
    }
    .emr-hero-cta { flex-direction: column; gap: 10px; }
    .emr-hero-cta .emr-btn { width: 100%; }
    .btn-col .emr-btn { flex: 1; }
}

/* Premium Advanced Search & Loading Overlay Styles */
.emr-table-card {
    position: relative;
}

.emr-btn-toggle-adv {
    background: #f1f5f9;
    color: #475569 !important;
    border: 1px solid var(--emr-border);
    border-radius: 25px;
    padding: 12px 20px;
    font-size: 14px;
}

.emr-btn-toggle-adv:hover {
    background: #e2e8f0;
    color: var(--emr-primary-dark) !important;
}

.emr-btn-toggle-adv.active {
    background: rgba(2, 132, 199, 0.1);
    color: var(--emr-primary) !important;
    border-color: rgba(2, 132, 199, 0.3);
}

.emr-advanced-panel {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease, margin-top 0.3s ease, padding-top 0.3s ease;
}

.emr-advanced-panel.open {
    max-height: 500px;
    opacity: 1;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px dashed var(--emr-border);
    overflow: visible;
}

.advanced-search-row {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.input-group-col {
    flex: 1;
    min-width: 200px;
}

.emr-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.input-relative {
    position: relative;
}

.input-relative .filter-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--emr-text-light);
    font-size: 15px;
    pointer-events: none;
}

.emr-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(2px);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.emr-loading-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.emr-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(2, 132, 199, 0.1);
    border-left-color: var(--emr-primary);
    border-radius: 50%;
    animation: emr-spin 0.8s linear infinite;
}

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

/* Adjustments for smaller screens on advanced panel */
@media (max-width: 992px) {
    .advanced-search-row {
        flex-direction: column;
        align-items: stretch;
    }
    .input-group-col {
        width: 100%;
    }
}

/* EMR Pagination Styling */
.emr-pagination-wrapper {
    margin: 25px 0 10px;
    display: flex;
    justify-content: center;
}

.emr-pagination-wrapper .pagination,
.emr-table-responsive .pagination {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
    gap: 8px;
    align-items: center;
}

.emr-pagination-wrapper .pagination li a,
.emr-pagination-wrapper .pagination li span,
.emr-table-responsive .pagination li a,
.emr-table-responsive .pagination li span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 6px;
    border-radius: 50%;
    border: 1px solid var(--emr-border);
    color: var(--emr-text);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: var(--emr-transition);
    background: var(--emr-white);
    cursor: pointer;
}

.emr-pagination-wrapper .pagination li a:hover,
.emr-table-responsive .pagination li a:hover {
    border-color: var(--emr-primary);
    color: var(--emr-primary);
    background: rgba(14, 165, 233, 0.05);
}

.emr-pagination-wrapper .pagination li.active span,
.emr-pagination-wrapper .pagination li.active a,
.emr-table-responsive .pagination li.active span,
.emr-table-responsive .pagination li.active a {
    background: var(--emr-primary);
    color: var(--emr-white);
    border-color: var(--emr-primary);
    box-shadow: 0 4px 10px rgba(14, 165, 233, 0.25);
}

.emr-pagination-wrapper .pagination li.disabled span,
.emr-pagination-wrapper .pagination li.disabled a,
.emr-table-responsive .pagination li.disabled span,
.emr-table-responsive .pagination li.disabled a {
    color: var(--emr-text-light);
    opacity: 0.5;
    cursor: not-allowed;
    background: #f8fafc;
}

