/**
 * QGSO Data - Professional Display Styles
 * Clean, modern presentation for Queensland Regional Profile data
 * Using theme palette colours
 */

/* ============================================
   THEME COLOUR VARIABLES
   ============================================ */
:root {
    --qgso-primary: #002a59;
    --qgso-primary-dark: #081e3f;
    --qgso-accent-green: #377c2b;
    --qgso-accent-lime: #c1d72d;
    --qgso-accent-green-dark: #00843f;
    --qgso-border: #e2e3e4;
    --qgso-bg-light: #FAFBFC;
    --qgso-bg-white: #ffffff;
    --qgso-text: #383838;
}

/* ============================================
   PAGE CONTAINER & HEADER
   ============================================ */

.qgso-data-page {
    padding: 2rem 0;
    background: var(--qgso-bg-light);
    min-height: 100vh;
}

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

.qgso-page-header {
    text-align: center;
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 3px solid var(--qgso-accent-green);
}

.qgso-page-title {
    font-size: 2.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--qgso-primary);
}

.qgso-page-subtitle {
    font-size: 1rem;
    color: var(--qgso-text);
    margin-bottom: 0.5rem;
}

.qgso-last-updated {
    font-size: 0.875rem;
    color: #666;
}

/* ============================================
   REGION INFO BOXES - HIDDEN
   ============================================ */

.qgso-region-info {
    display: none;
}

/* ============================================
   MAIN REPORT CONTAINER
   ============================================ */

.qgso-report {
    background: transparent;
}

/* ============================================
   SECTIONS (Demography, Society, etc.)
   ============================================ */

.qgso-section {
    margin-bottom: 4rem;
}

.qgso-section:last-child {
    margin-bottom: 0;
}

.qgso-section-title {
    font-size: 1.5rem;
    font-weight: 700;
    padding: 1.25rem 1.5rem;
    margin: 0 0 2rem 0;
    background: linear-gradient(135deg, var(--qgso-primary) 0%, var(--qgso-primary-dark) 100%);
    color: #ffffff !important;
    letter-spacing: 0.025em;
    border-left: 5px solid var(--qgso-accent-green);
    border-radius: 15px;
}

/* ============================================
   TABLE BLOCKS
   ============================================ */

.qgso-table-block {
    padding: 1.5rem;
    padding-bottom: 1rem;
    margin-bottom: 3rem;
}

.qgso-table-block:last-child {
    margin-bottom: 0;
}

.qgso-table-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 1rem 0;
    color: var(--qgso-primary);
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--qgso-accent-green);
}

/* Table wrapper for horizontal scrolling */
.qgso-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 0.75rem;
}

/* Scroll hint shadow on right edge when scrollable */
.qgso-table-wrapper {
    background:
        linear-gradient(to right, var(--qgso-bg-white) 30%, transparent),
        linear-gradient(to right, transparent, var(--qgso-bg-white) 70%) 100% 0,
        radial-gradient(farthest-side at 0 50%, rgba(0,0,0,.1), transparent),
        radial-gradient(farthest-side at 100% 50%, rgba(0,0,0,.1), transparent) 100% 0;
    background-repeat: no-repeat;
    background-size: 40px 100%, 40px 100%, 14px 100%, 14px 100%;
    background-attachment: local, local, scroll, scroll;
}

/* ============================================
   DATA TABLES
   ============================================ */

.qgso-data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.85rem;
    border: 1px solid var(--qgso-border);
    border-radius: 15px;
    overflow: hidden;
}

/* Table Header */
.qgso-data-table thead th {
    background: var(--qgso-primary);
    color: var(--qgso-bg-white);
    font-weight: 900;
    text-align: left;
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
    border: 1px solid #3d5a80;
    white-space: nowrap;
    vertical-align: bottom;
}

/* Allow wrapping on header cells with long text */
.qgso-data-table thead th {
    min-width: 60px;
}

/* Headers with multiple lines */
.qgso-data-table thead tr:first-child th {
    vertical-align: middle;
}

/* Rounded corners for first header row */
.qgso-data-table thead tr:first-child th:first-child {
    border-top-left-radius: 14px;
}

.qgso-data-table thead tr:first-child th:last-child {
    border-top-right-radius: 14px;
}

/* Rounded corners for last body row */
.qgso-data-table tbody tr:last-child td:first-child {
    border-bottom-left-radius: 14px;
}

.qgso-data-table tbody tr:last-child td:last-child {
    border-bottom-right-radius: 14px;
}

/* Body Cells */
.qgso-data-table tbody td {
    padding: 0.625rem 1rem;
    border: 1px solid var(--qgso-border);
    vertical-align: top;
    color: var(--qgso-text);
}

/* First column (labels) */
.qgso-data-table tbody td:first-child {
    font-weight: 500;
    color: var(--qgso-text);
}

/* Numeric columns - right align */
.qgso-data-table tbody td:not(:first-child) {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* Alternating rows - consistent color across all columns */
.qgso-data-table tbody tr:nth-child(even) td {
    background-color: var(--qgso-bg-white);
}

.qgso-data-table tbody tr:nth-child(odd) td {
    background-color: #f0f2f4;
}

/* Row hover */
.qgso-data-table tbody tr:hover td {
    background-color: #e8f4e5;
}

/* Highlight rows for Queensland, Ipswich and West Moreton, and Total */
.qgso-data-table tbody tr.qgso-highlight-row td {
    font-weight: 900;
    background-color: var(--qgso-border) !important;
}

/* Subheader rows (e.g., Males, Females) */
.qgso-data-table tbody tr.qgso-subheader-row td {
    background-color: var(--qgso-border) !important;
    color: var(--qgso-text);
    font-weight: 700;
    border-left: none;
    border-right: none;
}

.qgso-data-table tbody tr.qgso-subheader-row td:first-child {
    border-left: 1px solid var(--qgso-border);
}

.qgso-data-table tbody tr.qgso-subheader-row td:last-child {
    border-right: 1px solid var(--qgso-border);
}

/* ============================================
   SOURCE CITATIONS
   ============================================ */

/* Notes/Legend */
.qgso-notes {
    margin-top: 0.75rem;
    padding: 0.5rem 0;
}

.qgso-note {
    font-size: 0.8rem;
    color: #666;
    margin: 0 0 0.25rem 0;
    line-height: 1.4;
}

.qgso-note:last-child {
    margin-bottom: 0;
}

/* Source Citations */
.qgso-source {
    font-size: 0.8rem;
    color: #666;
    margin: 0;
    padding: 0.5rem 0 0 0;
    border-top: 1px solid var(--qgso-border);
    font-weight: 700;
    font-style: italic;
}

/* ============================================
   PAGE FOOTER
   ============================================ */

.qgso-page-footer {
    text-align: center;
    padding-top: 2rem;
    margin-top: 2rem;
    border-top: 3px solid var(--qgso-accent-green);
    font-size: 0.875rem;
    color: var(--qgso-text);
}

.qgso-data-source {
    margin-bottom: 0.5rem;
}

.qgso-data-source a {
    color: var(--qgso-primary);
    text-decoration: none;
}

.qgso-data-source a:hover {
    color: var(--qgso-accent-green);
    text-decoration: underline;
}

.qgso-disclaimer {
    font-size: 0.8rem;
    color: #666;
}

/* ============================================
   NO DATA STATE
   ============================================ */

.qgso-no-data {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--qgso-bg-white);
    border-radius: 8px;
    margin-bottom: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.qgso-no-data h2 {
    color: var(--qgso-primary);
    margin-bottom: 1rem;
}

.qgso-no-data p {
    color: var(--qgso-text);
    margin-bottom: 1rem;
}

.qgso-no-data .button {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: var(--qgso-accent-green);
    color: var(--qgso-bg-white);
    text-decoration: none;
    border-radius: 4px;
    font-weight: 500;
    transition: background 0.2s;
}

.qgso-no-data .button:hover {
    background: var(--qgso-accent-green-dark);
}

/* ============================================
   SHORTCODE STYLES
   ============================================ */

.qgso-shortcode-content {
    margin: 2rem 0;
}

.qgso-shortcode-content h2 {
    margin-bottom: 0.5rem;
    color: var(--qgso-primary);
}

.qgso-shortcode-content .qgso-last-updated {
    margin-bottom: 1.5rem;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 992px) {
    .qgso-table-block {
        padding: 1.25rem;
    }

    .qgso-data-table {
        font-size: 0.8rem;
    }

    .qgso-data-table thead th,
    .qgso-data-table tbody td {
        padding: 0.4rem 0.5rem;
    }
}

@media (max-width: 768px) {
    .qgso-page-title {
        font-size: 1.75rem;
    }

    .qgso-section-title {
        font-size: 1.25rem;
        padding: 1rem 1.25rem;
    }

    .qgso-table-block {
        padding: 1rem;
    }

    .qgso-table-title {
        font-size: 0.95rem;
    }

    .qgso-data-table {
        font-size: 0.75rem;
    }

    .qgso-data-table thead th,
    .qgso-data-table tbody td {
        padding: 0.35rem 0.4rem;
    }

    .qgso-source {
        font-size: 0.7rem;
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
    .qgso-data-page {
        padding: 0;
        background: var(--qgso-bg-white);
    }

    .qgso-report {
        box-shadow: none;
    }

    .qgso-section {
        page-break-inside: avoid;
    }

    .qgso-table-block {
        page-break-inside: avoid;
    }

    .qgso-section-title {
        background: var(--qgso-primary) !important;
        color: var(--qgso-bg-white) !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .qgso-data-table thead th {
        background: var(--qgso-primary) !important;
        color: var(--qgso-bg-white) !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}
