
/* =====================================
   WebHustle Tools — GPA Calculator
===================================== */

:root {
    --gpa-primary: #2563eb;
    --gpa-primary-dark: #1d4ed8;
    --gpa-text: #172033;
    --gpa-muted: #64748b;
    --gpa-border: #e2e8f0;
    --gpa-background: #f5f7fb;
    --gpa-card: #ffffff;
    --gpa-radius: 14px;
    --gpa-shadow: 0 8px 28px rgba(15, 23, 42, 0.06);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: #ffffff;;
    color: #1f2937;
    font-family: Arial, Helvetica, sans-serif;
}

button,
input,
select {
    font: inherit;
}

button {
    cursor: pointer;
}

/* Navigation */

nav {
    position: relative;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 20px 40px;
    border-bottom: 1px solid var(--gpa-border);
}

.logo a {
    color: #1f2937;
    text-decoration: none;
    font-size: 22px;
    font-weight: bold;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 25px;
}

.nav-links > a,
.tools-dropdown-button {
    color: #4b5563;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
}

.nav-links > a:hover,
.tools-dropdown-button:hover {
    color: var(--gpa-primary);
}

.tools-dropdown {
    position: relative;
}

.tools-dropdown-button {
    display: inline-flex;
    align-items: center;
    line-height: 1;
    margin: 0;
    padding: 0;
    background: transparent;
    border: none;
    box-shadow: none;
}
.tools-dropdown-button:hover,
.tools-dropdown-button:focus,
.tools-dropdown-button:active {
    background: transparent;
    box-shadow: none;
}
.tools-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 220px;
    padding: 8px;
    background: white;
    border: 1px solid var(--gpa-border);
    border-radius: 12px;
    box-shadow: var(--gpa-shadow);
}

.tools-dropdown:hover .tools-dropdown-menu,
.tools-dropdown:focus-within .tools-dropdown-menu {
    display: block;
}

.tools-dropdown-menu a {
    display: block;
    padding: 9px 12px;
    color: var(--gpa-text);
    border-radius: 8px;
    text-decoration: none;
}

.tools-dropdown-menu a:hover,
.tools-dropdown-menu a.current-tool {
    background: #eff6ff;
    color: var(--gpa-primary);
}

/* Main page */

.container {
    width: min(100% - 32px, 860px);
    margin: 44px auto 64px;
}

.brand {
    margin: 0 0 6px;
    color: var(--gpa-primary);
    font-size: 0.9rem;
    font-weight: 750;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.container > h1 {
    margin: 0 0 12px;
    font-size: clamp(2rem, 5vw, 2.8rem);
    line-height: 1.15;
    letter-spacing: -0.045em;
}

.container > p {
    color: #475569;
}

.container > h1 + p {
    margin: 0 0 20px;
    font-size: 1.05rem;
}

.privacy {
    margin: 22px 0 30px;
    padding: 13px 16px;
    color: #334155 !important;
    background: #eff6ff;
    border: 1px solid #dbeafe;
    border-radius: 10px;
    font-size: 0.92rem;
}

/* Form cards */

.settings,
.classes,
.result {
    margin: 22px 0;
    padding: 26px;
    background: var(--gpa-card);
    border: 1px solid var(--gpa-border);
    border-radius: var(--gpa-radius);
    box-shadow: var(--gpa-shadow);
}

.settings h2,
.classes h2,
.result h2 {
    margin: 0 0 20px;
    font-size: 1.2rem;
    line-height: 1.4;
    letter-spacing: -0.02em;
}

.settings label,
.weighting-settings label {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 12px 0;
    color: #334155;
}

input[type="radio"] {
    width: 17px;
    height: 17px;
    accent-color: var(--gpa-primary);
}

/* Inputs and dropdowns */

input[type="text"],
input[type="number"],
select {
    width: 100%;
    min-width: 0;
    min-height: 44px;
    padding: 10px 12px;
    color: var(--gpa-text);
    background: white;
    border: 1px solid #cbd5e1;
    border-radius: 9px;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus,
select:focus {
    border-color: var(--gpa-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

input::placeholder {
    color: #94a3b8;
}

/* Class rows */

.class-row {
    display: grid;
    grid-template-columns: 1.35fr 0.8fr 0.65fr 1fr 40px;
    gap: 10px;
    align-items: center;
    margin-bottom: 14px;
}

.remove {
    min-height: 40px;
    color: #b91c1c;
    background: #fef2f2;
    border: 1px solid #fee2e2;
    border-radius: 9px;
    font-weight: 700;
}

.remove:hover {
    background: #fee2e2;
}

/* Buttons */

#addClass,
#calculate,
#shareButton {
    min-height: 46px;
    padding: 11px 18px;
    border-radius: 10px;
    font-weight: 700;
    transition: background 0.15s ease, transform 0.15s ease;
}

#addClass {
    color: var(--gpa-primary);
    background: #eff6ff;
    border: 1px solid #bfdbfe;
}

#addClass:hover {
    background: #dbeafe;
}

#calculate {
    display: block;
    width: 100%;
    margin: 26px 0;
    padding: 15px 20px;
    color: white;
    background: var(--gpa-primary);
    border: none;
    box-shadow: 0 5px 14px rgba(37, 99, 235, 0.18);
}

#calculate:hover {
    background: var(--gpa-primary-dark);
    transform: translateY(-1px);
}

/* Weighted/unweighted settings */

.weighting-settings {
    margin-top: 22px;
}

.weighting-settings .note {
    margin-top: 16px;
    color: var(--gpa-muted);
    font-size: 0.9rem;
}

/* Results */

.result {
    padding: 30px;
    text-align: center;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.result h2 {
    margin-bottom: 8px;
}

#gpaResult {
    margin: 8px 0 18px;
    color: var(--gpa-primary);
    font-size: clamp(2.5rem, 8vw, 3.8rem);
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.05em;
    overflow-wrap: anywhere;
}

.note {
    color: var(--gpa-muted);
    font-size: 0.9rem;
}

/* Explanation sections */

.how-it-works,
.gpa-explanation {
    margin-top: 36px;
    padding: 30px;
    background: var(--gpa-card);
    border: 1px solid var(--gpa-border);
    border-radius: var(--gpa-radius);
    box-shadow: var(--gpa-shadow);
}

.how-it-works h2,
.gpa-explanation h2 {
    margin: 0 0 18px;
    font-size: 1.4rem;
    line-height: 1.4;
    letter-spacing: -0.025em;
}

.how-it-works ol {
    padding-left: 24px;
}

.how-it-works li {
    margin-bottom: 10px;
}

.gpa-explanation p {
    margin: 0 0 18px;
    color: #475569;
}

.gpa-example {
    margin: 28px 0;
    padding: 24px;
    background: #f8fafc;
    border: 1px solid var(--gpa-border);
    border-radius: 12px;
}

.gpa-example h3 {
    margin: 0 0 16px;
    font-size: 1.1rem;
    line-height: 1.45;
}

.gpa-example ul {
    padding-left: 24px;
    margin: 18px 0 0;
}

.gpa-example li {
    margin-bottom: 14px;
    padding-left: 4px;
}

.gpa-example li:last-child {
    margin-bottom: 0;
}

.gpa-disclaimer {
    color: var(--gpa-muted) !important;
    font-size: 0.9rem;
}

/* Share section */

.share-section {
    margin-top: 30px;
    padding: 26px;
    text-align: center;
    background: var(--gpa-card);
    border: 1px solid var(--gpa-border);
    border-radius: var(--gpa-radius);
}

.share-section h2 {
    margin-top: 0;
}

#shareButton {
    color: white;
    background: var(--gpa-primary);
    border: none;
}

#shareButton:hover {
    background: var(--gpa-primary-dark);
}

/* Footer */

footer {
    margin-top: 36px;
    padding: 20px 0;
    color: var(--gpa-muted);
    text-align: center;
    font-size: 0.88rem;
}

/* Back to top */

#backToTop {
    display: none;
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 20;
    width: 46px;
    height: 46px;
    align-items: center;
    justify-content: center;
    color: white;
    background: var(--gpa-primary);
    border: none;
    border-radius: 50%;
    box-shadow: var(--gpa-shadow);
    font-size: 1.3rem;
}

#backToTop:hover {
    background: var(--gpa-primary-dark);
}

/* Utilities */

.hidden {
    display: none !important;
}

/* Mobile layout */

@media (max-width: 700px) {
   
nav {
    position: sticky;
    top: 0;
    z-index: 1000;

    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: nowrap;

    width: 100%;
    padding: 18px 20px;
    gap: 16px;
    background: white;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 14px;
}

.nav-links > a,
.nav-links .tools-dropdown-button {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    color: #4b5563;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    margin: 0;
    padding: 0;
}

.nav-links .tools-dropdown-button {
    background: transparent;
    border: none;
    box-shadow: none;
    cursor: pointer;
}


    .container {
        width: min(100% - 24px, 860px);
        margin: 28px auto 44px;
    }

    .settings,
    .classes,
    .result,
    .how-it-works,
    .gpa-explanation,
    .share-section {
        padding: 20px;
    }

    .class-row {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        padding: 14px;
        background: #f8fafc;
        border: 1px solid var(--gpa-border);
        border-radius: 12px;
    }

    .class-row .class-name {
        grid-column: 1 / -1;
    }

    .class-row .remove {
        width: 100%;
    }

    .gpa-example {
        padding: 18px;
    }
}

@media (max-width: 420px) {
    
    .nav-links {
        gap: 12px;
    }

    .settings,
    .classes,
    .result,
    .how-it-works,
    .gpa-explanation,
    .share-section {
        padding: 16px;
    }

    .class-row {
        grid-template-columns: 1fr;
    }

    .class-row .class-name {
        grid-column: auto;
    }
}
