/* ------------------------------
   Reset & Base Styles
------------------------------ */

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #2a1e2f; /* Solid dark background for performance */
    color: #f0e7f7;
    min-height: 100%;
}

body {
    overflow-x: hidden;
    line-height: 1.6;
}

/* ------------------------------
   Container
------------------------------ */

.container {
    max-width: 1080px;
    margin: 2rem auto 4rem auto;
    padding: 0 1rem;
}

/* ------------------------------
   Navbar
------------------------------ */

.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(42, 30, 47, 0.9);
    /* Removed backdrop-filter for performance */
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 1rem;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(255, 26, 82, 0.4);
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
}

.nav-logo {
    height: 40px;
    cursor: pointer;
    transition: transform 0.3s ease;
    filter: drop-shadow(0 0 6px #ff1a52aa);
}

.nav-logo:hover {
    transform: scale(1.1);
    filter: drop-shadow(0 0 10px #ff1a52cc);
}

.menu-btn {
    background: none;
    border: none;
    cursor: pointer;
    width: 36px;
    height: 36px;
    position: relative;
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: center;
}

.menu-icon,
.menu-icon::before,
.menu-icon::after {
    content: "";
    display: block;
    width: 24px;
    height: 2.5px;
    background: #f0d4e4;
    border-radius: 2px;
    position: relative;
    transition: all 0.3s ease;
    box-shadow: 0 0 4px #ff1a52aa;
}

.menu-icon::before,
.menu-icon::after {
    position: absolute;
}

.menu-icon::before {
    top: -7px;
}

.menu-icon::after {
    bottom: -7px;
}

.menu-btn.active .menu-icon {
    background: transparent;
}

.menu-btn.active .menu-icon::before {
    top: 0;
    transform: rotate(45deg);
    box-shadow: 0 0 6px #ff1a52dd;
}

.menu-btn.active .menu-icon::after {
    bottom: 0;
    transform: rotate(-45deg);
    box-shadow: 0 0 6px #ff1a52dd;
}

/* Menu overlay */

.menu-overlay {
    position: fixed;
    top: 60px;
    right: 0;
    width: 220px;
    background: rgba(58, 34, 61, 0.9);
    /* Removed backdrop-filter */
    border-radius: 12px 0 0 12px;
    box-shadow: -5px 0 16px rgba(255, 26, 82, 0.5);
    opacity: 0;
    pointer-events: none;
    transform: translateX(100%);
    transition: all 0.3s ease;
    z-index: 1050;
}

.menu-overlay.active {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(0);
}

.menu-links {
    list-style: none;
    padding: 1rem 0;
}

.menu-links li {
    margin: 0.5rem 1rem;
}

.menu-links li a {
    color: #f0d4e4;
    font-weight: 600;
    text-decoration: none;
    font-size: 1.1rem;
    display: block;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: background-color 0.3s ease;
}

.menu-links li a:hover {
    background: rgba(255, 26, 82, 0.25);
}

/* ------------------------------
   Main Section (index.html)
------------------------------ */

.main {
    margin-top: 80px;
    text-align: center;
    padding: 3rem 1rem 5rem 1rem;
    position: relative;
    background: rgba(58, 34, 61, 0.85);
    border-radius: 16px;
    /* Removed backdrop-filter */
    box-shadow: 0 6px 20px rgba(255, 26, 82, 0.3);
    transition: background-position 0.3s ease;
}

.logo {
    width: 140px;
    margin-bottom: 1rem;
    filter: drop-shadow(0 0 8px #ff1a52cc);
    border-radius: 50%;
    transition: transform 0.3s ease;
}

.logo:hover {
    transform: rotate(8deg) scale(1.05);
}

.title {
    font-size: 2.6rem;
    font-weight: 700;
    margin-bottom: 0.3rem;
    color: #ff1a52;
    text-shadow: 0 0 8px #ff1a52cc;
    animation: glowPulse 3s infinite ease-in-out;
}

.subtitle {
    font-size: 1.2rem;
    font-weight: 500;
    margin-bottom: 1.2rem;
    color: #e7c7d6;
}

.download-btn {
    background: linear-gradient(135deg, #ff1a52, #ff3d7a);
    color: #fff;
    border: none;
    padding: 0.7rem 2rem;
    font-weight: 600;
    font-size: 1rem;
    border-radius: 10px;
    cursor: pointer;
    box-shadow: 0 4px 14px #ff1a52bb;
    transition: all 0.3s ease;
    user-select: none;
}

.download-btn:hover {
    background: linear-gradient(135deg, #ff3d7a, #ff1a52);
    box-shadow: 0 6px 20px #ff3d7acc;
    transform: scale(1.04);
}

.download-btn:active {
    transform: scale(0.95);
}

/* Scroll indicator */

.scroll-indicator {
    margin-top: 2rem;
    animation: bounce 2s infinite;
}

.chevron {
    display: inline-block;
    border-style: solid;
    border-width: 0.3rem 0.3rem 0 0;
    border-color: #ff1a52;
    width: 1.2rem;
    height: 1.2rem;
    transform: rotate(45deg);
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
        opacity: 1;
    }
    50% {
        transform: translateY(8px);
        opacity: 0.6;
    }
}

/* ------------------------------
   Waifu Pics Section
------------------------------ */

.waifupic {
    margin-top: 3rem;
    text-align: center;
}

.section-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: #ff1a52;
    margin-bottom: 1rem;
    text-shadow: 0 0 8px #ff3d7acc;
}

.waifuwu-container {
    display: flex;
    overflow-x: auto;
    gap: 0.8rem;
    padding: 0.8rem 0;
    cursor: grab;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

.waifu-img {
    border-radius: 14px;
    width: 200px;
    height: auto;
    box-shadow: 0 8px 20px rgba(255, 26, 82, 0.3);
    transition: transform 0.3s ease;
    user-select: none;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.07);
    /* Removed backdrop-filter */
}

.waifu-img:hover {
    transform: scale(1.08);
    box-shadow: 0 10px 26px rgba(255, 26, 82, 0.45);
}

/* ------------------------------
   About Section
------------------------------ */

.about {
    margin-top: 3rem;
}

.about-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.6rem;
}

.about-card {
    background: rgba(58, 34, 61, 0.9);
    border-radius: 12px;
    padding: 1.6rem;
    box-shadow: 0 6px 18px rgba(255, 26, 82, 0.25);
    user-select: none;
    transition: box-shadow 0.3s ease;
}

.about-card:hover {
    box-shadow: 0 8px 22px rgba(255, 26, 82, 0.45);
}

.about-card h3 {
    color: #ff1a52;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.about-card p {
    color: #e7c7d6;
    font-size: 1rem;
}

/* ------------------------------
   Footer
------------------------------ */

.footer {
    background: rgba(42, 30, 47, 0.9);
    padding: 1rem;
    text-align: center;
    font-size: 0.9rem;
    color: #d3a9b9;
    user-select: none;
    box-shadow: inset 0 1px 3px rgba(255, 26, 82, 0.4);
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
}

/* ------------------------------
   Login & Admin Forms
------------------------------ */

.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background: #2a1e2f;
    padding: 1rem;
}

.login-form {
    background: rgba(58, 34, 61, 0.95);
    padding: 2rem 2.5rem;
    border-radius: 16px;
    width: 100%;
    max-width: 400px;
    color: #f0e7f7;
    box-shadow: 0 6px 15px rgba(255, 26, 82, 0.4);
    animation: formFadeIn 0.6s ease forwards;
}

.login-form h2 {
    margin-bottom: 1.5rem;
    font-weight: 700;
    font-size: 2rem;
    color: #ff1a52;
    text-align: center;
}

.login-form label {
    font-size: 1rem;
    color: #d3a9b9;
    display: block;
    margin-bottom: 0.3rem;
    user-select: text;
}

.login-form input[type="email"],
.login-form input[type="password"],
.login-form textarea {
    width: 100%;
    padding: 0.7rem 1rem;
    font-size: 1rem;
    border: none;
    border-radius: 12px;
    background: rgba(42, 30, 47, 0.85);
    color: #f0d4e4;
    box-shadow: inset 0 0 6px #ff1a52aa;
    transition: box-shadow 0.3s ease, background-color 0.3s ease;
    outline-offset: 2px;
    user-select: text;
}

.login-form input[type="email"]:focus,
.login-form input[type="password"]:focus,
.login-form textarea:focus {
    background: rgba(42, 30, 47, 0.95);
    box-shadow: 0 0 12px #ff3d7a;
    outline: none;
    color: #fff;
}

.login-form textarea {
    resize: vertical;
    min-height: 100px;
}

.login-btn,
.publish-btn {
    width: 100%;
    margin-top: 1.2rem;
    padding: 0.7rem 0;
    font-size: 1.2rem;
    font-weight: 700;
    color: #fff;
    border: none;
    border-radius: 16px;
    cursor: pointer;
    background: linear-gradient(135deg, #ff1a52, #ff3d7a);
    box-shadow: 0 6px 18px #ff3d7acc;
    transition: background 0.3s ease, transform 0.2s ease;
    user-select: none;
}

.login-btn:hover,
.publish-btn:hover {
    background: linear-gradient(135deg, #ff3d7a, #ff1a52);
    box-shadow: 0 8px 24px #ff3d7acc;
    transform: scale(1.03);
}

.login-btn:active,
.publish-btn:active {
    transform: scale(0.97);
}

.login-error {
    margin-top: 0.8rem;
    color: #ff3d7a;
    font-weight: 600;
    text-align: center;
}

/* Title input styled like other login form inputs */
.login-form input[type="text"],
.login-form textarea {
    width: 100%;
    padding: 0.7rem 1rem;
    font-size: 1rem;
    border: none;
    border-radius: 12px;
    background: rgba(42, 30, 47, 0.85);
    color: #f0d4e4;
    box-shadow: inset 0 0 6px #ff1a52aa;
    transition: box-shadow 0.3s ease, background-color 0.3s ease;
    outline-offset: 2px;
    user-select: text;
    font-family: inherit;
}

.login-form input[type="text"]:focus,
.login-form textarea:focus {
    background: rgba(42, 30, 47, 0.95);
    box-shadow: 0 0 12px #ff3d7a;
    outline: none;
    color: #fff;
}

/* Manage Posts Section */
#postsList {
    max-width: 800px;
    margin: 0 auto;
    padding-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Each post card */
.post-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 3px 12px rgba(0,0,0,0.1);
    padding: 20px 25px;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.3s ease;
}

.post-card:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

/* Post title */
.post-card h3 {
    margin: 0 0 12px 0;
    font-size: 1.4rem;
    color: #222;
    font-weight: 700;
}

/* Post content preview */
.post-card p {
    font-size: 1rem;
    color: #444;
    margin: 0 0 16px 0;
    white-space: pre-wrap;
    max-height: 90px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Date at the bottom in italic */
.post-card .post-date {
    font-size: 0.85rem;
    color: #777;
    font-style: italic;
    margin-bottom: 12px;
}

/* Buttons container */
.post-card .btn-group {
    margin-top: auto;
    display: flex;
    gap: 12px;
}

/* Buttons */
.post-card button {
    flex: 1;
    padding: 10px 15px;
    font-size: 1rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.post-card button.edit-btn {
    background-color: #4caf50;
    color: #fff;
}

.post-card button.edit-btn:hover {
    background-color: #43a047;
}

.post-card button.delete-btn {
    background-color: #e53935;
    color: #fff;
}

.post-card button.delete-btn:hover {
    background-color: #d32f2f;
}

/* Responsive */
@media (max-width: 600px) {
    .post-card {
        padding: 16px 20px;
    }

    .post-card h3 {
        font-size: 1.2rem;
    }

    .post-card p {
        max-height: 70px;
    }
}


/* ------------------------------
   Animations
------------------------------ */

@keyframes formFadeIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes glowPulse {
    0%, 100% {
        text-shadow: 0 0 6px #ff1a52cc;
    }
    50% {
        text-shadow: 0 0 20px #ff3d7acc;
    }
}

