/* ========================================
   LESCO Web Bill - Main Stylesheet
======================================== */

:root {
    --maroon: #8b1538;
    --dark-maroon: #6d102c;
    --blue: #2874a6;
    --brown: #3d2314;
    --orange: #e67e22;
    --white: #ffffff;
    --light-gray: #f1f5f9;
    --gray: #94a3b8;
    --dark-gray: #475569;
    --text-dark: #1e293b;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--light-gray);
    color: var(--text-dark);
    line-height: 1.7;
    overflow-x: hidden;
    max-width: 100vw;
}

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

/* ========================================
   HEADER
======================================== */
header {
    background: var(--brown);
    padding: 10px 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    position: relative;
    z-index: 999;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.logo img {
    height: 40px !important;
    width: 40px !important;
    max-width: none !important;
    margin: 0 !important;
    border-radius: 50% !important;
    object-fit: cover;
}

.logo-text {
    color: var(--white);
    font-size: 18px;
    font-weight: 700;
}

.logo-text span {
    color: var(--orange);
}

nav {
    display: flex;
    gap: 20px;
}

nav a {
    color: #cbd5e1;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: 0.3s;
}

nav a:hover {
    color: var(--orange);
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    color: var(--white);
    cursor: pointer;
    padding: 12px;
    min-width: 48px;
    min-height: 48px;
    z-index: 1001;
    position: relative;
    pointer-events: auto;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

/* ========================================
   HERO
======================================== */
.hero {
    background: linear-gradient(135deg, #4a1a2b 0%, var(--brown) 100%);
    padding: 40px 5% 80px;
    text-align: center;
    color: var(--white);
}

.hero h1 {
    font-size: 32px;
    margin-bottom: 10px;
}

.hero p {
    opacity: 0.85;
    font-size: 16px;
    max-width: 600px;
    margin: 0 auto;
}

/* ========================================
   SEARCH CARD
======================================== */
.search-section {
    max-width: 650px;
    margin: -60px auto 25px;
    padding: 0 20px;
}

.bill-card {
    background: var(--white);
    padding: 35px;
    border-radius: 25px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
    text-align: center;
}

.input-group {
    text-align: left;
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--dark-gray);
    font-size: 14px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper i {
    position: absolute;
    left: 15px;
    color: var(--gray);
    font-size: 18px;
}

.ref-input {
    width: 100%;
    padding: 15px 15px 15px 50px;
    border: 2px solid #e2e8f0;
    border-radius: 15px;
    font-size: 18px;
    outline: none;
    transition: 0.3s;
    background: #f8fafc;
    font-weight: 600;
    font-family: 'Outfit', sans-serif;
}

.ref-input:focus {
    border-color: var(--maroon);
    background: var(--white);
    box-shadow: 0 0 0 4px rgba(139, 21, 56, 0.1);
}

.error-msg {
    display: none;
    color: #dc2626;
    font-size: 13px;
    margin-top: 8px;
    padding-left: 5px;
}

.ref-input.error {
    border-color: #dc2626;
}

.btn-primary {
    width: 100%;
    background: var(--maroon);
    color: var(--white);
    border: none;
    padding: 15px;
    border-radius: 15px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.3s;
    box-shadow: 0 8px 15px rgba(139, 21, 56, 0.35);
    font-family: 'Outfit', sans-serif;
}

.btn-primary:hover {
    transform: translateY(-2px);
    background: var(--dark-maroon);
}

.info-box {
    background: #fef7ed;
    border: 1px dashed var(--orange);
    padding: 12px;
    border-radius: 12px;
    margin-top: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: #9a3412;
}

/* ========================================
   FEATURES
======================================== */
.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin: 20px auto;
    max-width: 1400px;
    width: 90%;
    padding: 0 20px;
    box-sizing: border-box;
}

.f-item {
    background: var(--white);
    padding: 25px 20px;
    border-radius: 18px;
    text-align: center;
    transition: 0.3s;
}

.f-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
}

.f-item i {
    font-size: 30px;
    color: var(--maroon);
    margin-bottom: 12px;
}

.f-item h3 {
    margin: 8px 0;
    color: var(--text-dark);
    font-size: 16px;
}

.f-item p {
    color: var(--dark-gray);
    font-size: 13px;
    margin: 0;
}

/* ========================================
   CONTENT WRAPPER
======================================== */
.content-wrapper {
    max-width: 1400px;
    width: 90%;
    margin: 0 auto;
    padding: 15px 20px;
    box-sizing: border-box;
}

/* ========================================
   TABLE OF CONTENTS
======================================== */
.toc {
    background: var(--white);
    border-radius: 20px;
    padding: 25px;
    margin-bottom: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.toc h3 {
    color: var(--maroon);
    margin-bottom: 15px;
    font-size: 16px;
}

.toc h3 i {
    margin-right: 8px;
}

.toc ul {
    list-style: none;
    column-count: 2;
    column-gap: 30px;
}

.toc li {
    margin-bottom: 8px;
    break-inside: avoid;
}

.toc a {
    color: var(--dark-gray);
    text-decoration: none;
    font-size: 13px;
    transition: 0.3s;
}

.toc a:hover {
    color: var(--maroon);
}

/* TOC Dropdown */
.toc-dropdown {
    background: var(--white);
    border-radius: 15px;
    margin-bottom: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    text-align: center;
}

.toc-dropdown summary {
    padding: 18px 25px;
    font-size: 16px;
    font-weight: 600;
    color: var(--maroon);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    list-style: none;
    user-select: none;
    transition: background 0.3s;
    outline: none;
}

.toc-dropdown summary::-webkit-details-marker {
    display: none;
}

.toc-dropdown summary:hover {
    background: #fef7f8;
}

.toc-dropdown .toc-arrow {
    margin-left: 10px;
    font-size: 12px;
    transition: transform 0.3s;
}

.toc-dropdown[open] .toc-arrow {
    transform: rotate(180deg);
}

.toc-dropdown ul {
    list-style: none;
    padding: 0 25px 20px 25px;
    margin: 0 auto;
    column-count: 1;
    display: inline-block;
    text-align: left;
}

.toc-dropdown li {
    margin-bottom: 10px;
    break-inside: avoid;
}

.toc-dropdown a {
    color: var(--dark-gray);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s;
    display: block;
    padding: 5px 0;
    outline: none;
}

.toc-dropdown a:hover {
    color: var(--maroon);
}

.toc-dropdown a:focus {
    color: var(--maroon);
    outline: none;
}

.toc-dropdown summary:focus {
    outline: none;
}

/* ========================================
   SECTIONS
======================================== */
.section {
    background: var(--white);
    border-radius: 20px;
    padding: 25px;
    margin-bottom: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    overflow: hidden;
}

.section h2 {
    color: var(--blue);
    font-size: 22px;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 3px solid var(--maroon);
    display: inline-block;
}

.section h3 {
    color: var(--maroon);
    font-size: 16px;
    margin: 15px 0 8px;
}

.section p {
    color: var(--dark-gray);
    font-size: 14px;
    margin-bottom: 12px;
}

/* ========================================
   ALL IMAGES IN SECTIONS
======================================== */
.section img {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 12px 0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.image-placeholder {
    background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
    border: 2px dashed var(--gray);
    border-radius: 12px;
    padding: 50px 25px;
    text-align: center;
    margin: 20px 0;
}

.image-placeholder i {
    font-size: 40px;
    color: var(--gray);
    margin-bottom: 12px;
}

.image-placeholder p {
    margin: 0;
    font-weight: 600;
    color: var(--dark-gray);
    font-size: 13px;
}

/* ========================================
   TABLE
======================================== */
.styled-table {
    width: 100% !important;
    min-width: 100%;
    border-collapse: collapse;
    margin: 18px 0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    font-size: 13px;
    table-layout: fixed;
}

.styled-table thead {
    background: var(--brown);
    color: var(--white);
}

.styled-table th,
.styled-table td {
    padding: 12px 15px;
    text-align: left;
}

.styled-table tbody tr {
    border-bottom: 1px solid #e2e8f0;
}

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

.styled-table tbody tr:hover {
    background: #fef7ed;
}

/* ========================================
   FUNCTION CARDS
======================================== */
.function-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 12px;
}

.function-card {
    background: #f8fafc;
    border-radius: 12px;
    padding: 20px;
    border-left: 4px solid var(--maroon);
    transition: 0.3s;
}

.function-card:hover {
    transform: translateX(3px);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
}

.function-card h3 {
    color: var(--text-dark);
    margin: 0 0 8px;
    font-size: 14px;
}

.function-card h3 i {
    color: var(--maroon);
    margin-right: 6px;
}

.function-card p {
    margin: 0;
    font-size: 13px;
    color: var(--dark-gray);
}

/* ========================================
   PAYMENT METHODS
======================================== */
.payment-method {
    background: #f8fafc;
    border-radius: 15px;
    padding: 20px;
    margin: 12px 0;
}

.payment-method h4 {
    color: var(--maroon);
    font-size: 17px;
    margin: 0 0 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.payment-method ol {
    margin: 0;
    padding-left: 18px;
    color: var(--dark-gray);
}

.payment-method li {
    margin-bottom: 8px;
    font-size: 14px;
}

/* ========================================
   NOTE BOX
======================================== */
.note-box {
    background: #fef3c7;
    border-left: 4px solid #f59e0b;
    padding: 12px 18px;
    border-radius: 0 12px 12px 0;
    margin: 15px 0;
    font-size: 13px;
    color: #92400e;
}

/* ========================================
   STEP LIST
======================================== */
.step-list {
    margin: 12px 0;
    padding-left: 0;
    counter-reset: step-counter;
    list-style: none;
}

.step-list li {
    position: relative;
    padding: 15px 15px 15px 55px;
    background: #f8fafc;
    border-radius: 10px;
    margin-bottom: 12px;
    font-size: 14px;
    color: var(--dark-gray);
    border-left: 4px solid var(--maroon);
}

.step-list li::before {
    counter-increment: step-counter;
    content: counter(step-counter);
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    background: var(--maroon);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
}

/* ========================================
   TIP LIST
======================================== */
.tip-list {
    list-style: none;
    margin: 12px 0;
}

.tip-list li {
    padding: 12px 15px 12px 45px;
    background: #ecfdf5;
    border-radius: 10px;
    margin-bottom: 8px;
    position: relative;
    color: #065f46;
    font-size: 13px;
}

.tip-list li::before {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    left: 18px;
    color: #10b981;
}

/* ========================================
   TAX GRID
======================================== */
.tax-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin: 12px 0;
}

.tax-item {
    background: #fef2f2;
    padding: 12px 15px;
    border-radius: 10px;
    border-left: 4px solid #ef4444;
    color: #991b1b;
    font-size: 13px;
    font-weight: 500;
}

/* ========================================
   BREAKDOWN CARDS
======================================== */
.breakdown-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin: 12px 0;
}

.breakdown-card {
    background: linear-gradient(135deg, var(--brown) 0%, #5a3420 100%);
    color: var(--white);
    padding: 25px;
    border-radius: 15px;
}

.breakdown-card h3 {
    color: var(--orange);
    font-size: 15px;
    margin: 0 0 12px;
}

.breakdown-card h3 i {
    margin-right: 6px;
}

.breakdown-card p {
    color: #d4d4d4;
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
}

/* ========================================
   HOURS CONTAINER
======================================== */
.hours-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin: 12px 0;
}

.peak-box,
.offpeak-box {
    padding: 25px;
    border-radius: 15px;
    text-align: center;
}

.peak-box {
    background: #fef2f2;
    border: 2px solid #fecaca;
}

.peak-box h3 {
    color: #dc2626;
    margin-bottom: 8px;
    font-size: 14px;
}

.peak-box .time {
    font-size: 22px;
    font-weight: 700;
    color: #991b1b;
}

.peak-box p {
    font-size: 12px;
    color: #b91c1c;
    margin: 8px 0 0;
}

.offpeak-box {
    background: #ecfdf5;
    border: 2px solid #a7f3d0;
}

.offpeak-box h3 {
    color: #059669;
    margin-bottom: 8px;
    font-size: 14px;
}

.offpeak-box .time {
    font-size: 22px;
    font-weight: 700;
    color: #065f46;
}

.offpeak-box p {
    font-size: 12px;
    color: #047857;
    margin: 8px 0 0;
}

/* ========================================
   CONTACT BOX
======================================== */
.contact-box {
    background: linear-gradient(135deg, var(--maroon) 0%, var(--dark-maroon) 100%);
    color: var(--white);
    padding: 20px;
    border-radius: 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin: 12px 0;
}

.contact-item {
    flex: 1;
    min-width: 180px;
}

.contact-item h3 {
    margin: 0 0 6px;
    font-size: 12px;
    opacity: 0.85;
    font-weight: 400;
}

.contact-item p {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: var(--white);
}

.contact-item i {
    margin-right: 6px;
}

/* ========================================
   FAQ
======================================== */
.faq-item {
    background: #f8fafc;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 12px;
    border-left: 4px solid var(--blue);
}

.faq-item h3 {
    color: var(--text-dark);
    font-size: 14px;
    margin: 0 0 8px;
}

.faq-item p {
    margin: 0;
    font-size: 13px;
    color: var(--dark-gray);
}

/* ========================================
   FOOTER
======================================== */
footer {
    background: var(--brown);
    color: var(--white);
    padding: 20px 5%;
    margin-top: 25px;
    text-align: center;
}

.footer-social {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 15px;
}

.footer-social a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: var(--gray);
    transition: 0.3s;
}

.footer-social a:hover {
    background: var(--orange);
    color: var(--white);
    transform: translateY(-3px);
}

.footer-social svg {
    width: 20px;
    height: 20px;
}

.footer-links {
    margin-bottom: 15px;
}

.footer-links a {
    color: var(--gray);
    text-decoration: none;
    font-size: 14px;
    margin: 0 15px;
    transition: 0.3s;
}

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

.copyright {
    font-size: 12px;
    color: var(--gray);
}

/* ========================================
   MOBILE RESPONSIVE
======================================== */
@media (max-width: 768px) {
    header {
        padding: 8px 4%;
    }

    .logo img {
        height: 32px;
    }

    .logo-text {
        font-size: 15px;
    }

    nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--brown);
        flex-direction: column;
        padding: 15px;
        box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
        z-index: 1000;
    }

    nav.active {
        display: flex;
    }

    nav a {
        padding: 10px 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .menu-toggle {
        display: block;
    }

    .hero {
        padding: 35px 4% 30px;
    }

    .search-section {
        margin-top: -20px;
    }

    .hero h1 {
        font-size: 24px;
    }

    .hero p {
        font-size: 14px;
    }

    .bill-card {
        padding: 25px 20px;
    }

    .features-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .section {
        padding: 25px 20px;
    }

    .section h2 {
        font-size: 18px;
    }

    .toc ul {
        column-count: 1;
    }

    .toc-dropdown ul {
        column-count: 1;
    }

    .function-grid,
    .breakdown-grid,
    .hours-container,
    .tax-grid {
        grid-template-columns: 1fr;
    }

    .contact-box {
        flex-direction: column;
        gap: 15px;
    }

    .styled-table {
        font-size: 12px;
    }

    .styled-table th,
    .styled-table td {
        padding: 8px 10px;
    }
}

@media (max-width: 480px) {
    .ref-input {
        font-size: 16px;
        padding: 12px 12px 12px 45px;
    }

    .btn-primary {
        padding: 12px;
        font-size: 15px;
    }

    .section h2 {
        font-size: 17px;
    }

    .breakdown-card,
    .payment-method {
        padding: 18px;
    }

    .footer-links a {
        display: block;
        margin: 8px 0;
    }
}

/* ========================================
   RESPONSIVE IMAGE & LAYOUT FIXES
======================================== */

/* Force all images to be responsive */
img,
.section img,
.content-wrapper img {
    max-width: 100% !important;
    width: auto !important;
    height: auto !important;
    display: block;
    margin: 12px auto;
    border-radius: 8px;
    box-sizing: border-box;
}

/* Ensure sections contain images properly */
.section {
    overflow: hidden;
    word-wrap: break-word;
}

/* TOC Responsive Fix */
.toc ul {
    padding-left: 0;
}

.toc li {
    word-wrap: break-word;
}

/* Table Responsive Fix */
.table-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Content wrapper full width fix */
.content-wrapper {
    max-width: 1400px;
    width: 90%;
    margin: 0 auto;
    padding: 15px 20px;
    box-sizing: border-box;
}

/* Mobile Media Query Enhancements */
@media (max-width: 768px) {
    .content-wrapper {
        padding: 15px 3%;
    }

    .section {
        padding: 20px 15px;
    }

    .section img {
        max-width: 100% !important;
        width: 100% !important;
        margin: 15px 0;
    }

    .toc ul {
        column-count: 1;
    }

    .styled-table th,
    .styled-table td {
        padding: 8px 6px;
        font-size: 12px;
    }

    .function-grid,
    .breakdown-grid,
    .tax-grid,
    .hours-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .content-wrapper {
        padding: 10px 3%;
    }

    .section {
        padding: 15px 12px;
        border-radius: 12px;
    }

    .section h2 {
        font-size: 16px;
    }

    .section p {
        font-size: 13px;
    }

    .styled-table {
        font-size: 11px;
    }

    .styled-table th,
    .styled-table td {
        padding: 6px 4px;
    }
}
