/*
 * Thailand Internet Statistics
 * Main website stylesheet
 *
 * Updated: July 2026
 */

/* ==========================================================
   Base styles
   ========================================================== */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    margin: 0;
    padding: 0;
}

body {
    min-height: 100%;
    margin: 0;
    padding: 0;
    background-color: #99afb8;
    color: #1f2933;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 14px;
    line-height: 1.5;
}

img {
    max-width: 100%;
    height: auto;
    border: 0;
}

a {
    color: #075985;
}

a:hover,
a:focus {
    color: #0c4a6e;
}

a:focus-visible,
button:focus-visible,
select:focus-visible {
    outline: 3px solid #facc15;
    outline-offset: 2px;
}

/* ==========================================================
   Top announcement bar
   ========================================================== */

/*
 * The entire bar has 50% opacity.
 *
 * This affects:
 * - background
 * - text
 * - red NEW badge
 *
 * This matches the request to apply opacity to the complete bar.
 */
.announcement-bar {
    position: relative;
    z-index: 1000;
    width: 100%;
    margin: 0;
    padding: 0;
    background-color: #003f72;
    color: #ffffff;
    opacity: 0.5;
}

.announcement-bar__link {
    display: block;
    width: 100%;
    color: inherit;
    text-decoration: none;
    cursor: pointer;
}

.announcement-bar__link:visited {
    color: #ffffff;
}

.announcement-bar__link:hover,
.announcement-bar__link:focus {
    color: #ffffff;
    text-decoration: none;
}

.announcement-bar__content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    max-width: 980px;
    min-height: 48px;
    margin: 0 auto;
    padding: 10px 20px;
    text-align: center;
}

.announcement-bar__badge {
    display: inline-block;
    flex: 0 0 auto;
    padding: 4px 11px;
    border-radius: 20px;
    background-color: #d40000;
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    line-height: 1.4;
    text-transform: uppercase;
}

.announcement-bar__message {
    color: #ffffff;
    font-size: 15px;
    line-height: 1.5;
}

.announcement-bar__message strong {
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.announcement-bar__link:hover .announcement-bar__message strong {
    text-decoration: none;
}

/* ==========================================================
   Page wrapper
   ========================================================== */

.page-wrapper {
    width: 100%;
    min-height: 100vh;
}

/* ==========================================================
   Header
   ========================================================== */

.site-header {
    width: 100%;
    background-color: #ffffff;
}

.site-header__logo-container {
    width: 100%;
    max-width: 980px;
    margin: 0 auto;
}

.site-header__logo {
    display: block;
    width: 100%;
    height: auto;
}

/* ==========================================================
   Main content
   ========================================================== */

.main-content {
    width: 100%;
    max-width: 980px;
    min-height: 500px;
    margin: 0 auto;
    padding: 15px;
    background-color: #ffffff;
}

.content-block {
    width: 100%;
    margin: 15px auto;
    padding: 15px;
    border: 1px solid #d7dee3;
    border-radius: 4px;
    background-color: #ffffff;
}

.content-image,
.linked-image {
    margin: 10px 0;
    text-align: left;
}

.content-image img,
.linked-image img {
    display: block;
}

.back-to-top {
    display: inline-block;
    margin-top: 15px;
}

.return-link {
    margin: 15px 0;
    text-align: center;
}

.return-link button {
    min-height: 34px;
    padding: 6px 14px;
    border: 1px solid #aebbc4;
    border-radius: 4px;
    background-color: #f4f7f9;
    color: #1f2933;
    font: inherit;
    cursor: pointer;
}

.return-link button:hover {
    background-color: #e4ebef;
}

/* ==========================================================
   Tables
   ========================================================== */

.table-container {
    width: 100%;
    margin: 15px 0;
    overflow-x: auto;
}

.data-table {
    border-collapse: collapse;
    color: #111827;
    font-family: Tahoma, Arial, sans-serif;
    font-size: 10pt;
}

.data-table th,
.data-table td {
    padding: 8px 10px;
    border: 1px solid #d7dee3;
    vertical-align: top;
}

.data-table th {
    background-color: #eef3f6;
    font-weight: 700;
    text-align: left;
}

.data-table tbody tr:nth-child(even) {
    background-color: #f8fafc;
}

.data-table tbody tr:hover {
    background-color: #eef6fa;
}

/* ==========================================================
   Analytics report selector
   ========================================================== */

.analytics-report-selector {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 15px 0;
}

.analytics-report-selector label {
    font-weight: 700;
}

.analytics-report-selector select,
.analytics-report-selector button {
    min-height: 36px;
    padding: 6px 10px;
    border: 1px solid #aebbc4;
    border-radius: 4px;
    font: inherit;
}

.analytics-report-selector select {
    background-color: #ffffff;
    color: #1f2933;
}

.analytics-report-selector button {
    border-color: #075985;
    background-color: #075985;
    color: #ffffff;
    cursor: pointer;
}

.analytics-report-selector button:hover,
.analytics-report-selector button:focus {
    background-color: #0c4a6e;
}

.empty-message {
    margin: 15px 0;
    padding: 10px 12px;
    border-left: 4px solid #64748b;
    background-color: #f1f5f9;
    color: #334155;
}

/* ==========================================================
   Date
   ========================================================== */

.summary-date {
    color: #475569;
    font-size: 13px;
}

/* ==========================================================
   Footer
   ========================================================== */

.site-footer {
    width: 100%;
    max-width: 980px;
    margin: 0 auto;
    padding: 18px 15px;
    background-color: #eef3f6;
    color: #46545f;
    font-size: 12px;
}

.site-footer__content p {
    margin: 3px 0;
}

.site-footer__link {
    font-weight: 700;
}

/* ==========================================================
   Utility classes
   ========================================================== */

.clearfix {
    clear: both;
}

/* ==========================================================
   Responsive layout
   ========================================================== */

@media screen and (max-width: 1000px) {
    .site-header__logo-container,
    .main-content,
    .site-footer {
        max-width: calc(100% - 10px);
    }
}

@media screen and (max-width: 640px) {
    .announcement-bar__content {
        flex-direction: column;
        gap: 5px;
        min-height: auto;
        padding: 10px 12px;
    }

    .announcement-bar__badge {
        margin: 0;
    }

    .announcement-bar__message {
        display: block;
        font-size: 14px;
    }

    .main-content {
        padding: 10px;
    }

    .analytics-report-selector {
        align-items: stretch;
        flex-direction: column;
    }

    .analytics-report-selector label,
    .analytics-report-selector select,
    .analytics-report-selector button {
        width: 100%;
    }
}
