/* Reset basic margins and spacing */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Base Body Styling - Cute Pastel Aesthetic */
body {
    font-family: 'Quicksand', 'Chalkboard SE', 'Comic Sans MS', sans-serif;
    line-height: 1.6;
    color: #6b4e53;
    background-color: #fff0f5; /* Light soft pink background */
    background-image: radial-gradient(#f7cad0 1.5px, transparent 1.5px); /* Soft polka dots */
    background-size: 24px 24px;
    min-height: 100vh;
    padding-top: 110px; /* Space for fixed header at top */
    padding-bottom: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: background-color 0.3s ease, color 0.3s ease;
    overflow-x: hidden;
}

/* Dark Mode Theme Overrides */
body.dark-theme {
    background-color: #2b1e2a;
    background-image: radial-gradient(#4a3248 1.5px, transparent 1.5px);
    color: #f3d5e4;
}

body.dark-theme .top-navbar,
body.dark-theme .page-section,
body.dark-theme .entry-card {
    background-color: #3a2838;
    color: #f3d5e4;
    border-color: #6b435c;
}

body.dark-theme .nav-link,
body.dark-theme .editor-tools {
    background-color: #4a3248;
    color: #f3d5e4;
    border-color: #6b435c;
}

body.dark-theme input,
body.dark-theme textarea,
body.dark-theme select {
    background-color: #2b1e2a;
    color: #f3d5e4;
    border-color: #6b435c;
}

body.dark-theme li {
    background-color: #4a3248;
    border-color: #6b435c;
    color: #f3d5e4;
}

/* Fixed Top Header Navbar */
.top-navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: #ffffff;
    border-bottom: 3px dashed #ffccd5;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 15px rgba(255, 182, 193, 0.25);
    z-index: 1000;
}

/* Brand Name Container */
.brand-container {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Cute Bold Bubble Text for App Name */
.app-title {
    font-size: 1.8rem;
    font-weight: 900;
    color: #ff758f;
    letter-spacing: 1px;
    text-shadow: 2px 2px 0px #ffccd5, 3px 3px 0px #b5838d;
    font-family: 'Fredoka One', 'Comic Sans MS', sans-serif;
    white-space: nowrap;
}

/* Nav Links Group */
.nav-links {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.nav-link {
    text-decoration: none;
    color: #b5838d;
    font-weight: bold;
    font-size: 0.95rem;
    cursor: pointer;
    padding: 8px 14px;
    border-radius: 20px;
    background-color: #fff0f3;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.nav-link:hover {
    background-color: #ff758f;
    color: #ffffff;
    transform: translateY(-2px);
}

/* Decorative Floating Animal Stickers on Page Sides */
.decor-sticker {
    position: fixed;
    font-size: 3rem;
    background-color: #ffffff;
    width: 70px;
    height: 70px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px dashed #ffccd5;
    box-shadow: 0 8px 20px rgba(255, 182, 193, 0.4);
    animation: floatBounce 4s ease-in-out infinite alternate;
    z-index: 10;
}

.sticker-top-left { top: 120px; left: 25px; animation-delay: 0s; }
.sticker-top-right { top: 120px; right: 25px; animation-delay: 1s; }
.sticker-bottom-left { bottom: 30px; left: 25px; animation-delay: 2s; }
.sticker-bottom-right { bottom: 30px; right: 25px; animation-delay: 1.5s; }

@keyframes floatBounce {
    0% { transform: translateY(0) rotate(0deg); }
    100% { transform: translateY(-15px) rotate(8deg); }
}

/* Page Section Container */
.page-section {
    display: none;
    background-color: #ffffff;
    max-width: 650px;
    width: 90%;
    margin: 20px auto;
    padding: 40px;
    border-radius: 30px;
    border: 3px solid #ffccd5;
    box-shadow: 0 10px 25px rgba(255, 182, 193, 0.3);
    text-align: center;
    position: relative;
}

.page-section.active {
    display: block;
}

/* Cute Floating Sparkle Animations for Home */
.sparkles-container {
    position: absolute;
    top: 10px;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.sparkle {
    position: absolute;
    font-size: 1.3rem;
    animation: sparkleTwinkle 2.5s ease-in-out infinite alternate;
}

.sp-1 { top: 12px; left: 20px; animation-delay: 0.2s; }
.sp-2 { top: 20px; right: 25px; animation-delay: 0.8s; }
.sp-3 { top: 140px; left: 15px; animation-delay: 1.4s; }
.sp-4 { top: 180px; right: 15px; animation-delay: 0.5s; }
.sp-5 { bottom: 20px; left: 30px; animation-delay: 1.1s; }
.sp-6 { bottom: 25px; right: 30px; animation-delay: 1.7s; }

@keyframes sparkleTwinkle {
    0% { transform: scale(0.7) rotate(0deg); opacity: 0.3; }
    100% { transform: scale(1.3) rotate(20deg); opacity: 1; }
}

/* Home Hero Section */
.home-hero {
    margin-bottom: 25px;
    padding: 0 10px;
}

.hero-title {
    font-size: 2.4rem;
    color: #ff758f;
    line-height: 1.2;
    margin-bottom: 8px;
    word-wrap: break-word;
}

.hero-subtitle {
    font-size: 1.15rem;
    font-weight: bold;
    color: #b5838d;
    margin-bottom: 15px;
    line-height: 1.4;
}

/* Cute Picture Gallery Strip on Landing Page */
.cute-picture-strip {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 25px;
    flex-wrap: wrap;
}

.picture-card {
    font-size: 2.2rem;
    background-color: #fff0f3;
    width: 60px;
    height: 60px;
    line-height: 60px;
    border-radius: 18px;
    border: 2px dashed #ffb3c1;
    display: inline-block;
    transition: transform 0.2s ease;
}

.picture-card:hover {
    transform: scale(1.2) rotate(-5deg);
}

/* Page Titles */
h1 {
    font-size: 2.1rem;
    color: #ff758f;
    margin-bottom: 16px;
    line-height: 1.2;
}

/* Subtitles & Headings */
h2 {
    font-size: 1.4rem;
    color: #b5838d;
    margin: 28px 0 16px 0;
    line-height: 1.3;
}

h3 {
    font-size: 1.1rem;
    color: #b5838d;
    margin-bottom: 8px;
}

/* Paragraph text */
p {
    font-size: 1.05rem;
    margin-bottom: 20px;
    word-wrap: break-word;
}

/* Profile Avatar Section */
.profile-header {
    margin-bottom: 20px;
}

.large-avatar {
    font-size: 4rem;
    background-color: #fff0f3;
    width: 100px;
    height: 100px;
    line-height: 100px;
    border-radius: 50%;
    margin: 0 auto 10px auto;
    border: 3px dashed #ffb3c1;
}

.avatar-picker {
    justify-content: center;
    gap: 8px;
}

.avatar-option-btn {
    font-size: 1.6rem;
    padding: 6px 12px;
    border-radius: 15px;
    background-color: #ffffff;
    border: 2px solid #ffccd5;
    cursor: pointer;
    margin: 0;
}

.avatar-option-btn:hover {
    transform: scale(1.2);
    background-color: #ffe6ea;
}

/* Inputs & Form Layout */
form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 420px;
    width: 100%;
    margin: 0 auto 20px auto;
}

input, textarea, select {
    width: 100%;
    padding: 12px 16px;
    border-radius: 20px;
    border: 2px solid #ffccd5;
    background-color: #fffafb;
    color: #6b4e53;
    font-family: inherit;
    font-size: 1rem;
    outline: none;
    transition: all 0.2s ease;
}

input:focus, textarea:focus, select:focus {
    border-color: #ff758f;
    box-shadow: 0 0 8px rgba(255, 117, 143, 0.3);
}

textarea {
    resize: vertical;
    height: 120px;
}

/* Button Containers */
#landing-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

/* Cute Button Styling */
button {
    font-size: 1rem;
    font-family: inherit;
    font-weight: bold;
    padding: 12px 24px;
    margin: 4px;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    max-width: 100%;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(255, 117, 143, 0.3);
}

/* Primary Buttons */
button[type="submit"], #show-signup-btn {
    background-color: #ff758f;
    color: #ffffff;
}

/* Secondary Buttons */
#show-login-btn, #back-from-signup, #back-from-login, #logout-btn-1, #logout-btn-2, #toggle-theme-btn, #toggle-privacy-btn {
    background-color: #e2afff;
    color: #4a2840;
}

/* Formatting Controls Box */
.editor-tools {
    background-color: #fff0f3;
    padding: 18px;
    border-radius: 20px;
    border: 2px dashed #ffb3c1;
    margin-bottom: 20px;
    text-align: left;
}

.settings-box {
    text-align: center;
}

.toggle-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

.tool-group {
    margin-bottom: 12px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
}

.sticker-btn {
    background-color: #ffffff;
    border: 1px solid #ffccd5;
    border-radius: 12px;
    padding: 6px 10px;
    font-size: 1.2rem;
    cursor: pointer;
    margin: 0;
}

.sticker-btn:hover {
    transform: scale(1.15);
    background-color: #ffe6ea;
}

/* Features & Request List Styling */
ul {
    list-style-type: none;
    padding: 0;
    width: 100%;
}

li {
    background-color: #fff0f3;
    margin-bottom: 12px;
    padding: 14px 18px;
    border-radius: 20px;
    border: 2px dashed #ffb3c1;
    font-size: 1rem;
    text-align: left;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    word-break: break-word;
}

.request-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.action-btn-group {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.action-btn {
    font-size: 0.85rem;
    padding: 6px 12px;
    border-radius: 12px;
    margin: 0;
}

.accept-btn {
    background-color: #2a9d8f;
    color: white;
}

.ignore-btn {
    background-color: #e2afff;
    color: #4a2840;
}

.block-btn {
    background-color: #e63946;
    color: white;
}

/* Saved entries formatting & Responsive Dashboard Cards */
.entry-card {
    background-color: #ffffff;
    margin-bottom: 15px;
    padding: 18px;
    border-radius: 20px;
    border: 2px solid #ffccd5;
    text-align: left;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.shared-card {
    border: 2px dashed #b5838d;
    background-color: #fffafc;
}

.shared-badge {
    font-size: 0.85rem;
    color: #b5838d;
    margin-bottom: 8px;
    padding: 4px 8px;
    background-color: #fff0f3;
    border-radius: 10px;
    display: inline-block;
}

.entry-card .entry-date {
    font-size: 0.8rem;
    color: #aaa;
    margin-top: 8px;
}

/* Error / Info Messages */
.error-message {
    font-size: 0.95rem;
    margin-bottom: 12px;
    font-weight: bold;
}

/* ==========================================================================
   MOBILE & TABLET RESPONSIVE MEDIA QUERIES
   ========================================================================== */

@media screen and (max-width: 1024px) {
    .decor-sticker {
        display: none; /* Hide background side stickers on smaller screens to keep clean */
    }
}

/* Tablets & Smaller Desktops (Max-width: 768px) */
@media screen and (max-width: 768px) {
    body {
        padding-top: 130px;
    }

    .top-navbar {
        flex-direction: column;
        gap: 10px;
        padding: 10px 15px;
    }

    .brand-container {
        width: 100%;
    }

    .app-title {
        font-size: 1.6rem;
    }

    .nav-links {
        width: 100%;
        justify-content: center;
        gap: 6px;
    }

    .nav-link {
        font-size: 0.85rem;
        padding: 6px 10px;
    }

    .page-section {
        padding: 25px 20px;
        margin: 15px auto;
        border-radius: 24px;
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1.05rem;
    }

    h1 {
        font-size: 1.75rem;
    }

    h2 {
        font-size: 1.25rem;
    }
}

/* Mobile Devices (Max-width: 480px) */
@media screen and (max-width: 480px) {
    body {
        padding-top: 150px;
        padding-bottom: 25px;
    }

    .top-navbar {
        padding: 8px 10px;
    }

    .app-title {
        font-size: 1.5rem;
    }

    .nav-links {
        gap: 4px;
    }

    .nav-link {
        font-size: 0.8rem;
        padding: 5px 8px;
        border-radius: 14px;
    }

    .page-section {
        width: 94%;
        padding: 20px 15px;
        border-radius: 20px;
        border-width: 2px;
    }

    .hero-title {
        font-size: 1.6rem;
    }

    .hero-subtitle {
        font-size: 0.95rem;
    }

    h1 {
        font-size: 1.5rem;
    }

    p, li {
        font-size: 0.95rem;
    }

    #landing-buttons,
    button {
        width: 100%;
        margin: 4px 0;
    }

    .toggle-row {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .toggle-row button {
        width: 100%;
    }

    li, .request-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .action-btn-group {
        width: 100%;
        justify-content: flex-start;
    }

    .action-btn {
        flex: 1;
        text-align: center;
        padding: 8px 10px;
    }

    .editor-tools {
        padding: 14px;
    }

    .tool-group {
        flex-direction: column;
        align-items: stretch;
    }

    .avatar-picker, .tool-group:has(.sticker-btn) {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }

    .entry-card {
        padding: 14px;
    }
}