/* --- Basic Setup & Colors --- */
:root {
--font-main: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
--bg-light: #f4f7f6;
--text-dark: #1a1a1a;
--text-light: #f9f9f9;
--text-secondary: #555;

--c-met-score: #00a8e8;
--c-working: #007ea7;
--c-target: #003459;

--c-l0-year7: #ff6699;
--c-l0-year8: #92d050;
--c-l0-year9: #ff6600;
--c-l0-year10: #666666;
--c-l0-year11: #ffc000;

--c-l0-dark-blue: #25408D;
--c-l0-green: #19834C;
--c-l0-yellow: #FBBB2E;
--c-l0-purple: #820163;

--c-l1-light-blue: #89c2d9;
--c-l1-green-light: #a9d6a7;
--c-l1-green-dark: #52a16a;

--c-status-r: #e76f51; /* Red */
--c-status-a: #f4a261; /* Amber/Orange */
--c-status-g: #2a9d8f; /* Green */
--c-status-default: #d9d9d9;

--shadow: 0 4px 12px rgba(0,0,0,0.05);
--radius: 8px;
}




* {
box-sizing: border-box;
margin: 0;
padding: 0;
}

body {
font-family: var(--font-main);
background-color: var(--bg-light);
color: var(--text-dark);
-webkit-font-smoothing: antialiased;
}

.hidden {
display: none !important;
}

/* --- Styles from firestoreTest --- */
#auth-container {
    width: 100%;
    max-width: 1000px; /* Optional: Sets a max width for the overall page */
}

/* Blue Header Area */
#header-area {
    position: fixed;
    top: 100px;
    width: 100%;
    height: 45%;
    background-color: #004980; /* Dark Blue */
    color: white;
    padding: 40px 20px;
    text-align: center;
    box-shadow: 0 0 50px 20px #01B6FF;
}

#header-area h1 {
    margin-top: 10px;
    font-size: 2.5rem;
    font-weight: 200;
}

#header-area h1 strong {
    font-size: 2.5rem;
    font-weight: 700;
}

#logo {
    width: 120px; /* Adjust as needed for your logo */
    height: auto;
    margin-bottom: 10px;
}

#google-sign-in-btn {
    background-color: #f7f7f7;
    color: #333;
    border: none;
    border-radius: 4px;
    padding: 10px 20px;
    font-size: 16px;
    cursor: pointer;
    margin-top: 30px;
    transition: transform 0.2s;
    /* Mimic the button style from the image */
    box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.5);
}

#google-sign-in-btn:hover {
    transform: scale(1.04);
    background-color: #dddddd;
}


#loading-message {
    font-size: 1.8rem;
    font-weight: bold;
    color: white;
    margin-top: 20px;
}

#error-message {
    font-size: 1em;
    font-weight: bold;
    color: red; /* Use a prominent color for errors */
    background-color: white;
    padding: 10px;
    margin-top: 20px;
    border-radius: 4px;
}

/* --- Loader & Error --- */
.loader-container, .error-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    text-align: center;
}
.loader {
    border: 6px solid #f3f3f3;
    border-top: 6px solid var(--c-working);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite; 
}
.loader-container p {
    margin-top: 1rem;
    font-weight: 600;
    color: var(--text-light);
}
.error-container h2 {
    color: var(--c-status-r);
    margin-bottom: 0.5rem;
}
.error-container p {
    color: var(--text-secondary);
    line-height: 1.5;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* --- Header ---*/
header {
display: flex;
align-items: center;
padding: 1rem 1.5rem;
background-color: #ffffff;
border-bottom: 1px solid #e0e0e0;
position: sticky;
top: 0;
z-index: 100;
}
header .logo {
height: 60px;
width: auto;
margin-right: 0.5rem;
flex-shrink: 0;
transition: transform 0.2s;
}
header .logo:hover {
    transform: scale(1.04); /* Slight zoom effect on hover */
}
header h1 {
margin: 0;
font-size: 1.75rem;
font-weight: 400;
color: #1a1a1a;
/* This is the "safe" centering for mobile */
flex-grow: 1; 
text-align: center;
margin-left: 20px;

/* This is new: for smooth transition */
position: static; 
transform: none;
z-index: 1;
}
header h1 span{
font-weight: 700;
color: var(--c-working);
}

/* --- Main Content Wrapper --- */
.content-wrapper {
max-width: 900px;
margin: 0 auto;
padding: 1.5rem;
}

.report-title {
font-size: 1.75rem;
font-weight: 900;
margin-bottom: 1.5rem;
}
.report-title span {
color: var(--c-working);
}

strong {
font-size: 1.5rem;
font-weight: 900;
}

/* --- Metrics Grid (Top Scores) --- */
.metrics-grid {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 1rem;
margin-bottom: 1rem;
}
.metric-card {
padding: 1rem;
border-radius: var(--radius);
color: var(--text-light);
box-shadow: var(--shadow);
align-items: center;
text-align: center;
}
.metric-card span {
display: block;
font-size: 1.25rem;
font-weight: 600;
opacity: 0.9;
}
.metric-card strong {
display: block;
font-size: 2.5rem;
font-weight: 900;
line-height: 1.2;
}
.metric-card.met-score { background-color: var(--c-met-score); }
.metric-card.working-towards { background-color: var(--c-working); }
.metric-card.target { background-color: var(--c-target); }

/* --- Links Grid --- */
.links-grid {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 1rem;
margin-bottom: 2rem;
}
.link-card {
display: flex;
align-items: center;
padding: 1rem;
background-color: #808080;
border-radius: var(--radius);
box-shadow: var(--shadow);
text-decoration: none;
color: var(--text-dark);
font-size: 1.25rem;
line-height: 1.3;
font-weight: 600;
transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.link-card:hover {
transform: scale(1.02);
box-shadow: 0 6px 16px rgba(0,0,0,0.08);
}
.link-logo {
width: 102px;
height: 70px;
border-radius: 6px;
margin-right: 0.75rem;
/*background-color: var(--bg-light)*/;
flex-shrink: 0;
}

/* --- Drill-Down Categories --- */
.explore-title {
font-size: 1.25rem;
font-weight: 400;
margin-bottom: 1rem;
color: var(--text-dark);
}

#categories-container {
display: grid;
grid-template-columns: 1fr;
gap: 1rem;
}

.tests-grid {
margin-top: 1.5rem;
}

#tests-container {
display: grid;
grid-template-columns: 1fr;
gap: 1rem;
}

/* Styles for the Main Concertina */
/* Level 0 Item (e.g., "Number & Ratio") */
.category-l0 {
display: flex;
justify-content: space-between;
align-items: center;
padding: 1.25rem 1.5rem;
border-radius: var(--radius);
color: var(--text-light);
font-size: 1.75rem;
font-weight: 700;
cursor: pointer;
box-shadow: var(--shadow);
transition: transform 0.2s ease;
}
.category-l0:hover {
transform: scale(1.02);
}
.category-l0 span {
font-size: 2.5rem;
font-weight: 900;
color: var(--text-dark);
background-color: rgba(255,255,255,0.5);
padding: 0.3rem 0.6rem;
border-radius: 8px;
}

.progress-bar-container {
/* Set the size and background for the outer bar track */
width: 120px; /* Adjust as needed */
height: 35px;
background-color: rgba(255,255,255,0.6); /* Light track background */
/*border: 3px solid rgba(100,100,100,0.4);*/
border-radius: 8px; /* Rounded corners */
/*box-sizing: content-box;*/
box-shadow: inset 3px 3px 4px rgba(0, 0, 0, 0.8);
overflow: hidden; /* Important: keeps the fill inside the rounded corners */
}

.progress-bar-container span {
/* Style for the inner, coloured progress */
display: block; /* Make it take up the full height */
height: 100%;
background-color: #47D45A; /* Green colour for the progress */
min-width: 0;
border-radius: 8px; /* Rounded corners */
box-shadow: inset 3px 3px 4px rgba(0, 0, 0, 0.8);
/*transition: width 0.5s ease; /* Smooth transition when the width changes */
}


/* Level 1 Container (Hidden by default) */
.category-l1-container {
padding: 1rem;
background-color: #ffffff;
border-radius: var(--radius);
margin-top: -0.5rem; /* Overlaps with L0 slightly */
box-shadow: var(--shadow);
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: 1rem;
}

/* Level 1 Item (e.g., "Numeracy") */
.category-l1-item {
display: flex;
justify-content: space-between;
align-items: center;
padding: 1rem 1.25rem;
border-radius: var(--radius);
color: var(--text-light);
font-size: 1.5rem;
font-weight: 300;
cursor: pointer;
box-shadow: var(--shadow);
transition: transform 0.2s ease;
}
.category-l1-item:hover {
transform: scale(1.02);
}
.category-l1-item strong {
font-weight: 700;
}
.category-l1-item span {
font-size: 2rem;
font-weight: 900;
background-color: rgba(255,255,255,0.5);
color: var(--text-dark);
padding: 0.3rem 0.6rem;
border-radius: 8px;
}

/* Level 2 Container (Hidden by default) */
.category-l2-container {
/* Spans both columns of the L1 grid */
grid-column: 1 / -1; 
display: grid;
grid-template-columns: 1fr;
gap: 0.2rem;
padding: 0.5rem;
background-color: var(--bg-light);
/*border-radius: var(--radius);*/
max-height: 280px;
overflow-y: auto;
}

/* Level 2 Item (e.g., "35n Find HCF...") */
.category-l2-item {
padding: 0.25rem 0.5rem;
/*border-radius: 8px;*/
font-weight: 400;
color: var(--text-dark);
background-color: var(--c-status-default);
border: 2px solid rgba(0,0,0,0.1);
}
.category-l2-item strong {
display: inline-block;
font-size: 1rem;
width: 3rem; /* Aligns the text */
font-weight: 900;
}
/* Makes the L2 links interactive */
.category-l2-link {
text-decoration: none; /* Removes the default underline */
cursor: pointer;
transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.category-l2-link:hover {
transform: scale(1.02);
box-shadow: 0 4px 10px rgba(0,0,0,0.07); /* Adds a subtle shadow */
}

/* --- Color Themes --- */
.color-dark-blue { background-color: var(--c-l0-dark-blue); }
.color-green { background-color: var(--c-l0-green); }
.color-yellow { background-color: var(--c-l0-yellow); }
.color-purple { background-color: var(--c-l0-purple); }

.color-light-blue { background-color: var(--c-l1-light-blue); }
.color-green-light { background-color: var(--c-l1-green-light); }
.color-green-dark { background-color: var(--c-l1-green-dark); color: var(--text-light); }
.color-green-dark span { color: var(--text-light); }

/* Skill Status Colors */
.status-r { background-color: #FFFFFF; color: #FF0000; border-color: #FF0000; }
.status-g { background-color: #47D45A; color: #000000; border-color: #47D45A; }
.status-u { background-color: #D9D9D9; color: #7F7F7F; border-color: #D9D9D9; }

/* --- Revision Widget Styles --- */

/* --- Multi State Styles (2 or 3 Items) --- */

.revise-box.multi-state {
    background-color: #BDBDBD;
    border-radius: var(--radius);
    padding: 1rem;
    box-shadow: var(--shadow);
    text-decoration: none;
    text-align: center;
    color: #000000;
    font-size: 1.25rem;
    font-weight: 600;
    width: 100%;
}

.revise-title {
    color: #000000;
    padding: 0.5rem;
    font-size: 1.25rem;
    font-weight: 600;
}

/* Grid to hold the buttons */
.button-grid {
    display: grid;
    grid-gap: 0.75rem;
    /* This automatically adjusts columns based on how many buttons exist */
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
}

/* The individual paper buttons */
.paper-btn {
    background-color: #616161;
    color: #f0f0f0;
    text-decoration: none;
    padding: 0.5rem;
    border-radius: var(--radius);
    font-size: 1.25rem;
    display: block;
    transition: transform 0.1s;
}
.paper-btn strong {
    font-size: 1.5rem;
    font-weight: 900;
}

.paper-btn:nth-of-type(1) {
    background-color: #333333; /* Darkest */
}
.paper-btn:nth-of-type(2) {
    background-color: #555555; /* Medium */
}
.paper-btn:nth-of-type(3) {
    background-color: #777777; /* Lightest */
}

.paper-btn:hover {
    transform: scale(1.04);
}

/* --- Banner Styles --- */
.top-banner {
    width: 100%;
    background-color: #E3F2FD; /* Light Blue */
    color: #0D47A1;            /* Dark Blue Text */
    padding: 12px 20px;
    box-sizing: border-box;
    display: flex;
    justify-content: center;   /* Centers the main text */
    align-items: center;
    position: relative;        /* Needed to position the X absolutely if desired, or use flex */
    border-bottom: 1px solid #BBDEFB;
    font-size: 1rem;
}

.top-banner a {
    color: #1565C0;
    font-weight: bold;
    text-decoration: underline;
    margin-left: 5px;
}

.top-banner a:hover {
    color: #0D47A1;
}

/* The 'X' Close Button */
.close-btn {
    position: absolute;
    right: 20px;
    background: none;
    border: none;
    font-size: 24px;
    color: #0D47A1;
    cursor: pointer;
    line-height: 1;
    padding: 0 5px;
}

.close-btn:hover {
    color: #d32f2f; /* Red on hover */
}

/* --- Responsive Mobile Layout --- */
@media (min-width: 768px) {
header h1 {
    /* This is the "true center" style */
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    
    /* We reset the mobile styles */
    flex-grow: 0;
    margin-left: 0;
}
}

@media (max-width: 768px) {
    header h1 {
        font-size: 1.5rem;
    }

    .content-wrapper {
        padding: 1rem;
    }
    .report-title {
        font-size: 1.5rem;
        text-align: center;
    }

    /* Stack top metrics */
    .metrics-grid {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    .metric-card {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.75rem 1.25rem;
    }
    .metric-card span {
        font-size: 1.25rem;
        font-weight: 700;
    }
    .metric-card strong {
        font-size: 1.75rem;
    }

    /* Stack links */
    .links-grid {
        grid-template-columns: 1fr;
        gap: 0.5rem;
        margin-bottom: 1.5rem;
    }
    .link-card {
        padding: 0.75rem 1.25rem;
        font-size: 1.25rem;
    }
    .revise-box.multi-state {
        padding: 0.75rem 1.25rem;
        font-size: 1.25rem;
    }
    .revise-title{
        font-size: 1.25rem;
    }
    .paper-btn {
        padding: 0.75rem 1.25rem;
        font-size: 1.25rem;
    }


    .explore-title {
        text-align: center;
    }

    /* Stack L1 categories */
    .category-l1-container {
        grid-template-columns: 1fr;
        gap: 0.5rem;
        padding: 0.5rem;
    }
    .category-l0 {
        padding: 1rem 1.25rem;
        font-size: 1.5rem;
    }
    .category-l0 span {
        font-size: 1.75rem;
    }
    .category-l1-item {
        padding: 1rem 1.25rem;
        font-size: 1.25rem;
    }
    .category-l1-item span {
        font-size: 1.5rem;
    }

    #tests-container {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    .test-l0 {
        padding: 0.5rem 1.25rem;
        font-size: 1.25rem;
    }
    .test-l0 span {
        font-size: 1.75rem;
    }
}