/* ============================================================
   NAVIGATION
============================================================ */
header {
    background: #111827;
    color: #f9fafb;
    padding: 16px 24px;
}

.navbar {
    max-width: 1120px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-evenly;
}

.navbar a.logo {
    font-weight: 700;
    font-size: 1.25rem;
    text-decoration: none;
    color: #f9fafb;
}

/* Desktop Links */
.nav-links {
    display: flex;
    align-items: center;
}

.nav-links a {
    margin-left: 16px;
    text-decoration: none;
    color: #e5e7eb;
    font-size: 0.95rem;
}

.nav-links a:hover {
    color: #ffffff;
}

/* Mobile Menu Button (hidden on desktop) */
.menu-toggle {
    display: none;
    font-size: 1.7rem;
    color: #fff;
    background: none;
    border: none;
    cursor: pointer;
}


:root {
    --heading-font: 'Patrick Hand', 'Kalam', sans-serif;
    --body-font: 'Inter', system-ui, -apple-system, sans-serif;

    --card-bg-light: #ffffffcc;
    --card-bg-dark: #2e2e33f2;

    --divider-light: repeating-linear-gradient(to right, #d8d8e8 0 10px, transparent 10px 20px);
    --divider-dark: repeating-linear-gradient(to right, #5a5a68 0 10px, transparent 10px 20px);

    --text-light: #333;
    --text-dark: #e8e8e8;

    --bg-light: linear-gradient(135deg, #fafbff, #f0f3ff);
    --bg-dark: linear-gradient(135deg, #1a1a1d, #2b2b31);
}

body {
    font-family: var(--body-font);
    background: var(--bg-light);
    color: var(--text-light);
    margin: 0;
    padding: 0;
    background-attachment: fixed;
    transition: 0.3s ease;
}

body.dark-mode {
    background: var(--bg-dark);
    color: var(--text-dark);
}

/* Layout */
.container {
    max-width: 1100px;
    margin: 40px auto;
    padding: 20px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

h1 {
    grid-column: 1 / -1;
    text-align: center;
    font-size: 2.4rem;
    margin-bottom: 10px;
    font-family: var(--heading-font);
}

.subtitle {
    text-align: center;
    margin-top: -10px;
    font-size: 1.1rem;
    color: #666;
}

body.dark-mode .subtitle {
    color: #b3b3c5;
}

/* Card */
.card {
    position: relative;
    background: var(--card-bg-light);
    padding: 25px;
    border-radius: 20px;
    border: 1px solid #e6e9f5;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
    backdrop-filter: blur(10px);
    transition: 0.3s;
}

body.dark-mode .card {
    background: var(--card-bg-dark);
    border-color: #3e3e46;
}

/* Sticky notes */
.sticky-note {
    position: absolute;
    border-radius: 6px;
    box-shadow: 2px 2px 0px rgba(0, 0, 0, 0.15);
    z-index: -1;
}

.sticky-left {
    top: -15px;
    left: -15px;
    width: 60px;
    height: 60px;
    background: #ffd6e8;
    transform: rotate(-4deg);
}

.sticky-right {
    top: -18px;
    right: -18px;
    width: 70px;
    height: 70px;
    background: #d6f4ff;
    transform: rotate(3deg);
}

body.dark-mode .sticky-left {
    background: #5a4d61;
}

body.dark-mode .sticky-right {
    background: #4d5a61;
}

/* Titles */
.section-title {
    font-size: 1.3rem;
    font-family: var(--heading-font);
    background: #fff7b3;
    padding: 6px 14px;
    border-radius: 8px;
    box-shadow: 2px 2px 0px #e1d27a;
    transform: rotate(-1deg);
    display: inline-block;
}

body.dark-mode .section-title {
    background: #49412b;
    box-shadow: 2px 2px 0px #2b2617;
}

/* Inputs */
.input-group {
    margin-bottom: 15px;
}

.input-group input {
    padding: 12px;
    border-radius: 12px;
    border: 1px solid #d5d9e6;
    background: #f9faff;
    color: #333;
    font-size: 1rem;
    transition: 0.2s;
}

body.dark-mode .input-group input {
    background: #3b3b42;
    border-color: #666;
    color: #e8e8e8;
}

.input-group input:focus {
    outline: none;
    border-color: #9aa9ff;
    background: #fff;
    box-shadow: 0 0 0 3px #e0e5ff;
}

body.dark-mode .input-group input:focus {
    border-color: #b6b9ff;
    box-shadow: 0 0 0 3px rgba(182, 185, 255, 0.25);
}

/* Divider */
.divider {
    height: 12px;
    background: var(--divider-light);
    margin: 25px 0;
    opacity: 0.4;
}

body.dark-mode .divider {
    background: var(--divider-dark);
    opacity: 0.3;
}

/* Summary */
.summary-box {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.summary-item {
    background: #f4f5ff;
    padding: 20px;
    border-radius: 16px;
    border: 1px solid #e3e5f5;
    font-size: 1.15rem;
    display: flex;
    justify-content: space-between;
}

body.dark-mode .summary-item {
    background: #343445;
    border-color: #4a4a5d;
}

.highlight-good {
    background: #e7f9ee;
    color: #1f8a41;
}

body.dark-mode .highlight-good {
    background: #284233;
    color: #93e7ad;
}

.highlight-warning {
    background: #fff5e5;
    color: #c47a1c;
}

body.dark-mode .highlight-warning {
    background: #423429;
    color: #f3c68a;
}

/* Button */
#toggleMode {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 12px 18px;
    border-radius: 12px;
    border: none;
    font-family: var(--heading-font);
    background: #dcdfff;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: 0.2s;
}

#toggleMode:hover {
    transform: translateY(-2px);
}

body.dark-mode #toggleMode {
    background: #3c3c5a;
    color: #e8e8ff;
}

/* ============================================
   MOBILE FIXES FOR BUDGET PLANNER (iPhone ready)
   ============================================ */
@media (max-width: 768px) {

    /* Stack cards vertically */
    .container {
        grid-template-columns: 1fr !important;
        gap: 25px !important;
        padding: 10px 16px !important;
        margin-top: 20px !important;
    }

    /* Make cards full-width and reduce padding */
    .card {
        padding: 18px !important;
        border-radius: 16px !important;
    }

    /* Fix sticky notes position / size so they don’t fall off screen */
    .sticky-left,
    .sticky-right {
        width: 45px !important;
        height: 45px !important;
        top: -10px !important;
    }

    .sticky-left {
        left: -10px !important;
    }

    .sticky-right {
        right: -10px !important;
    }

    /* Section titles smaller for narrow screens */
    .section-title {
        font-size: 1.1rem !important;
        padding: 4px 10px !important;
    }

    /* Inputs full width, slightly smaller padding */
    .input-group input {
        padding: 10px !important;
        font-size: 0.95rem !important;
        border-radius: 10px !important;
    }

    /* Summary items stack nicer */
    .summary-item {
        padding: 16px !important;
        font-size: 1rem !important;
        border-radius: 12px !important;
    }

    /* Fix toggle button so it does not cover content */
    #toggleMode {
        bottom: 10px !important;
        right: 10px !important;
        padding: 10px 14px !important;
        border-radius: 10px !important;
    }
}