/* ===== GLOBAL STYLES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

body {
    background: #ffeaf4;
    color: #333;
    line-height: 1.6;
    transition: background 0.3s, color 0.3s;
}

body.dark {
    background: #1e1e1e;
    color: #f8f8f8;
}

h1, h2, h3 {
    font-weight: 700;
    color: #d63384;
}

body.dark h1, body.dark h2, body.dark h3 {
    color: #ffb3d9;
}

/* ===== HEADER ===== */
.header {
    padding: 14px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    box-shadow: 0px 4px 10px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
    gap: 16px;
}

.header.dark {
    background: #2c2c2c;
}

.logo {
    font-size: 28px;
    color: #d63384;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 25px;
}

.nav-links li a {
    text-decoration: none;
    color: #444;
    font-weight: 500;
    transition: 0.3s;
}

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

.nav-links.show {
    display: block;
    position: absolute;
    top: 70px;
    right: 20px;
    background: #ffeaf4;
    padding: 15px;
    border-radius: 10px;
    flex-direction: column;
}

body.dark .nav-links.show {
    background: #2c2c2c;
}

/* ===== MOBILE MENU BUTTON ===== */
.mobile-menu-btn {
    display: none;          /* hidden on desktop */
    flex-direction: column;
    justify-content: space-between;
    width: 28px;
    height: 20px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    margin-left: 10px;
    flex-shrink: 0;
}

/* The three bars */
.mobile-menu-btn span {
    display: block;
    width: 100%;
    height: 3px;
    background: #d63384;
    border-radius: 3px;
    transition: transform 0.3s ease, opacity 0.3s ease;
    pointer-events: none;
}

/* Animate to X when open */
.mobile-menu-btn.open span:nth-child(1) { transform: translateY(8.5px) rotate(45deg); }
.mobile-menu-btn.open span:nth-child(2) { opacity: 0; }
.mobile-menu-btn.open span:nth-child(3) { transform: translateY(-8.5px) rotate(-45deg); }

/* Header right group: dark toggle + hamburger */
.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

/* ===== DARK MODE BUTTON ===== */
.dark-toggle {
    background: #d63384;
    color: #fff;
    border: none;
    padding: 8px 15px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
}

.dark-toggle:hover {
    background: #b12a6f;
}

/* ===== HERO ===== */
.hero {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    padding: 60px 20px;
    background: linear-gradient(135deg, #ffb3d9, #ffe6f2);
    border-bottom: 5px solid #d63384;
    gap: 40px;  /* 👈 ADD THIS */
}

.hero-content {
    flex: 1 1 300px;
}

.hero-logo {
    width: 350px;
    max-width: 100%;
    height: 350px;

    border-radius: 50%;   /* keep it rectangular */
    object-fit: cover;

    display: block;        /* IMPORTANT */
    margin: 0 auto;        /* centers it nicely */

    box-shadow: 0 20px 45px rgba(0,0,0,0.25);

    transition: transform 0.3s ease;
}

.hero-logo:hover {
    transform: scale(1.05);
}

/* ===== SECTIONS ===== */
section {
    padding: 50px 20px;
}

.quotes-section, .stories-section, .blog-section, .contact-section, .forum-section, .instagram-section {
    text-align: center;
}

.quote-grid, .story-grid, .blog-grid {
    display: grid;
    gap: 25px;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    margin-top: 30px;
}

.quote-card, .story-card, .blog-card {
    background: white;
    padding: 25px;
    border-radius: 20px;
    box-shadow: 0px 5px 12px rgba(0,0,0,0.08);
    transition: transform 0.3s, box-shadow 0.3s;
}

.quote-card:hover, .story-card:hover, .blog-card:hover {
    transform: translateY(-5px);
    box-shadow: 0px 10px 20px rgba(0,0,0,0.15);
}

#modalPreview {
    width: 256px;
    height: 256px;
    object-fit: cover;
    border-radius: 12px;
    display: block;
    margin: 10px auto;
}

body.dark .quote-card, body.dark .story-card, body.dark .blog-card {
    background: #2c2c2c;
    color: #f8f8f8;
}

.quote-card { border-left: 6px solid #d63384; }
.story-card { border-bottom: 6px solid #d63384; }
.blog-card { border-top: 6px solid #d63384; }

/* ===== BUTTONS ===== */
.btn {
    display: inline-block;
    padding: 12px 25px;
    background: #d63384;
    color: white;
    border-radius: 30px;
    text-decoration: none;
    transition: 0.3s;
    font-weight: 600;
    cursor: pointer;
}

.btn:hover { background: #b12a6f; }

/* ===== CONTACT FORM ===== */
.contact-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-width: 500px;
    margin: 0 auto;
}
.contact-form input, .contact-form textarea {
    padding: 10px;
    border-radius: 10px;
    border: 1px solid #ccc;
    font-size: 16px;
    width: 100%;
}
.contact-form textarea { resize: vertical; }
.contact-form .btn { width: 50%; align-self: center; }

/* ===== FORUM SECTION ===== */
.forum-container {
    max-width: 600px;
    margin: 0 auto;
    text-align: left;
}
.forum-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 15px;
}
.forum-form input, .forum-form textarea {
    padding: 10px;
    border-radius: 10px;
    border: 1px solid #ccc;
    width: 100%;
}
.forum-post {
    background: #fff;
    padding: 10px;
    border-radius: 10px;
    margin-bottom: 10px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}
body.dark .forum-post {
    background: #2c2c2c;
    color: #f8f8f8;
}
.forum-form .btn { width: 40%; align-self: flex-end; }

/* ===== INSTAGRAM EMBED ===== */
.instagram-section iframe {
    border: none;
    border-radius: 20px;
    max-width: 100%;
}

/* ===== FOOTER ===== */
.footer {
    background: #d63384;
    color: white;
    text-align: center;
    padding: 25px 20px;
}

/* ===== BACK TO TOP BUTTON ===== */
#backToTop {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #d63384;
    color: #fff;
    border: none;
    padding: 12px 18px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    display: none;
    z-index: 100;
    transition: background 0.3s;
}
#backToTop:hover { background: #b12a6f; }

/* ===== ANIMATIONS ===== */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeIn 1s forwards;
}
@keyframes fadeIn {
    to { opacity: 1; transform: translateY(0); }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    /* Show hamburger */
    .mobile-menu-btn { display: flex; }

    .header { padding: 12px 16px; }

    /* Nav panel — hidden by default, slides down when .nav-open */
    .nav {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #fff;
        box-shadow: 0 8px 24px rgba(0,0,0,0.12);
        z-index: 999;
        overflow: hidden;
        max-height: 0;
        transition: max-height 0.35s ease;
    }
    body.dark .nav { background: #2c2c2c; }

    /* Open state */
    .nav.nav-open { max-height: 420px; }

    /* nav-links list */
    .nav-links {
        display: flex !important;
        flex-direction: column;
        gap: 0;
        padding: 8px 0;
    }
    .nav-links li a {
        display: block;
        padding: 13px 22px;
        border-bottom: 1px solid rgba(214,51,132,0.08);
        font-size: 15px;
        color: #333;
    }
    body.dark .nav-links li a { color: #f0f0f0; border-color: rgba(255,255,255,0.07); }
    .nav-links li:last-child a { border-bottom: none; }
    .nav-links li a:hover { background: rgba(214,51,132,0.06); color: #d63384; }

    .hero { flex-direction: column; align-items: center; }
    .hero-content { text-align: center; }
    .contact-form .btn, .forum-form .btn { width: 100%; }
}

/* ===== QUOTE IMAGE SIZE (HOMEPAGE & DASHBOARD) ===== */
.quote-card img {
    width: 512px;
    height: 512px;
    object-fit: fill;
    border-radius: 12px;
    display: block;
    margin: 0 auto 12px auto;
}

@media (max-width: 600px) {
    .quote-card img {
        width: 180px;
        height: 180px;
    }
}

/* ===== ENHANCED MOBILE RESPONSIVENESS ===== */

/* ── Header / Nav ── */
@media (max-width: 768px) {
    .header {
        padding: 14px 16px;
        flex-wrap: wrap;
        gap: 10px;
    }
    .nav-links {
        width: 100%;
        flex-direction: column;
        gap: 10px;
        padding: 10px 0;
    }
    .nav-links.show {
        display: flex;
        position: static;
    }
    .dark-toggle {
        padding: 6px 12px;
        font-size: 13px;
    }
}

/* ── Hero ── */
@media (max-width: 768px) {
    .hero {
        padding: 36px 16px;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .hero-logo {
        width: 220px;
        height: 220px;
    }
    .hero h1 { font-size: 22px; }
    .hero p  { font-size: 14px; }
}

/* ── Grids ── */
@media (max-width: 600px) {
    .quote-grid,
    .story-grid,
    .blog-grid {
        grid-template-columns: 1fr;
        gap: 16px;
        padding: 0 4px;
    }
}
@media (min-width: 601px) and (max-width: 900px) {
    .quote-grid,
    .story-grid,
    .blog-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ── Cards ── */
@media (max-width: 600px) {
    .quote-card,
    .story-card,
    .blog-card {
        padding: 16px;
        border-radius: 14px;
        word-break: break-word;
        overflow-wrap: break-word;
    }
    .quote-card img {
        width: 100%;
        height: auto;
        max-height: 260px;
    }
    .story-card img,
    .blog-card img {
        max-width: 100%;
        height: auto;
    }
    h1 { font-size: 20px; }
    h2 { font-size: 18px; }
    h3 { font-size: 15px; }
    p, li { font-size: 13px; }
}

/* ── Sections padding ── */
@media (max-width: 600px) {
    section { padding: 32px 12px; }
    .quotes-section,
    .stories-section,
    .blog-section,
    .contact-section,
    .forum-section { padding: 32px 12px; }
}

/* ── Contact form ── */
@media (max-width: 600px) {
    .contact-form { padding: 0 4px; }
    .contact-form input,
    .contact-form textarea { font-size: 14px; }
    .contact-form .btn { width: 100%; }
}

/* ── Forum ── */
@media (max-width: 600px) {
    .forum-inner { padding: 0 4px; }
    .forum-compose { padding: 16px; }
    .forum-compose-row { flex-direction: column; }
    .forum-search-row { flex-direction: column; }
    .forum-post { padding: 12px 14px; }
    .forum-post-body { font-size: 13px; }
    .forum-submit-btn { width: 100%; }
}

/* ── Donate / About cards ── */
@media (max-width: 600px) {
    .donate-card { padding: 24px 16px; }
    .about-inner { flex-direction: column; gap: 20px; }
    .about-founder-img { width: 180px; height: 180px; }
    .about-content-col h2 { font-size: 20px; }
    .about-stats { gap: 12px; flex-wrap: wrap; }
}

/* ── Story full page ── */
@media (max-width: 600px) {
    .story-full { padding: 18px 14px; }
    .story-full h1 { font-size: 19px; }
    .story-body { font-size: 13px; }
}

/* ── Chatbot widget ── */
@media (max-width: 400px) {
    #chatBox { width: 90vw; right: 5vw; }
}

/* ── Buttons & links ── */
@media (max-width: 600px) {
    .btn { padding: 10px 18px; font-size: 14px; }
    .like-btn,
    .comments-toggle { font-size: 12px; }
}

/* ── General image safety ── */
img {
    max-width: 100%;
    height: auto;
}
