/* Ultra-minified critical CSS for sub-2s LCP */
:root {
    --main-blue: #009ec6;
    --soft-blue: #eaf6fb;
    --white: #fff;
    --border: #dbeaf2;
    --danger: #e74c3c;
    --warning: #f1c40f;
    --full: #2ecc71;
    --gray: #888;
}

/* Base typography - match HTML version exactly */
html {
    font-size: 16px !important;
}

body {
    font-family: 'Segoe UI', Arial, sans-serif !important;
    font-size: 16px !important;
    line-height: 1.6 !important;
    background: #eaf6fb !important;
    margin: 0 !important;
    padding: 0 !important;
    color: #222 !important;
    min-height: 100vh !important;
}

/* Override WordPress theme typography for this page */
body main,
body .lake-kinerret-water-level-page-container,
body #lake-kinerret-water-level-page {
    font-family: 'Segoe UI', Arial, sans-serif !important;
    font-size: 16px !important;
}

/* Override all text elements to match HTML version */
main p,
main li,
main span,
main div,
main td,
main th,
main label,
main button {
    font-family: 'Segoe UI', Arial, sans-serif !important;
}

main p {
    font-size: 1rem !important;
    line-height: 1.6 !important;
}

main ul,
main ol {
    font-size: 1rem !important;
    line-height: 1.6 !important;
}

main li {
    font-size: inherit !important;
    line-height: 1.6 !important;
}

/* Force background with high specificity */
html, html body {
    background: #eaf6fb !important;
    background-color: #eaf6fb !important;
}

.header-title {
    background: var(--main-blue);
    color: var(--white);
    padding: 1rem 0;
    text-align: center;
    font-size: 1.2rem;
    letter-spacing: 1px;
}

.elementor-5066 {
    background: white;
}

main {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem 1rem 3rem 1rem;
    visibility: visible !important;
}

h1 {
    font-size: 2rem !important;
    font-family: 'Segoe UI', Arial, sans-serif !important;
    color: var(--main-blue) !important;
    margin-bottom: 0.5rem !important;
    text-align: center !important;
    visibility: visible !important;
    line-height: 1.2 !important;
}

.subtitle {
    text-align: center !important;
    color: var(--gray) !important;
    font-style: italic !important;
    font-family: 'Segoe UI', Arial, sans-serif !important;
    margin-bottom: 2rem !important;
    font-size: 1rem !important;
    line-height: 1.5 !important;
    visibility: visible !important;
}

section {
    background: var(--white);
    border-radius: 14px;
    box-shadow: 0 2px 12px 0 rgba(0, 120, 156, 0.07);
    border: 1.5px solid var(--border);
    margin-bottom: 2.2rem;
    padding: 2rem 1.5rem 1.5rem 1.5rem;
}

h2 {
    color: var(--main-blue) !important;
    font-size: 1.4rem !important;
    font-family: 'Segoe UI', Arial, sans-serif !important;
    margin-top: 0 !important;
    margin-bottom: 1.2rem !important;
    font-weight: bold !important;
    line-height: 1.3 !important;
}

.live-level {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2rem;
    justify-content: space-between;
}

.live-level-info {
    flex: 1 1 220px;
}

.live-level-value {
    font-size: 2rem !important;
    font-weight: bold !important;
    font-family: 'Segoe UI', Arial, sans-serif !important;
    color: var(--main-blue) !important;
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    line-height: 1.2 !important;
}

.live-level-diff {
    color: var(--gray) !important;
    font-size: 1rem !important;
    font-family: 'Segoe UI', Arial, sans-serif !important;
    margin-bottom: 0.5rem !important;
    line-height: 1.5 !important;
}

.live-level-bar {
    width: 100%;
    height: 18px;
    background: #e0e7ef;
    border-radius: 9px;
    margin: 0.7rem 0;
    position: relative;
    overflow: hidden;
}

.live-level-bar-inner {
    height: 100%;
    border-radius: 9px;
    transition: width 0.7s;
}

.live-level-status {
    display: inline-block;
    padding: 0.3em 1em;
    border-radius: 1em;
    font-size: 1rem;
    font-weight: 600;
    margin-top: 0.5rem;
    color: #fff;
}

.live-level-percent {
    font-size: 1.1rem;
    font-weight: 500;
}

.status-full {
    background: var(--full);
}

.status-warning {
    background: var(--warning);
    color: #222;
}

.status-danger {
    background: var(--danger);
}

.live-level-icon {
    font-size: 1.8rem;
    color: var(--main-blue);
    margin-right: 0.5rem;
}

.table-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1rem;
    justify-content: space-between;
}

.table-controls input,
.table-controls select {
    padding: 0.5em 1em !important;
    border-radius: 6px !important;
    border: 1px solid var(--border) !important;
    font-size: 1rem !important;
    font-family: 'Segoe UI', Arial, sans-serif !important;
    line-height: 1.5 !important;
}

.table-controls button {
    background: var(--main-blue) !important;
    color: #fff !important;
    border: none !important;
    border-radius: 6px !important;
    padding: 0.5em 1.2em !important;
    font-size: 1rem !important;
    font-family: 'Segoe UI', Arial, sans-serif !important;
    cursor: pointer !important;
    margin-left: 0.5rem !important;
    line-height: 1.5 !important;
}

.table-controls label {
    margin-bottom: 0.2rem !important;
    font-weight: 500 !important;
    font-family: 'Segoe UI', Arial, sans-serif !important;
    font-size: 1rem !important;
    color: #00789c !important;
    line-height: 1.5 !important;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 0.5rem;
}

#history-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 0.5rem;
}

th, td {
    padding: 0.7em 0.5em !important;
    text-align: right !important;
    font-family: 'Segoe UI', Arial, sans-serif !important;
    font-size: 1rem !important;
    line-height: 1.5 !important;
}

th {
    background: var(--soft-blue);
    color: var(--main-blue);
    font-weight: 600;
    border-bottom: 2px solid var(--border);
}

tr {
    border-bottom: 1px solid var(--border);
}

tr:nth-child(even) {
    background: #f6fbfd;
}

/* Table wrapper for horizontal scroll */
.table-wrapper,
div[style*="overflow-x:auto"] {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1rem;
}

.table-wrapper table,
div[style*="overflow-x:auto"] table {
    min-width: 100%;
    width: 100%;
}

.arrow-up {
    color: var(--full);
}

.arrow-down {
    color: var(--danger);
}

.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 1.2rem;
    padding: 0.5rem;
}

.pagination button {
    background: var(--main-blue);
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 0.4em 1em;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.pagination button:hover {
    background-color: #00789c;
}

.pagination button.active {
    background: #005f7a;
    font-weight: bold;
}

.chart-controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    align-items: center;
}

.chart-controls select {
    padding: 0.5em 1em;
    border-radius: 6px;
    border: 1px solid var(--border);
    font-size: 1rem;
}

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

.faq {
    margin-top: 1.5rem;
}

.faq h3 {
    color: var(--main-blue) !important;
    font-size: 1.1rem !important;
    font-family: 'Segoe UI', Arial, sans-serif !important;
    margin-bottom: 0.3rem !important;
    line-height: 1.4 !important;
}

.faq p {
    color: #444 !important;
    font-family: 'Segoe UI', Arial, sans-serif !important;
    font-size: 1rem !important;
    line-height: 1.6 !important;
    margin-top: 0 !important;
    margin-bottom: 1.2rem !important;
}

.video-embed,
.map-embed {
    margin: 1.5rem 0;
    text-align: center;
}

.video-placeholder {
    background: #f0f0f0;
    border: 2px dashed #ccc;
    border-radius: 12px;
    padding: 2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.video-placeholder:hover {
    background: #e8e8e8;
    border-color: var(--main-blue);
}

.video-placeholder i {
    font-size: 3rem;
    color: #666;
    margin-bottom: 1rem;
}

.video-embed iframe,
.map-embed iframe {
    width: 100%;
    max-width: 480px;
    height: 270px;
    border-radius: 12px;
    border: none;
}

#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: white;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: #009ec6;
    font-weight: bold;
    transition: opacity 0.2s ease;
}

#loading-overlay.hide {
    opacity: 0;
    pointer-events: none;
}

/* Mobile optimizations */
@media (max-width: 700px) {
    main {
        padding: 1rem 1rem 2rem 1rem;
        max-width: 100vw;
        overflow-x: hidden;
    }

    section {
        padding: 1.5rem 1rem;
        margin-bottom: 1.5rem;
    }

    h1 {
        font-size: 1.6rem !important;
        line-height: 1.3 !important;
        margin-bottom: 1rem !important;
    }

    .subtitle {
        font-size: 0.95rem !important;
        margin-bottom: 1.5rem !important;
        line-height: 1.4 !important;
    }

    .live-level {
        flex-direction: column;
        gap: 1.5rem;
        text-align: center;
    }

    .live-level-value {
        font-size: 1.6rem !important;
        justify-content: center !important;
        gap: 0.3rem !important;
    }

    .live-level-icon {
        font-size: 1.6rem !important;
        margin-right: 0.3rem !important;
    }

    .live-level-unit-group {
        font-size: 1.15rem !important;
        margin-left: 0.2rem !important;
    }

    .live-level-diff {
        font-size: 0.95rem !important;
        margin-bottom: 1rem !important;
    }

    .live-level-status {
        font-size: 1rem !important;
        padding: 0.4rem 1rem !important;
        margin-top: 1rem !important;
    }

    .table-controls,
    .chart-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    .table-controls > div {
        width: 100%;
    }

    .table-controls input,
    .table-controls select {
        width: 100%;
        box-sizing: border-box;
    }

    .chart-responsive {
        min-width: 0;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        position: relative;
    }

    #levelChart {
        min-width: 320px;
        width: 100% !important;
        max-width: 100vw;
        height: 300px !important;
        display: block !important;
    }
    
    #chart-section {
        overflow: visible;
    }

    #chart-placeholder {
        height: 250px !important;
        padding: 1rem;
    }

    table {
        font-size: 0.9rem;
    }

    th, td {
        padding: 0.5rem 0.3rem;
        font-size: 0.85rem;
    }

    .pagination button {
        padding: 0.3rem 0.8rem;
        font-size: 0.9rem;
        margin: 0.1rem;
    }

    .faq h3 {
        font-size: 1rem;
    }

    .faq p {
        font-size: 0.95rem;
        line-height: 1.4;
    }

    /* Mobile-specific optimizations */
    #loading-overlay {
        font-size: 1.1rem;
    }

    #mobile-chart-note {
        font-size: 0.9rem;
        padding: 0.8rem;
    }
}
