/* =======================
   BASE STYLES (Mobile First)
   ======================= */

.reflectra {
    padding: 1rem;
}

/* =====================
   LIGHT THEME
   ===================== */
.light .section,
.light .page-header {
    background: #ffffff;
    color: #111;
}

.light .page-header h1,
.light .page-header p {
    color: #111;
}

.light .reflectra .lead,
.light .reflectra p,
.light .reflectra li {
    color: #333;
}

.light .spec-table {
    background: #fff;
}

.light .spec-table th {
    background: #f8f9fa;
    color: #111;
}

.light .spec-table td,
.light .spec-table th {
    border-bottom: 1px solid #dee2e6;
}

.light .btn-primary {
    background: #0d6efd;
    color: #fff;
}

.light .btn-primary:hover {
    background: #084298;
}

/* =====================
   DARK THEME
   ===================== */
.dark .section,
.dark .page-header {
    background: #121212;
    color: #f2f2f2;
}

.dark .reflectra p,
.dark .reflectra .lead,
.dark .reflectra li {
    color: #d0d0d0;
}

.dark .spec-table {
    background: #1a1a1a;
}

.dark .spec-table th {
    background: #252525;
    color: #f2f2f2;
}

.dark .spec-table td,
.dark .spec-table th {
    border-bottom: 1px solid #333;
}

.dark .btn-primary {
    background: #ffb703;
    color: #111;
}

.dark .btn-primary:hover {
    background: #e6a700;
}

/* =====================
   COMMON STYLES - Mobile First
   ===================== */

.page-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
}

.page-header h1 {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.lead {
    max-width: 100%;
    font-size: 1rem;
    line-height: 1.6;
}

.section {
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border-radius: 8px;
}

.section h2 {
    font-size: 1.75rem;
    margin-bottom: 1rem;
}

.section h4 {
    font-size: 1.35rem;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.section h5 {
    font-size: 1.2rem;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

.section h6 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.section p {
    line-height: 1.6;
    margin-bottom: 0.75rem;
}

.section ul,
.section ol {
    margin-left: 0;
    margin-bottom: 1rem;
    padding-left: 2rem;
    list-style-position: outside;
}

.section ul li,
.section ol li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-left: 10px;
    vertical-align: middle;
}

.tag.external {
    background-color: #ffc107;
    color: #000;
}

.tag.internal {
    background-color: #0d6efd;
    color: #fff;
}

/* GRID - Mobile: Stack vertically */
.grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    align-items: start;
}

.grid-3 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

.image-box {
    width: 100%;
}

.image-box img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    display: block;
    margin: 0 auto;
}

.caption {
    font-size: 0.85rem;
    opacity: 0.7;
    margin-top: 0.5rem;
    text-align: center;
    font-style: italic;
}

/* TABLE - Mobile: Responsive table */
.spec-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    font-size: 0.9rem;
    overflow-x: auto;
    display: block;
}

.spec-table thead {
    display: table;
    width: 100%;
    table-layout: fixed;
}

.spec-table tbody {
    display: table;
    width: 100%;
    table-layout: fixed;
}

.spec-table th,
.spec-table td {
    padding: 10px 8px;
    text-align: left;
}

.spec-table th {
    font-weight: 600;
}

/* BUTTON */
.btn-primary {
    display: inline-block;
    padding: 12px 24px;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    transition: background-color 0.3s ease, color 0.3s ease;
    text-align: center;
}

/* FOOTER */
.footer {
    text-align: center;
    margin-top: 2rem;
    padding: 1rem 0;
}

/* =======================
   TABLET (481px - 768px)
   ======================= */

@media (min-width: 481px) {
    .reflectra {
        padding: 1.5rem;
    }

    .page-header {
        margin-bottom: 2rem;
    }

    .page-header h1 {
        font-size: 2.3rem;
    }

    .lead {
        font-size: 1.05rem;
        max-width: 700px;
    }

    .section {
        padding: 2rem;
        margin-bottom: 2rem;
    }

    .section h2 {
        font-size: 2rem;
    }

    .spec-table {
        font-size: 1rem;
    }

    .spec-table th,
    .spec-table td {
        padding: 12px 10px;
    }
}

/* =======================
   TABLET LANDSCAPE (769px - 1024px)
   ======================= */

@media (min-width: 769px) {
    .reflectra {
        padding: 2rem;
    }

    .page-header {
        margin-bottom: 2.5rem;
    }

    .page-header h1 {
        font-size: 2.5rem;
    }

    .lead {
        font-size: 1.1rem;
        max-width: 850px;
    }

    .section {
        padding: 2.5rem;
        margin-bottom: 2.5rem;
        border-radius: 12px;
    }

    .section h2 {
        font-size: 2.15rem;
    }

    /* Two column grid for image/text layouts */
    .grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
        align-items: center;
    }

    /* Two column grid for applications */
    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }

    .spec-table {
        display: table;
    }
}

/* =======================
   DESKTOP (1025px and up)
   ======================= */

@media (min-width: 1025px) {
    .reflectra {
        padding: 2.5rem 2rem;
        max-width: 1400px;
        margin: 0 auto;
    }

    .page-header {
        margin-bottom: 3rem;
    }

    .page-header h1 {
        font-size: 2.6rem;
    }

    .lead {
        max-width: 900px;
    }

    .section {
        padding: 2.5rem;
        border-radius: 14px;
    }

    .section h2 {
        font-size: 2.25rem;
    }

    .section h4 {
        font-size: 1.5rem;
    }

    .section h5 {
        font-size: 1.25rem;
    }

    .section p {
        font-size: 1.05rem;
    }

    .section ul li,
    .section ol li {
        font-size: 1.05rem;
    }

    /* Keep 2 columns for grid */
    .grid {
        grid-template-columns: 1fr 1fr;
        gap: 2.5rem;
    }

    /* Three columns for applications on desktop */
    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
        gap: 2.5rem;
    }

    .footer {
        margin-top: 3rem;
    }
}

/* =======================
   LARGE DESKTOP (1400px and up)
   ======================= */

@media (min-width: 1400px) {
    .reflectra {
        max-width: 1600px;
        padding: 3rem 3rem;
    }

    .section {
        padding: 3rem;
    }

    /* Three columns for applications on large desktop */
    .grid-3 {
        grid-template-columns: repeat(3, 1fr);
        gap: 3rem;
    }
}

/* =======================
   SMOOTH TRANSITIONS
   ======================= */

.reflectra,
.section,
.page-header,
.btn-primary {
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* =======================
   UTILITY CLASSES
   ======================= */

/* Ensure images don't overflow */
img {
    max-width: 100%;
    height: auto;
}

/* Improve readability on very small screens */
@media (max-width: 380px) {
    .page-header h1 {
        font-size: 1.75rem;
    }

    .section h2 {
        font-size: 1.5rem;
    }

    .spec-table {
        font-size: 0.85rem;
    }

    .spec-table th,
    .spec-table td {
        padding: 8px 6px;
    }
}

/* Print styles */
@media print {
    .footer {
        display: none;
    }

    .section {
        page-break-inside: avoid;
    }
}
