/*
Title: style.css
Version: 3.6
Folder: C:\Users\Admin-Portable\Documents\Laragon\www\Homeschool-Island\css\
Description: Main stylesheet for Homeschool Island. Updated dark mode selector to target html element for FOUC prevention. Added explicit styles for printable-grid and printable-card. Added dark mode CSS for date picker icon.
*/

/* ============================================================
   1. THEME VARIABLES — LIGHT MODE
   ============================================================ */

:root {
    /* Brand Colors */
    --primary-blue: #1800AD;
    --magenta: #E516B1;
    --orange: #FBB03B;
    --light-pink: #F470BF;
    
    /* Added missing variables for admin buttons/headers */
    --dark-gray: #2C3E50;
    --primary-green: #27AE60;

    /* Primary Text */
    --text-primary: #333333;
    --text-secondary: #666666;
    --text-on-brand: #FFFFFF;

    /* Page & Surface Colors */
    --surface-page: #F9F9F9;
    --surface-card: #FFFFFF;
    --surface-secondary: #F4F4F4;

    /* Borders */
    --border: #DDDDDD;

    /* Footer
       Footer intentionally follows the same theme as the page.
    */
    --footer-bg: #F4F4F4;
    --footer-text: #333333;
    --footer-link: #1800AD;

    /* Shadows */
    --shadow-color: rgba(0, 0, 0, 0.10);
    --card-shadow: rgba(0, 0, 0, 0.05);

    /* Typography */
    --font-heading: 'DM Serif Display', serif;
    --font-logo-homeschool: 'Archivo Black', sans-serif;
    --font-body: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;

    /* Theme Transition */
    --theme-transition:
        background-color 0.3s ease,
        color 0.3s ease,
        border-color 0.3s ease,
        box-shadow 0.3s ease;
}

/* ============================================================
   2. DARK MODE
   ============================================================ */

html.dark-mode,
body.dark-mode {

    /* Brand Colors */
    --primary-blue: #A89CF0;
    --magenta: #FF6AC2;
    --orange: #FFD180;
    --light-pink: #F470BF;
    
    /* Added missing variables for admin buttons/headers */
    --dark-gray: #2C2C2C;
    --primary-green: #4CAF50;

    /* Primary Text */
    --text-primary: #E0E0E0;
    --text-secondary: #BDBDBD;
    --text-on-brand: #FFFFFF;

    /* Page & Surface Colors */
    --surface-page: #121212;
    --surface-card: #1F1F1F;
    --surface-secondary: #2C2C2C;

    /* Borders */
    --border: #404040;

    /* Footer
       Footer remains dark in dark mode.
    */
    --footer-bg: #1F1F1F;
    --footer-text: #E0E0E0;
    --footer-link: #A89CF0;

    /* Shadows */
    --shadow-color: rgba(0, 0, 0, 0.40);
    --card-shadow: rgba(0, 0, 0, 0.35);
}

/* ============================================================
   3. GLOBAL RESET & BASE STYLES
   ============================================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    color: var(--text-primary);
    background-color: var(--surface-page);

    line-height: 1.7;
    font-size: 17px;

    transition:
        background-color 0.3s ease,
        color 0.3s ease;
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    line-height: 1.3;
    margin-bottom: 15px;
    color: var(--text-primary);
}

h1 {
    font-size: 2.5rem;
}

h2 {
    font-size: 2rem;
}

h3 {
    font-size: 1.6rem;
}

h4 {
    font-size: 1.3rem;
}

p {
    margin-bottom: 15px;
}

a {
    text-decoration: none;
    color: var(--primary-blue);
    transition: color 0.3s ease;
}

a:hover {
    color: var(--magenta);
}

/* Accessibility: Focus visible for keyboard navigation */
a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--primary-blue);
    outline-offset: 2px;
    border-radius: 4px;
}


/* ============================================================
   4. FORM CONTROL RESETS
   ============================================================ */

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
}


/* ============================================================
   5. LAYOUT HELPERS
   ============================================================ */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.content-spacing {
    margin-bottom: 40px;
    padding: 20px;
}


/* ============================================================
   6. CARDS & GRID
   ============================================================ */

.card {
    background-color: var(--surface-card);
    padding: 25px;

    border-radius: 10px;
    border: 1px solid var(--border);

    box-shadow: 0 4px 6px var(--card-shadow);

    margin-bottom: 25px;

    transition:
        background-color 0.3s ease,
        border-color 0.3s ease,
        box-shadow 0.3s ease,
        color 0.3s ease;
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
}

/* Printable Grid specific to Freebies & Printables page */
.printable-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 40px; /* Increased gap for better separation */
    margin-top: 20px;
}

.printable-card {
    background-color: var(--surface-card);
    padding: 25px;
    border-radius: 10px;
    border: 1px solid var(--border);
    box-shadow: 0 4px 6px var(--card-shadow);
    transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, color 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 15px;
}


/* ============================================================
   7. FORM & FILTER STYLING (Refactored for Cleaner Specificity)
   ============================================================ */

.filter-form {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 20px;
}

.filter-form .form-group {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 200px;
}

.filter-form label {
    font-weight: bold;
    margin-bottom: 8px;
    font-size: 1rem;
    color: var(--text-primary);
}

/* Global Input Styles - Handles all standard inputs across the site */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"], /* Added for Contest Manager */
textarea,
select {
    width: 100%;
    padding: 12px;
    font-size: 1.05rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    box-sizing: border-box;
    font-family: var(--font-body);
    background-color: var(--surface-card);
    color: var(--text-primary);
    transition:
        background-color 0.3s ease,
        border-color 0.3s ease,
        color 0.3s ease;
}

/* Correct cursor types for UX */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
textarea {
    cursor: text;
}

select {
    cursor: pointer;
}

textarea {
    resize: vertical;
}

/* Unified Focus State */
input:focus,
textarea:focus,
select:focus {
    outline: 2px solid var(--light-pink);
    outline-offset: 1px;
    border-color: var(--light-pink);
}

/* Dark Mode Fix for Date Picker Calendar Icon */
html.dark-mode input[type="date"]::-webkit-calendar-picker-indicator,
body.dark-mode input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1); /* Inverts black icon to white */
    opacity: 0.7; /* Softens it slightly for better aesthetics */
    cursor: pointer;
}


/* ============================================================
   8. HEADER & NAVIGATION
   ============================================================ */

header {
    background-color: var(--surface-card);

    box-shadow: 0 2px 5px var(--shadow-color);

    position: sticky;
    top: 0;
    z-index: 1000;

    transition:
        background-color 0.3s ease,
        box-shadow 0.3s ease;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;

    max-width: 1200px;
    margin: 0 auto;

    padding: 10px 20px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-img {
    height: 40px;
    width: auto;
}

.logo-text-homeschool {
    font-family: var(--font-logo-homeschool);

    color: var(--text-primary);

    font-size: 1.5rem;
}

.logo-text-island {
    font-family: var(--font-heading);

    color: var(--primary-blue);

    font-size: 1.6rem;
}


/* ============================================================
   9. NAVIGATION LINKS
   ============================================================ */

.nav-links {
    display: flex;
    list-style: none;
    align-items: center;
}

.nav-links > li {
    position: relative;
    padding: 10px 15px;
}

.nav-links a {
    color: var(--text-primary);

    font-weight: 600;
    text-transform: uppercase;

    font-size: 0.95rem;

    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: var(--magenta);
}


/* ============================================================
   10. DROPDOWN MENUS
   ============================================================ */

.dropdown-content {
    display: none;

    position: absolute;

    background-color: var(--surface-card);

    min-width: 200px;

    box-shadow: 0 8px 16px var(--shadow-color);

    z-index: 1001;

    border-radius: 5px;

    top: 100%;
    left: 0;

    transition:
        background-color 0.3s ease,
        box-shadow 0.3s ease;
}

.dropdown-content a {
    color: var(--text-primary);

    padding: 12px 16px;

    display: block;

    text-align: left;

    text-transform: none;

    border-bottom: 1px solid var(--border);
}

.dropdown-content a:last-child {
    border-bottom: none;
}

.dropdown-content a:hover {
    background-color: var(--surface-secondary);
    color: var(--primary-blue);
}

.dropdown:hover .dropdown-content {
    display: block;
}


/* ============================================================
   11. HAMBURGER MENU
   ============================================================ */

.hamburger {
    display: none;

    flex-direction: column;
    justify-content: space-around;

    width: 30px;
    height: 25px;

    background: transparent;
    border: none;

    cursor: pointer;

    z-index: 1002;
}

.hamburger span {
    display: block;

    height: 3px;
    width: 100%;

    background-color: var(--primary-blue);

    border-radius: 2px;

    transition: all 0.3s ease;
}

.hamburger.active span:nth-child(1) {
    transform: translateY(11px) rotate(45deg);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: translateY(-11px) rotate(-45deg);
}


/* ============================================================
   12. THEME TOGGLE BUTTON
   ============================================================ */

.theme-toggle {
    background-color: var(--surface-secondary);

    color: var(--text-primary);

    border: 1px solid var(--border);

    padding: 8px 15px;

    border-radius: 20px;

    cursor: pointer;

    font-weight: 600;
    font-size: 0.85rem;

    transition:
        background-color 0.3s ease,
        color 0.3s ease,
        border-color 0.3s ease;
}

.theme-toggle:hover {
    background-color: var(--primary-blue);
    color: var(--text-on-brand);
}


/* ============================================================
   13. WELCOME RECTANGLE
   ============================================================ */

.welcome-rectangle {
    background-color: var(--surface-secondary);

    border: 3px solid var(--primary-blue);

    border-radius: 15px;

    padding: 40px;

    text-align: center;

    margin: 30px 0;

    background-size: cover;
    background-position: center;

    position: relative;

    transition:
        background-color 0.3s ease,
        border-color 0.3s ease,
        color 0.3s ease;
}

.welcome-rectangle h1 {
    font-family: var(--font-heading);

    color: var(--primary-blue);

    font-size: 2.8rem;

    margin-bottom: 15px;
}

.welcome-rectangle p {
    font-size: 1.15rem;

    max-width: 800px;

    margin: 0 auto 20px auto;

    color: var(--text-primary);
}


/* ============================================================
   14. BUTTONS
   ============================================================ */

.btn {
    display: inline-block;

    background-color: var(--magenta);

    color: var(--text-on-brand);

    padding: 10px 25px;

    border-radius: 25px;

    font-weight: bold;
    text-transform: uppercase;

    transition:
        background-color 0.3s ease,
        color 0.3s ease;

    border: none;

    cursor: pointer;
}

.btn:hover {
    background-color: var(--primary-blue);
    color: var(--text-on-brand);
}


/* ============================================================
   15. FOOTER
   ============================================================

   IMPORTANT:
   The footer is NOT inverted.

   LIGHT MODE:
       Background = light
       Text       = dark

   DARK MODE:
       Background = dark
       Text       = light

   This keeps the footer aligned with the rest of the page.
   ============================================================ */

footer {
    background-color: var(--footer-bg);

    color: var(--footer-text);

    text-align: center;

    /* Footer height reduced by ~15% */
    padding: 34px 20px;

    margin-top: 40px;

    transition:
        background-color 0.3s ease,
        color 0.3s ease;
}

footer ul {
    list-style: none;
}

footer a {
    color: var(--footer-link);

    margin: 0 10px;

    font-size: 0.95rem;

    transition: color 0.3s ease;
}

footer a:hover {
    color: var(--magenta);
}

.footer-links {
    margin-bottom: 15px;
}


/* ============================================================
   16. MOBILE RESPONSIVENESS
   ============================================================ */

@media (max-width: 768px) {

    .hamburger {
        display: flex;
    }

    .nav-links {
        position: fixed;

        top: 0;
        right: -100%;

        height: 100vh;

        width: 75%;
        max-width: 300px;

        background-color: var(--surface-card);

        flex-direction: column;
        align-items: flex-start;

        padding: 60px 20px 20px 20px;

        box-shadow: -2px 0 5px var(--shadow-color);

        transition:
            right 0.4s ease-in-out,
            background-color 0.3s ease;

        overflow-y: auto;
    }

    .nav-links.active {
        right: 0;
    }

    .nav-links li {
        width: 100%;
    }

    .dropdown-content {
        position: static;

        display: none;

        box-shadow: none;

        width: 100%;

        padding-left: 15px;
    }

    .dropdown.active .dropdown-content {
        display: block;
    }

    .logo-text-homeschool,
    .logo-text-island {
        font-size: 1.2rem;
    }

    .logo-img {
        height: 30px;
    }

    .welcome-rectangle h1 {
        font-size: 2rem;
    }

    .welcome-rectangle p {
        font-size: 1rem;
    }

    .grid-container {
        grid-template-columns: 1fr;
    }
    
    .printable-grid {
        grid-template-columns: 1fr;
    }

    .filter-form {
        flex-direction: column;
        align-items: stretch;
    }

    .theme-toggle {
        margin-top: 15px;
        margin-left: 0;

        width: 100%;

        text-align: center;
    }
}


/* ============================================================
   17. PRINT RULES
   ============================================================ */

@media print {

    header,
    footer,
    .btn,
    .hamburger,
    .theme-toggle {
        display: none;
    }

    body {
        color: #000000;
        background: #FFFFFF;
    }

    .welcome-rectangle {
        border: 1px solid #000000;

        background: #FFFFFF;

        color: #000000;
    }

    .welcome-rectangle h1,
    .welcome-rectangle p {
        color: #000000;
    }

    .card {
        background: #FFFFFF;

        color: #000000;

        border-color: #CCCCCC;

        box-shadow: none;
    }

    a {
        color: #000000;
    }
}

/*
End of style.css
Version: 3.6
Folder: C:\Users\Admin-Portable\Documents\Laragon\www\Homeschool-Island\css\
*/