/* ============================================
   Mr. Smile Fish Haven — Stories Page CSS
   ============================================ */

/* ── STORIES HERO ── */
.stories-hero {
    background: linear-gradient(135deg, rgba(22,104,22,0.85), rgba(34,139,34,0.75)),
                url("../images/wp12421081-aquarium-4k-wallpapers.jpg") no-repeat center/cover;
    padding: 4rem 0;
    text-align: center;
    color: white;
    border-radius: 0 0 20px 20px;
    margin-bottom: 2rem;
}

.stories-hero h1 {
    font-size: clamp(2rem, 4vw, 3rem);
    margin-bottom: 0.8rem;
}

.stories-hero p {
    font-size: 1.05rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}

/* ── LAYOUT ── */
.stories-layout {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
    padding: 2rem 0 4rem;
}

.stories-feed {
    flex: 1;
    min-width: 0;
}

.stories-sidebar {
    flex: 0 0 300px;
    position: sticky;
    top: 100px;
}

/* ── TOOLBAR ── */
.stories-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.cat-filters {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.cat-pill {
    padding: 0.4rem 1rem;
    background: white;
    border: 1px solid rgba(144,238,144,0.4);
    border-radius: 20px;
    color: #4a7a4a;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

.cat-pill:hover {
    background: #E0F2E9;
    border-color: #228B22;
}

.cat-pill.active {
    background: linear-gradient(135deg, #228B22, #90EE90);
    color: white;
    border-color: #228B22;
}

.sort-select {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #4a7a4a;
    font-size: 0.9rem;
}

.sort-select select {
    padding: 0.4rem 1rem;
    border: 1.5px solid rgba(144,238,144,0.5);
    border-radius: 10px;
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    color: #2F4F2F;
    background: white;
    cursor: pointer;
}

/* ── STORY CARD ── */
.story-card {
    display: flex;
    gap: 1.2rem;
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 8px 30px rgba(22,104,22,0.1);
    border: 1px solid rgba(144,238,144,0.3);
    transition: all 0.3s ease;
}

.story-card:hover {
    box-shadow: 0 15px 45px rgba(22,104,22,0.15);
}

/* Vote Column */
.story-vote-col {
    flex: 0 0 50px;
    text-align: center;
}

.like-btn {
    background: none;
    border: 2px solid rgba(144,238,144,0.4);
    border-radius: 12px;
    padding: 0.6rem 0.4rem;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #ccc;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    width: 100%;
    font-family: 'Inter', sans-serif;
}

.like-btn:hover {
    border-color: #ff6b6b;
    color: #ff6b6b;
    background: rgba(255,107,107,0.05);
}

.like-btn.liked {
    border-color: #ff6b6b;
    color: #ff6b6b;
    background: rgba(255,107,107,0.1);
}

.like-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.like-btn i {
    font-size: 1.3rem;
}

.like-count {
    font-size: 0.85rem;
    font-weight: 700;
}

/* Story Body */
.story-body {
    flex: 1;
    min-width: 0;
}

.story-meta-top {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

.story-cat-badge {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.2rem 0.7rem;
    border-radius: 20px;
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.cat-experience   { background:#e8f5e9; color:#2e7d32; }
.cat-tips-care    { background:#e3f2fd; color:#1565c0; }
.cat-tips--care   { background:#e3f2fd; color:#1565c0; } /* keep both for safety */
.cat-showcase     { background:#fff8e1; color:#f57f17; }
.cat-question     { background:#fce4ec; color:#c62828; }
.cat-review       { background:#f3e5f5; color:#6a1b9a; }

.story-author {
    font-size: 0.85rem;
    color: #4a7a4a;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.story-date {
    font-size: 0.8rem;
    color: #888;
}

.story-product-tag {
    font-size: 0.8rem;
    background: #fff8e1;
    color: #f57f17;
    padding: 0.15rem 0.6rem;
    border-radius: 12px;
    font-weight: 600;
}

.story-title {
    font-size: 1.3rem;
    color: #166816;
    margin: 0.5rem 0 0.8rem;
    font-weight: 700;
    line-height: 1.4;
}

.story-content {
    color: #555;
    font-size: 0.95rem;
    line-height: 1.7;
    margin-bottom: 1rem;
}

.story-image {
    width: 100%;
    max-height: 300px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 1rem;
}

/* Story Actions */
.story-actions {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    padding-top: 0.8rem;
    border-top: 1px solid #E0F2E9;
}

.action-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #4a7a4a;
    font-size: 0.88rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: color 0.2s;
}

.action-btn:hover {
    color: #228B22;
}

.story-engagement {
    font-size: 0.85rem;
    color: #888;
    margin-left: auto;
}

/* ── COMMENTS ── */
.comments-panel {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #E0F2E9;
}

.comments-list {
    margin-bottom: 1rem;
}

.comment-item {
    padding: 0.8rem 0;
    border-bottom: 1px solid #F0F8F0;
}

.comment-item:last-child {
    border-bottom: none;
}

.comment-author {
    font-size: 0.85rem;
    font-weight: 600;
    color: #166816;
    margin-bottom: 0.3rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.comment-date {
    font-size: 0.75rem;
    color: #aaa;
    font-weight: 400;
}

.comment-item p {
    font-size: 0.9rem;
    color: #555;
    line-height: 1.6;
}

.no-comments-msg {
    color: #aaa;
    font-size: 0.88rem;
    text-align: center;
    padding: 1rem 0;
}

.login-to-comment {
    font-size: 0.88rem;
    color: #888;
    text-align: center;
    padding: 0.5rem;
}

.login-to-comment a {
    color: #228B22;
    font-weight: 700;
}

/* Comment Form */
.comment-input-row {
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
}

.comment-textarea {
    flex: 1;
    padding: 0.7rem 1rem;
    border: 2px solid rgba(144,238,144,0.4);
    border-radius: 10px;
    font-family: 'Inter', sans-serif;
    font-size: 0.88rem;
    resize: vertical;
    transition: border-color 0.3s;
}

.comment-textarea:focus {
    outline: none;
    border-color: #228B22;
}

.comment-submit-btn {
    background: linear-gradient(135deg, #228B22, #90EE90);
    color: white;
    border: none;
    border-radius: 10px;
    padding: 0.7rem 1rem;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s;
}

.comment-submit-btn:hover {
    background: linear-gradient(135deg, #166816, #228B22);
    transform: translateY(-2px);
}

/* ── SIDEBAR ── */
.sidebar-card {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 8px 25px rgba(22,104,22,0.1);
    border: 1px solid rgba(144,238,144,0.3);
}

.sidebar-card h3 {
    color: #166816;
    font-size: 1rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.verified-notice {
    background: #fff8e1;
    border: 1px solid #ffe082;
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    font-size: 0.85rem;
    color: #856404;
}

.verified-notice i {
    font-size: 1.2rem;
    flex-shrink: 0;
    margin-top: 0.1rem;
}

/* Community Stats */
.community-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.cs-item {
    text-align: center;
    padding: 1rem 0.5rem;
    background: #F0F8F0;
    border-radius: 12px;
}

.cs-num {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: #166816;
}

.cs-label {
    display: block;
    font-size: 0.78rem;
    color: #4a7a4a;
    margin-top: 0.2rem;
}

/* Top Contributors */
.top-contrib-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.top-contrib-list li {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid #F0F8F0;
    font-size: 0.9rem;
}

.top-contrib-list li:last-child {
    border-bottom: none;
}

.contrib-rank {
    font-size: 1.2rem;
    width: 28px;
    text-align: center;
}

.contrib-name {
    flex: 1;
    color: #2F4F2F;
    font-weight: 500;
}

.contrib-stat {
    color: #4a7a4a;
    font-size: 0.85rem;
}

/* ── POST STORY MODAL ── */
#postStoryModal {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.55);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(3px);
}

#postStoryModal.active {
    display: flex;
}

#postStoryModal .modal-content {
    background: white;
    padding: 2.5rem;
    border-radius: 20px;
    max-width: 600px;
    width: 92%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: modalIn 0.3s ease;
    border-top: 5px solid #228B22;
    text-align: left;
}

@keyframes modalIn {
    from { transform: scale(0.85) translateY(20px); opacity: 0; }
    to   { transform: scale(1) translateY(0); opacity: 1; }
}

#postStoryModal .modal-close {
    position: absolute;
    right: 1.5rem; top: 1.2rem;
    font-size: 1.8rem;
    cursor: pointer;
    color: #6c757d;
    line-height: 1;
    background: none;
    border: none;
    transition: color 0.2s;
}

#postStoryModal .modal-close:hover {
    color: #333;
}

#postStoryModal .modal-content h3 {
    color: #166816;
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    text-align: left;
}

#postStoryModal .modal-content p {
    text-align: left;
}

/* ── EMPTY STATE ── */
.no-stories {
    text-align: center;
    padding: 4rem 2rem;
    color: #4a7a4a;
}

.no-stories i {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
}

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
    .stories-layout {
        flex-direction: column;
    }

    .stories-sidebar {
        flex: none;
        position: static;
        width: 100%;
    }

    .story-card {
        flex-direction: column;
    }

    .story-vote-col {
        flex: none;
        display: flex;
        justify-content: flex-start;
    }

    .like-btn {
        width: auto;
        flex-direction: row;
        padding: 0.4rem 0.8rem;
    }
}

@media (max-width: 600px) {
    .stories-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .community-stats {
        grid-template-columns: repeat(4, 1fr);
    }
}