/* ==========================================================
   Queen’s University Library Web Apps Portal Stylesheet
   Author: Jason Mbikayi
   Version: v0.1 (Reordered & Cleaned)
   ========================================================== */

/* ----------------------------------------------------------
   1. Root Variables (Queen’s Brand Colours)
---------------------------------------------------------- */
:root {
    --navy: #002B59;
    --blue: #002452;
    --gold: #fabd0f;
    --card-bg: #ffffff;
    --red: #b90e31;
}

/* ----------------------------------------------------------
   2. Base Layout and Typography
---------------------------------------------------------- */
html, body {
    height: 100%;
    margin: 0;
}
body {
    margin: 0;
    font-family: 'Open Sans', sans-serif;
    background: #f4f4f4;
    display: flex;
    flex-direction: column;
    min-height: 100vh; /* Ensures footer stays at bottom */
}

/* ----------------------------------------------------------
   3. Header and Branding
---------------------------------------------------------- */
header {
    background: var(--navy);
    color: #fff;
    padding: 15px 25px;
    border-bottom: 5px solid var(--red);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.qu-navbar-brand {
    display: inline-block;
}

.qu-navbar-brand img {
    height: 45px;
    width: auto;
    display: block;
}

header h1 {
    margin: 0 auto;
    font-size: min(28px, 4vw);
    font-weight: 600;
    text-align: center;
    flex: 1;
    padding: 0 20px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ----------------------------------------------------------
   4. Content Area
---------------------------------------------------------- */
.container {
    flex: 1;
}

/* Intro text block */
.intro {
    text-align: left;
    font-size: 18px;
    font-weight: 400;
    color: #212121;
    border-bottom: 3px solid var(--gold);
    padding-bottom: 40px;
    margin-bottom: 50px;
}

/* ----------------------------------------------------------
   5. Application Cards Grid
---------------------------------------------------------- */
.apps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
}

.card {
    background: var(--card-bg);
    padding: 25px;
    border-radius: 8px;
    border-left: 5px solid var(--gold);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
    transition: transform .15s, box-shadow .15s;
}
.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}
.card h2 {
    margin: 0;
    color: var(--navy);
    font-size: 22px;
    font-weight: 600;
}
.card p {
    font-size: 16px;
    color: #444;
    margin-bottom: 20px;
}
.card a {
    display: inline-block;
    padding: 12px 18px;
    background: var(--navy);
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    border-radius: 4px;
}
.card a:hover {
    background: var(--blue);
}

/* ----------------------------------------------------------
   6. Footer
---------------------------------------------------------- */
footer {
    text-align: center;
    padding: 10px 30px 25px; /* top, sides, bottom */
    color: #777;
    border-top: 2px solid var(--red);
}

/* ----------------------------------------------------------
   7. Dark Mode Styles
---------------------------------------------------------- */
.dark-mode {
    background: #0e1621;
    color: #e8e8e8;
}

/* Card appearance in dark mode */
.dark-mode .card {
    background: #182533;
    border-color: var(--gold);
}
.dark-mode .card h2 {
    color: #F2A900; /* Queen’s gold titles */
}
.dark-mode .card p {
    color: #E3E3D7;
}
.dark-mode .card a {
    background: #073763;
}

/* Non-card content text in dark mode */
.dark-mode .container,
.dark-mode .container p,
.dark-mode .container h1,
.dark-mode .container h2,
.dark-mode .container h3,
.dark-mode .container h4,
.dark-mode .container h5,
.dark-mode .container h6,
.dark-mode .container span,
.dark-mode .container div {
    color: #E6E6D6 !important;
}

/* Bright intro text */
.dark-mode .intro {
    color: #FFF2CC !important;
}

/* Header + Footer dark adjustments */
.dark-mode header {
    background: #001a3b;
    border-bottom-color: var(--gold);
}
.dark-mode footer {
    color: #d9d9c9;
    background: #001a3b;
    border-top: 2px solid var(--gold);
}

/* Links in dark mode */
.dark-mode a {
    color: #F2A900;
}
.dark-mode a:hover {
    color: #FFD75E;
}

/* ----------------------------------------------------------
   8. Mode Toggle Button
---------------------------------------------------------- */
.mode-toggle {
    position: fixed;
    top: 15px;
    right: 20px;
    background: var(--gold);
    color: #000;
    padding: 10px 14px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
}
