/* ======================================
   FINDMEWEAR - CONSOLIDATED BASE CSS
   ======================================
   
   This stylesheet contains all shared styles
   across the findmewear informational pages.
   
   TABLE OF CONTENTS:
   1. Reset & Base Styles
   2. Layout & Containers
   3. Typography 
   4. Header & Navigation
   5. Footer
   6. Components (Accordions, Panels, Tables)
   7. Utility Classes
   8. Media Queries
   9. Force Light Mode
*/

/* ======================================
   1. Reset & Base Styles
   ====================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Lato', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: #f5f5f7;
    margin: 0;
    padding: 0;
    line-height: 1.5;
    color: #1d1d1f;
}

/* ======================================
   2. Layout & Containers
   ====================================== */
.container {
    max-width: 900px;
    margin: 40px auto;
    padding: 40px;
    background-color: white;
    border-radius: 18px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

/* Wider container for size guide page */
.container-wide {
    max-width: 1000px;
}

/* ======================================
   3. Typography 
   ====================================== */
h1, h2, h3, h4, h5, h6 {
    color: #1d1d1f;
    font-weight: 600;
    letter-spacing: -0.3px;
}

p {
    margin-bottom: 15px;
    line-height: 1.6;
    color: #515154;
}

ul, ol {
    margin-left: 20px;
    margin-bottom: 20px;
}

li {
    margin-bottom: 10px;
    color: #515154;
}

/* ======================================
   4. Header & Navigation
   ====================================== */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.header h1 {
    font-weight: 600;
    font-size: 32px;
    color: #1d1d1f;
    letter-spacing: -0.5px;
}

.header img {
    height: 59px;
    width: auto;
    border-radius: 8px;
}

.header.center-logo a:hover {
    opacity: .5; /* Subtle hover effect */
}

.back-link {
    margin-bottom: 40px;
    font-size: 15px;
    font-weight: 600;
}

.back-link a {
    color: #F28CA5;
    text-decoration: none;
    transition: opacity 0.2s;
}

.back-link a:hover {
    opacity: 0.8;
    text-decoration: underline;
}

/* ======================================
   5. Footer
   ====================================== */
.footer-banner {
    background-color: #1d1d1f;
    color: white;
    padding: 20px;
    margin: 30px -40px -40px -40px;
    margin-top: 30px;
    border-radius: 0 0 18px 18px; /* Match the bottom border radius of your container */
}

.footer-links {
    display: flex;
    justify-content: flex-end;
    gap: 20px;
    margin-bottom: 10px;
}

.footer-links a {
    color: white;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: #F9B3C0;
}

.footer-text {
    text-align: right;
    font-size: 12px;
    color: #86868b;
}

/* ======================================
   6. Components
   ====================================== */

/* --- 6.1 Policy Sections --- */
.policy-section {
    margin-bottom: 30px;
    padding: 20px 25px;
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border-left: 4px solid #b9b9b9;
}

.policy-section h2 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
    letter-spacing: -0.3px;
    color: #1d1d1f;
}

.policy-section h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 15px 0 10px 0;
    color: #1d1d1f;
}

.policy-date {
    margin-bottom: 20px;
    font-style: italic;
    color: #515154;
}

/* --- 6.2 Accordion & Panels --- */
.accordion {
    background-color: white;
    color: #1d1d1f;
    cursor: pointer;
    padding: 20px 25px;
    width: 100%;
    border: none;
    outline: none;
    font-family: inherit;
    transition: 0.3s;
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: left;
    margin-bottom: 15px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border-left: 4px solid #F9B3C0;
}

.accordion h2 {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    letter-spacing: -0.3px;
}

.accordion.active, .accordion:hover {
    background-color: #f8f8fa;
}

.accordion.active {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    margin-bottom: 0;
}

.chevron {
    margin-left: 15px;
    font-size: 16px;
    color: #F9B3C0;
    transition: transform 0.3s ease;
}

.accordion.active .chevron {
    transform: rotate(180deg);
}

/* Panel styles */
.panel {
    background-color: white;
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.3s ease;
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    margin-bottom: 15px;
}

.panel-content {
    padding: 0 25px 25px 25px;
}

/* --- 6.3 Sub-accordions --- */
.sub-accordion {
    background-color: transparent;
    color: #1d1d1f;
    cursor: pointer;
    padding: 10px 0;
    width: 100%;
    border: none;
    outline: none;
    font-family: inherit;
    transition: 0.2s;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin-bottom: 5px;
    text-align: left;
    border-bottom: 1px solid #f0f0f2;
}

.sub-accordion h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    letter-spacing: -0.2px;
}

.sub-accordion:hover {
    color: #F28CA5;
}

.sub-accordion.active {
    margin-bottom: 0;
}

.sub-panel {
    background-color: transparent;
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.3s ease;
    margin-bottom: 0;
}

.sub-panel-content {
    padding: 5px 0 15px 26px; /* Add left padding to align with the text */
    background-color: transparent;
}

.sub-chevron {
    margin-right: 12px;
    font-size: 14px;
    color: #F9B3C0;
    transition: transform 0.3s ease;
}

.sub-accordion.active .sub-chevron {
    transform: rotate(90deg);
}

/* --- 6.4 Sizing Tables --- */
.sizing-tables {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin: 30px 0;
}

.sizing-table {
    width: 100%;
    border-collapse: collapse;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
}

.sizing-table th, .sizing-table td {
    border: none;
    padding: 12px;
    text-align: center;
}

.sizing-table tr:not(:last-child) td,
.sizing-table tr:not(:last-child) th {
    border-bottom: 1px solid #e5e5e7;
}

.sizing-table th {
    background-color: #f5f5f7;
    font-weight: 600;
}

.sizing-table tr:hover td {
    background-color: #f9cfd7;
}

/* --- 6.5 Content Sections --- */
.content-section {
    margin-bottom: 40px;
}

.content-section h2 {
    font-size: 24px;
    margin-bottom: 20px;
    letter-spacing: -0.3px;
}

/* --- 6.6 Measurement Image --- */
.measurement-image {
    width: 100%;
    max-width: 500px;
    margin: 0 auto 40px;
    display: block;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
}

/* --- 6.7 Back to Top Button --- */
#back-to-top {
    display: none;
    position: fixed;
    bottom: 30px;
    right: calc(50% - 450px - 70px); /* Half screen width minus half container width minus button offset */
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: #F28CA5;
    color: white;
    border: none;
    cursor: pointer;
    z-index: 1000;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: background-color 0.3s, opacity 0.3s;
    opacity: 0.85;
}

#back-to-top:hover {
    background-color: #1d1d1f;
    color: #F9B3C0;
    opacity: 1;
}

#back-to-top i {
    font-size: 20px;
}

/* ======================================
   7. Utility Classes
   ====================================== */
.italic {
    font-style: italic;
}

.underline {
    text-decoration: underline;
}

.bold {
    font-weight: 600;
}

.support-link {
    color: #F28CA5;
    text-decoration: none;
    transition: opacity 0.2s;
}

.support-link:hover {
    opacity: 0.8;
    text-decoration: underline;
}

/* ======================================
   8. Media Queries
   ====================================== */
@media only screen and (max-width: 1040px) {
    #back-to-top {
        right: 30px; /* Fall back to fixed position on smaller screens */
    }
}

@media only screen and (max-width: 768px) {
    .header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    /* Change the order of the elements */
    .header h1 {
        order: 2;
        font-size: 24px;
        margin-top: 15px;
    }
    
    /* Logo container - comes first in mobile view */
    .header a {
        order: 1;
        align-self: flex-start;
    }
    
    /* Center logo option */
    .header.center-logo a {
        align-self: center;
        width: 100%;
        text-align: center;
    }

    .container {
        margin: 20px;
        padding: 25px;
        border-radius: 12px;
    }

    .footer-banner {
        margin: 20px -25px -25px -25px;
        padding: 15px;
    }

    .footer-links {
        justify-content: center;
    }

    .footer-text {
        text-align: center;
    }
    
    /* Accordion mobile styles */
    .accordion {
        padding: 15px 20px;
    }

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

    .panel-content {
        padding: 0 20px 20px 20px;
    }
    
    /* Sub-accordion mobile styles */
    .sub-accordion {
        padding: 8px 0;
    }
    
    .sub-accordion h3 {
        font-size: 15px;
    }
    
    .sub-panel-content {
        padding: 5px 0 15px 24px;
    }
    
    .sub-chevron {
        margin-right: 10px;
        font-size: 12px;
    }
    
    /* Sizing tables mobile styles */
    .sizing-tables {
        grid-template-columns: 1fr;
    }
    
    /* Policy section mobile styles */
    .policy-section {
        padding: 15px 20px;
    }

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

/* ======================================
   9. Force Light Mode
   ====================================== */
@media (prefers-color-scheme: dark) {
    :root {
        color-scheme: light;
    }
    
    /* Override background colors */
    body { 
        background-color: #f5f5f7 !important; 
    }
    
    .container,
    .policy-section,
    .panel {
        background-color: white !important;
    }
    
    /* Override text colors */
    h1, h2, h3, h4, h5, h6 {
        color: #1d1d1f !important;
    }
    
    p, li { 
        color: #515154 !important; 
    }
    
    /* Keep footer styles intact */
    .footer-banner {
        background-color: #1d1d1f !important;
    }
    
    .footer-links a {
        color: white !important;
    }
    
    .footer-text {
        color: #86868b !important;
    }
    
    /* Sub-accordion light mode overrides */
    .sub-accordion {
        background-color: transparent !important;
        color: #1d1d1f !important;
    }
    
    .sub-panel-content {
        background-color: transparent !important;
    }
    
    .sub-accordion:hover {
        color: #F28CA5 !important;
    }
}