/* ============================================================ GLOBAL RESET ============================================================ */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
    background: #f5f5f7;
    color: #222;
    line-height: 1.6;
}

/* ============================================================ 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;
}

/* ============================================================ DEFAULT PAGE LAYOUT (NOT HOMEPAGE) ============================================================ */
main.page-layout {
    max-width: 1120px;
    margin: 24px auto 40px;
    padding: 0 16px;
    display: grid;
    grid-template-columns: minmax(0, 2.5fr) minmax(260px, 1fr);
    gap: 24px;
}

@media (max-width: 840px) {
    main.page-layout {
        display: block;
    }
}

/* ============================================================ FORM ELEMENTS ============================================================ */
textarea,
input[type="text"],
input[type="email"],
select {
    width: 100%;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    padding: 8px 10px;
    font-size: 0.95rem;
    margin: 4px 0 10px;
    font-family: inherit;
}

textarea {
    min-height: 200px;
    resize: vertical;
}

textarea:focus,
input:focus,
select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 1px #2563eb33;
}

/* ============================================================ BUTTONS ============================================================ */
button {
    background: #2563eb;
    color: #ffffff;
    border: none;
    border-radius: 999px;
    padding: 8px 16px;
    font-size: 0.9rem;
    cursor: pointer;
    margin-top: 6px;
}

button:hover {
    background: #1d4ed8;
}

/* ============================================================ CARDS (used on tool pages) ============================================================ */
.card {
    background: #ffffff;
    border-radius: 12px;
    padding: 18px 20px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.04);
}

.card h1,
.card h2 {
    margin-bottom: 8px;
}

.card p.lead {
    margin-bottom: 12px;
    color: #4b5563;
}

/* ============================================================ STAT BOXES / RESULTS ============================================================ */
.stats-box,
.result-box {
    margin-top: 12px;
    padding: 10px 12px;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    font-size: 0.9rem;
    white-space: pre-wrap;
}

.highlight-error {
    background: #ffb3b3;
    padding: 2px 3px;
    border-radius: 4px;
}

.highlight-plagiarism {
    background: #ff7979;
    padding: 2px 3px;
    border-radius: 4px;
}

/* ============================================================ FLOATING TIMER (ALL PAGES) ============================================================ */
#floating-timer {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #111827;
    color: #fff;
    padding: 10px 16px;
    border-radius: 10px;
    display: none;
    font-size: 0.9rem;
    z-index: 9999;
    box-shadow: 0px 5px 20px rgba(0, 0, 0, 0.25);
}

#floating-timer button {
    background: #2563eb;
    color: #fff;
    border: none;
    padding: 4px 10px;
    margin-left: 6px;
    border-radius: 6px;
    cursor: pointer;
}

#floating-timer button:hover {
    background: #1e4fcf;
}

/* ============================================================ HOMEPAGE — HERO ============================================================ */
/* ============================================================ HOMEPAGE — HERO (Aesthetic Option B) ============================================================ */
.hero {
    background: linear-gradient(135deg, #f7faff, #eef2ff);
    padding: 80px 20px;
    border-bottom: 1px solid #e5e7eb;
}

.hero-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
}

/* Left side (text) */
.hero-left {
    max-width: 520px;
}

.hero h1 {
    font-size: 2.8rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 18px;
}

.hero .lead {
    font-size: 1.2rem;
    color: #374151;
    margin-bottom: 35px;
    line-height: 1.65;
}

.hero-buttons {
    display: flex;
    gap: 15px;
}

.hero-btn {
    background: #4b6bff;
    color: white;
    padding: 14px 26px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    transition: 0.2s ease;
    font-size: 1.1rem;
}

.hero-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 18px rgba(75, 107, 255, 0.23);
}

.hero-btn.light {
    background: #ffffff;
    color: #444;
    border: 2px solid #d3d6f5;
}

.hero-btn.light:hover {
    background: #f6f8ff;
}

/* Right side (visual artwork) */
.hero-visual {
    position: relative;
    width: 360px;
    height: 360px;
}

/* Pastel blobs */
.blob {
    position: absolute;
    width: 260px;
    height: 260px;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.6;
}

.blob.pink {
    background: #ffb3c6;
    top: 0;
    right: 0;
}

.blob.blue {
    background: #b3c6ff;
    bottom: 0;
    left: 0;
}

/* Floating card */
.floating-card {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    padding: 22px 28px;
    border-radius: 18px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
    width: 220px;
    text-align: left;
}

.floating-card h3 {
    margin-bottom: 10px;
    font-size: 1.2rem;
    color: #111;
}

.floating-card ul {
    padding: 0;
    margin: 0;
    list-style: none;
}

.floating-card li {
    padding: 4px 0;
    color: #444;
    font-size: 1rem;
}

/* Mobile layout */
@media (max-width: 900px) {
    .hero-inner {
        flex-direction: column;
        text-align: center;
        gap: 50px;
    }

    .hero-left {
        max-width: 100%;
    }

    .hero-buttons {
        justify-content: center;
    }

    .hero-visual {
        width: 260px;
        height: 260px;
    }
}

/* ============================================================ HOMEPAGE — FEATURE GRID ============================================================ */
.feature-section {
    max-width: 1000px;
    margin: 50px auto;
    padding: 0 20px;
    text-align: center;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
}

.feature-card {
    background: #ffffff;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
    border: 1px solid #e5e7eb;
    transition: transform 0.2s, box-shadow 0.2s;
}

.feature-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
}

.feature-card h3 {
    margin-bottom: 10px;
    color: #111827;
}

.feature-card p {
    color: #374151;
    margin-bottom: 12px;
}

.feature-card a {
    font-weight: 600;
    color: #2563eb;
    text-decoration: none;
}

/* ============================================================ HOMEPAGE — RIGHT SIDEBAR (AD SPACE) ============================================================ */
.ad-sidebar {
    width: 300px;
    min-height: 600px;
    float: right;
    margin-right: 20px;
}

@media (max-width: 900px) {
    .ad-sidebar {
        display: none;
    }
}

/* ============================================================ HOMEPAGE — WHY SECTION ============================================================ */
.why-section {
    background: #f9fafb;
    padding: 50px 20px;
    margin-top: 40px;
}


.why-section h2 {
    margin-bottom: 25px;
    color: #111827;
    font-size: 1.6rem;
    display: block;
    width: 100%;
    text-align: center;
}

.feature-section ul {
    max-width: 700px;
    margin: 0 auto;
    list-style: none;
}

.feature-section li {
    background: white;
    padding: 12px 18px;
    margin: 10px 0;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    font-size: 1rem;
    color: #374151;
    text-align: center;
}

/* ============================================================ HOMEPAGE — FAQ SECTION ============================================================ */
.faq-section {
    max-width: 800px;
    margin: 50px auto;
    padding: 0 20px 40px;
}

.faq-section h2 {
    text-align: center;
    font-size: 1.6rem;
    margin-bottom: 25px;
}

.faq-section h3 {
    margin-top: 25px;
    font-size: 1.1rem;
    color: #111827;
    text-align: center;
}

.faq-section p {
    color: #374151;
    text-align: center;
}

/* ============================================================ FOOTER ============================================================ */
.footer {
    text-align: center;
    padding: 25px 0;
    margin-top: 50px;
    border-top: 1px solid #e5e7eb;
    background: #ffffff;
}

.footer a {
    color: #2563eb;
    margin: 0 10px;
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

/* ============================================================ RESPONSIVE TWEAKS ============================================================ */
@media (max-width: 600px) {
    .hero h1 {
        font-size: 1.7rem;
    }

    .hero .lead {
        font-size: 1rem;
    }

    .hero-buttons {
        flex-direction: column;
    }

    .hero-btn {
        width: 100%;
    }
}

/* ============================================================ GLOBAL PAGE BACKGROUND (same as habit tracker) =========================================================== */
body {
    margin: 0;
    font-family: 'Inter', system-ui, sans-serif;
    background: linear-gradient(135deg, #fafbff, #e8ecff);
    color: #111827;
}

/* ============================================================ MAIN LAYOUT (match habit tracker spacing + width) =========================================================== */
.page-layout {
    max-width: 1100px;
    margin: 40px auto;
    padding: 0 16px;
    display: grid;
    grid-template-columns: minmax(0, 3fr) 300px;
    gap: 30px;
}

@media (max-width: 900px) {
    .page-layout {
        display: block;
        margin-top: 20px;
    }
}

/* ============================================================ CARD STYLE — SAME AS habit-shell / today-card =========================================================== */
.card {
    background: #ffffffcc;
    /* translucent white */
    backdrop-filter: blur(10px);
    border-radius: 26px;
    padding: 30px 26px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.12);
    border: 1px solid #e0e3f2;
}

/* Sidebar card matches right-side habit tracker */
.sidebar .card {
    padding: 22px 22px;
}

/* Headings match Habit Tracker */
.card h1,
.card h2 {
    font-family: 'Patrick Hand', system-ui, sans-serif;
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 2.4rem;
}

.lead {
    font-size: 0.98rem;
    color: #6b7280;
    margin-bottom: 20px;
}

/* ============================================================ TEXTAREA STYLING (same rounded/soft as input fields) =========================================================== */
#text-input {
    width: 100%;
    min-height: 180px;
    border-radius: 20px;
    border: 1px solid #d1d5db;
    padding: 14px 16px;
    font-size: 0.95rem;
    background: #f9fafb;
    resize: vertical;
}

#text-input:focus {
    outline: none;
    border-color: #4b6bff;
    box-shadow: 0 0 0 2px #c7d2fe;
    background: #ffffff;
}

/* ============================================================ STATS GRID (match soft bubble style) =========================================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-top: 22px;
}

.stat-box {
    background: #f3f4ff;
    border-radius: 20px;
    padding: 16px;
    border: 1px solid #e5e7f5;
    box-shadow: inset 0 0 0 1px #f3f4ff;
}

.stat-label {
    color: #6b7280;
    font-size: 0.85rem;
    margin-bottom: 6px;
}

.stat-value {
    font-weight: 600;
    font-size: 1.2rem;
    color: #111827;
}

/* ============================================================ FOOTER LINKS (match subtle style) =========================================================== */
.footer-links {
    margin-top: 20px;
    display: flex;
    gap: 16px;
}

.footer-links a {
    color: #6b7280;
    font-size: 0.85rem;
    text-decoration: none;
}

.footer-links a:hover {
    color: #4b6bff;
}

/* ============================================================ SIDEBAR =========================================================== */
.sidebar {
    position: relative;
}

@media (max-width: 900px) {
    .sidebar {
        margin-top: 20px;
    }
}

/* ============================================================ FLASHCARDS — REAL FLIP CARD STYLE ============================================================ */
.flashcard-wrapper {
    perspective: 1000px;
    width: 100%;
    margin-bottom: 16px;
}

.flashcard {
    width: 100%;
    background: transparent;
    position: relative;
    height: 160px;
    transform-style: preserve-3d;
    transition: transform 0.6s;
    cursor: pointer;
}

.flashcard:hover {
    transform: rotateY(180deg);
}

.flashcard-side {
    position: absolute;
    inset: 0;
    padding: 18px 20px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.05);
    backface-visibility: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 1rem;
    border: 1px solid #e5e7eb;
}

/* Front */
.flashcard-front {
    font-weight: 600;
    color: #111827;
}

/* Back */
.flashcard-back {
    transform: rotateY(180deg);
    color: #374151;
}

/* Flashcard container layout */
#fc-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

@media (min-width: 700px) {
    #fc-list {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 20px;
    }
}