/* =============================================
   Superior University GPA Calculator
   styles.css — shared across all pages
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
    --primary:       #7a1b6d;
    --primary-dark:  #5a1250;
    --primary-light: #a93a9e;
    --primary-faint: #f5eaf4;
    --text:          #1a1a2e;
    --text-muted:    #555570;
    --text-light:    #888899;
    --bg:            #f4f0f7;
    --white:         #ffffff;
    --border:        #e4dded;
    --shadow-sm: 0 2px 10px rgba(122,27,109,0.07);
    --shadow-md: 0 6px 24px rgba(122,27,109,0.11);
    --shadow-lg: 0 14px 48px rgba(122,27,109,0.17);
    --r-sm: 8px;
    --r-md: 14px;
    --r-lg: 20px;
    --font: 'Plus Jakarta Sans', 'Segoe UI', sans-serif;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    font-size: 15.5px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

/* ===== HEADER ===== */
header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    padding: 13px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 18px rgba(0,0,0,0.18);
    position: sticky;
    top: 0;
    z-index: 200;
}

.logo {
    display: flex; align-items: center; gap: 11px;
    text-decoration: none; color: white;
    font-weight: 700;
}
.logo img {
    width: 44px; height: 44px; border-radius: 50%;
    border: 2.5px solid rgba(255,255,255,0.75);
    object-fit: cover; flex-shrink: 0;
}
.logo-text { display: flex; flex-direction: column; line-height: 1.2; }
.logo-text .name  { font-size: 15px; font-weight: 700; }
.logo-text .sub   { font-size: 10px; opacity: 0.82; font-weight: 500; }

nav { display: flex; gap: 3px; }
nav a {
    color: rgba(255,255,255,0.88);
    text-decoration: none;
    font-size: 13.5px; font-weight: 500;
    padding: 8px 13px; border-radius: var(--r-sm);
    transition: background 0.18s;
    white-space: nowrap;
}
nav a:hover   { background: rgba(255,255,255,0.18); color: white; }
nav a.active  { background: rgba(255,255,255,0.22); color: white; font-weight: 700; }

.hamburger {
    display: none;
    background: rgba(255,255,255,0.15);
    border: none; color: white;
    padding: 8px 10px; border-radius: var(--r-sm);
    font-size: 18px; cursor: pointer; line-height: 1;
    transition: background 0.2s;
}
.hamburger:hover { background: rgba(255,255,255,0.28); }

@media (max-width: 820px) {
    .hamburger { display: block; }
    nav {
        display: none; flex-direction: column; gap: 0;
        position: absolute; top: 100%; left: 0; right: 0;
        background: linear-gradient(180deg, var(--primary-dark) 0%, var(--primary) 100%);
        padding: 6px 0 14px;
        box-shadow: 0 8px 24px rgba(0,0,0,0.2);
    }
    nav.open { display: flex; }
    nav a {
        border-radius: 0; padding: 13px 22px; font-size: 14.5px;
        border-bottom: 1px solid rgba(255,255,255,0.06);
    }
    nav a:last-child { border-bottom: none; }
    .logo-text .name { font-size: 13px; }
    .logo img { width: 38px; height: 38px; }
}

/* ===== MAIN ===== */
main {
    max-width: 960px; margin: 0 auto;
    padding: 34px 20px 60px;
    animation: fadeUp 0.4s ease both;
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ===== TYPE ===== */
h1 {
    font-size: clamp(22px, 4.5vw, 34px); font-weight: 800;
    color: var(--primary); margin-bottom: 13px; text-align: center;
    letter-spacing: -0.4px; line-height: 1.22;
}
h2 {
    font-size: clamp(18px, 3vw, 22px); font-weight: 700;
    color: var(--primary); margin-bottom: 13px; text-align: center;
    letter-spacing: -0.2px;
}
h3 { font-size: 16.5px; font-weight: 700; color: var(--primary-dark); margin: 20px 0 8px; }
p  { color: var(--text-muted); margin-bottom: 13px; text-align: center; }

/* ===== BREADCRUMB ===== */
.breadcrumb {
    font-size: 12.5px; color: var(--text-light);
    margin-bottom: 22px; display: flex; align-items: center;
    gap: 5px; flex-wrap: wrap;
}
.breadcrumb a { color: var(--primary); text-decoration: none; font-weight: 600; }
.breadcrumb a:hover { text-decoration: underline; }

/* ===== BUTTONS ===== */
.btn, button {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white; padding: 11px 22px; border: none;
    border-radius: var(--r-sm); cursor: pointer;
    font-family: var(--font); font-weight: 600; font-size: 14px;
    text-decoration: none; white-space: nowrap;
    box-shadow: 0 4px 14px rgba(122,27,109,0.26);
    transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s;
    margin: 5px 4px;
}
.btn:hover, button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(122,27,109,0.36);
}
.btn:active, button:active { transform: translateY(0); }

.btn-ghost {
    background: white; color: var(--primary);
    border: 2px solid var(--primary);
    box-shadow: none;
}
.btn-ghost:hover { background: var(--primary-faint); box-shadow: none; }

.removeBtn {
    background: linear-gradient(135deg, #b02a20, #d94030);
    font-size: 12px; padding: 7px 11px; margin: 0;
    box-shadow: none;
}

/* ===== FORM INPUTS ===== */
label {
    display: block; font-size: 13px; font-weight: 700;
    color: var(--text); margin-bottom: 5px; margin-top: 14px;
}
input[type="text"],
input[type="email"],
input[type="number"],
select,
textarea {
    width: 100%; padding: 11px 14px;
    border: 2px solid var(--border); border-radius: var(--r-sm);
    font-size: 14px; font-family: var(--font); color: var(--text);
    background: white; transition: border-color 0.2s, box-shadow 0.2s;
    -webkit-appearance: none; appearance: none;
}
input:focus, select:focus, textarea:focus {
    outline: none; border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(122,27,109,0.1);
}
textarea { resize: vertical; min-height: 120px; }

/* ===== TABLE ===== */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--r-md); }
table {
    width: 100%; border-collapse: collapse;
    background: white; border-radius: var(--r-md);
    overflow: hidden; box-shadow: var(--shadow-md);
}
th {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white; padding: 13px 15px; text-align: left;
    font-weight: 600; font-size: 13px; white-space: nowrap;
}
td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--primary-faint); }

/* ===== CARDS ===== */
.card, .page-box {
    background: white; border-radius: var(--r-md);
    box-shadow: var(--shadow-md); padding: 30px; margin-bottom: 26px;
}
.page-box h2 { text-align: center; margin-bottom: 22px; }
.page-box p  { text-align: left; color: var(--text-muted); }
.page-box ul { margin: 10px 0 16px 20px; }
.page-box li { margin: 8px 0; color: var(--text-muted); }
.page-box h3 { margin-top: 22px; }

/* ===== HOME CTA GRID ===== */
.cta-grid {
    display: grid; grid-template-columns: repeat(3, 1fr);
    gap: 18px; margin: 26px 0;
}
.cta-card {
    background: white; border-radius: var(--r-md);
    padding: 26px 20px; text-align: center;
    box-shadow: var(--shadow-sm); border-top: 4px solid var(--primary);
    transition: transform 0.22s, box-shadow 0.22s;
}
.cta-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); }
.cta-label {
    display: inline-block; width: 48px; height: 48px; line-height: 48px;
    border-radius: 50%; background: var(--primary-faint);
    color: var(--primary); font-weight: 800; font-size: 14px;
    margin-bottom: 12px; letter-spacing: -0.5px;
}
.cta-card h3 { font-size: 16px; text-align: center; margin: 0 0 9px; }
.cta-card p  { font-size: 13px; color: var(--text-light); text-align: center; margin-bottom: 16px; }

@media (max-width: 680px) { .cta-grid { grid-template-columns: 1fr; } }
@media (min-width: 681px) and (max-width: 860px) { .cta-grid { grid-template-columns: 1fr 1fr; } }

/* ===== GRADING SECTION ===== */
.grading-info {
    background: white; border-radius: var(--r-md);
    padding: 28px; box-shadow: var(--shadow-md); margin-bottom: 26px;
}
.grading-info table { margin: 0; box-shadow: none; }

/* ===== GPA TOOL ===== */
.gpa-input-group {
    background: white; border-radius: var(--r-md);
    padding: 20px; box-shadow: var(--shadow-md); margin-bottom: 18px;
}
.button-group {
    text-align: center; margin: 16px 0;
    display: flex; flex-wrap: wrap; justify-content: center;
}

/* ===== CGPA TOOL ===== */
.cgpa-container {
    max-width: 460px; margin: 0 auto 26px;
    background: white; padding: 30px;
    border-radius: var(--r-md); box-shadow: var(--shadow-md);
}
#cgpaResult { margin-top: 18px; display: none; border-radius: var(--r-md); overflow: hidden; }
#cgpaResult.show { display: block; }

/* ===== RESULT CARD ===== */
.result-card {
    background: white; border-radius: var(--r-md); padding: 30px;
    box-shadow: var(--shadow-lg); border-top: 5px solid var(--primary); margin-top: 24px;
}
.result-card h2 { text-align: center; margin-bottom: 6px; }
.result-card h3 { text-align: center; font-size: 26px; margin: 12px 0; }

.perf-badge {
    display: inline-block; padding: 7px 18px;
    border-radius: 20px; font-weight: 700; font-size: 14px;
}
.perf-excellent { background: #d4edda; color: #155724; }
.perf-good      { background: #d1ecf1; color: #0c5460; }
.perf-average   { background: #fff3cd; color: #856404; }
.perf-poor      { background: #f8d7da; color: #721c24; }

/* ===== SEO CONTENT ===== */
.seo-content {
    background: white; border-radius: var(--r-md);
    padding: 30px; box-shadow: var(--shadow-sm); margin-top: 26px;
}
.seo-content h2 { font-size: 19px; margin-bottom: 11px; text-align: left; }
.seo-content p  { text-align: left; color: var(--text-muted); font-size: 14.5px; }
.seo-content ul { margin: 8px 0 14px 20px; }
.seo-content li { margin-bottom: 7px; color: var(--text-muted); font-size: 14.5px; }

.faq-item { padding: 15px 0; border-bottom: 1px solid var(--border); }
.faq-item:last-child { border-bottom: none; }
.faq-item h3 { font-size: 14.5px; color: var(--text); margin: 0 0 6px; }
.faq-item p  { text-align: left; font-size: 14px; color: var(--text-muted); margin: 0; }

.formula-box {
    background: var(--primary-faint);
    border-left: 4px solid var(--primary);
    padding: 14px 18px; border-radius: 0 var(--r-sm) var(--r-sm) 0;
    margin: 14px 0; font-size: 14.5px; color: var(--primary-dark);
    font-weight: 700; line-height: 1.5;
}

/* ===== CONTACT FORM ===== */
.contact-form { max-width: 420px; margin: 0 auto; }
.contact-form .form-submit { text-align: center; margin-top: 16px; }
.contact-form .form-submit button { width: 100%; padding: 13px; font-size: 15px; }

/* ===== THANK YOU ===== */
.thankyou-box {
    max-width: 520px; margin: 60px auto;
    background: white; border-radius: var(--r-lg);
    padding: 52px 40px; text-align: center;
    box-shadow: var(--shadow-lg); border-top: 5px solid var(--primary);
}
.thankyou-box h1 { font-size: 28px; margin-bottom: 14px; }
.thankyou-box p  { text-align: center; max-width: 330px; margin: 0 auto 26px; }
.check-icon {
    width: 68px; height: 68px; border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 22px;
}
.check-icon svg { width: 34px; height: 34px; }

/* =============================================
   FOOTER — clean text only, no icons
   ============================================= */
footer {
    background: #130718;
    color: #9588a2;
    padding: 54px 24px 28px;
}

.footer-inner {
    max-width: 900px;
    margin: 0 auto;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.6fr 1fr 1fr 1fr;
    gap: 36px;
    padding-bottom: 42px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    margin-bottom: 28px;
}

/* Brand column */
.footer-brand .brand-name {
    font-size: 16px; font-weight: 700;
    color: white; display: block; margin-bottom: 4px;
}
.footer-brand .brand-by {
    font-size: 12px; color: #b0a0be; display: block; margin-bottom: 14px;
}
.footer-brand .brand-desc {
    font-size: 13px; line-height: 1.7; color: #b0a0be;
    margin-bottom: 18px;
}

/* Social links — plain text */
.footer-social { display: flex; flex-wrap: wrap; gap: 0; }
.footer-social a {
    font-size: 13px; font-weight: 500;
    color: #b0a0be; text-decoration: none;
    margin-right: 14px; margin-bottom: 8px;
    transition: color 0.18s;
}
.footer-social a:hover { color: white; }

/* Nav columns */
.footer-col h4 {
    font-size: 11px; font-weight: 700;
    color: white; text-transform: uppercase;
    letter-spacing: 1.2px; margin-bottom: 16px;
}
.footer-col a {
    display: block; font-size: 13.5px;
    color: #b0a0be; text-decoration: none;
    margin-bottom: 10px; transition: color 0.18s;
}
.footer-col a:hover { color: white; }

/* Bottom bar */
.footer-bottom {
    display: flex; justify-content: space-between;
    align-items: center; flex-wrap: wrap; gap: 10px;
}
.footer-bottom p {
    font-size: 12px; color: #8a7a96; margin: 0;
    text-align: left;
}
.footer-bottom-links { display: flex; gap: 16px; flex-wrap: wrap; }
.footer-bottom-links a {
    font-size: 12px; color: #8a7a96;
    text-decoration: none; transition: color 0.18s;
}
.footer-bottom-links a:hover { color: #b0a0be; }

/* Footer responsive */
@media (max-width: 760px) {
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 26px; }
    .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 460px) {
    .footer-grid { grid-template-columns: 1fr; gap: 22px; }
    footer { padding: 38px 18px 22px; }
    .footer-bottom { flex-direction: column; align-items: flex-start; gap: 8px; }
}

/* ===== UTILS ===== */
.link { color: var(--primary); font-weight: 600; text-decoration: none; }
.link:hover { text-decoration: underline; }

/* Prevent iOS auto-zoom when tapping inputs (requires font-size >= 16px on focus) */
@media (max-width: 768px) {
    input[type="text"],
    input[type="email"],
    input[type="number"],
    select,
    textarea {
        font-size: 16px;
    }
}

/* ===== GPA TABLE — MOBILE CARD LAYOUT ===== */
@media (max-width: 600px) {
    /* Hide the table header row on mobile */
    #gpaTable thead { display: none; }

    /* Each table row becomes its own card */
    #gpaTable tbody tr {
        display: block;
        background: white;
        border-radius: var(--r-sm);
        border: 1px solid var(--border);
        padding: 14px 14px 10px;
        margin-bottom: 12px;
        box-shadow: var(--shadow-sm);
    }

    /* Each cell stacks vertically */
    #gpaTable tbody td {
        display: block;
        border: none;
        padding: 5px 0;
    }

    /* Labels above each field */
    #gpaTable tbody td::before {
        display: block;
        font-size: 11px;
        font-weight: 700;
        color: var(--text-light);
        text-transform: uppercase;
        letter-spacing: 0.6px;
        margin-bottom: 5px;
    }
    #gpaTable tbody td:nth-child(1)::before { content: 'Subject Name'; }
    #gpaTable tbody td:nth-child(2)::before { content: 'Credit Hours'; }
    #gpaTable tbody td:nth-child(3)::before { content: 'Grade'; }

    /* Remove button aligned to the right */
    #gpaTable tbody td:nth-child(4) {
        text-align: right;
        padding-top: 8px;
    }
    #gpaTable tbody td:nth-child(4)::before { content: none; }

    /* Full-width inputs & selects inside cards */
    #gpaTable input,
    #gpaTable select { width: 100%; }

    /* Remove horizontal scroll since cards don't need it */
    .gpa-input-group .table-wrap { overflow-x: visible; }
}

@media (max-width: 580px) {
    main { padding: 22px 14px 50px; }
    .card, .page-box, .seo-content, .grading-info { padding: 20px 16px; }
    .result-card { padding: 20px 16px; }
    .cgpa-container { padding: 22px 16px; }
    h1 { font-size: 21px; }
    h2 { font-size: 17px; }
    th, td { padding: 10px 11px; font-size: 13px; }
    .thankyou-box { padding: 34px 18px; margin: 28px auto; }
}
