/* Poems Section Styling */
#poems-container {
    padding: 80px 0 40px;
    min-height: 100vh;
    background: #ffffff;
}

.poems-header {
    text-align: center;
    margin-bottom: 40px;
}

.poems-header h1 {
    font-size: 40px;
    color: #5BC1AC;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 3px;
}

.poems-header p {
    font-size: 18px;
    color: #666;
    max-width: 700px;
    margin: 0 auto;
}

/* Navigation Tabs */
.poems-nav {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
    border-bottom: 2px solid #5BC1AC;
}

.poems-nav button {
    background: none;
    border: none;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: bold;
    color: #5BC1AC;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.poems-nav button.active {
    background: #5BC1AC;
    color: white;
}

.poems-nav button:hover:not(.active) {
    background: rgba(91, 193, 172, 0.1);
}

/* Content Sections */
.poems-content {
    display: none;
    padding: 20px;
}

.poems-content.active {
    display: block;
}

/* Alphabet Navigation - 4 per row */
.alphabet-nav {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 30px;
    justify-content: center;
}

.alphabet-nav a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 90%;
    height: 45px;
    background: #5BC1AC;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: bold;
    transition: all 0.3s ease;
    text-align: center;
}

.alphabet-nav a:hover {
    background: #f86942;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* Letter sections - NEW ACCORDION STYLE */
.letter-section {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 15px;
}

.letter-header {
    background: #5BC1AC;
    color: white;
    padding: 20px;
    margin: 0;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.3s ease;
}

.letter-header:hover {
    background: #4aa895;
}

.letter-header.active {
    background: #f86942;
}

.letter-header i {
    transition: transform 0.3s ease;
}

.letter-header.active i {
    transform: rotate(180deg);
}

.letter-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.letter-content.active {
    max-height: 1000px;
}

.letter-poems {
    list-style: none;
    padding: 0;
    margin: 0;
}

.letter-poems li {
    border-bottom: 1px solid #eee;
}

.letter-poems li:last-child {
    border-bottom: none;
}

.letter-poems a {
    display: block;
    padding: 15px 20px;
    color: #333;
    text-decoration: none;
    transition: background 0.3s ease;
}

.letter-poems a:hover {
    background: rgba(91, 193, 172, 0.1);
}

/* Category Accordion - 3 COLUMNS ON WEB */
.category-accordion {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
}

/* 3 columns on desktop */
@media (min-width: 992px) {
    .category-accordion {
        grid-template-columns: repeat(3, 1fr);
    }
}

.category-item {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.category-header {
    background: #5BC1AC;
    color: white;
    padding: 20px;
    margin: 0;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.3s ease;
}

.category-header:hover {
    background: #4aa895;
}

.category-header.active {
    background: #f86942;
}

.category-header i {
    transition: transform 0.3s ease;
}

.category-header.active i {
    transform: rotate(180deg);
}

.category-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.category-content.active {
    max-height: 500px;
}

.category-poems {
    list-style: none;
    padding: 0;
    margin: 0;
}

.category-poems li {
    border-bottom: 1px solid #eee;
}

.category-poems li:last-child {
    border-bottom: none;
}

.category-poems a {
    display: block;
    padding: 15px 20px;
    color: #333;
    text-decoration: none;
    transition: background 0.3s ease;
}

.category-poems a:hover {
    background: rgba(91, 193, 172, 0.1);
}

/* Sidebar Dynamic Content */
#sidebar-dynamic-content,
#mobile-sidebar-dynamic-content {
    padding: 10px;
    border-top: 1px solid rgba(255,255,255,0.2);
    margin-top: 5px;
}

.sidebar-section {
    display: block; /* Always show on desktop */
}

.sidebar-section h4 {
    color: white;
    margin-bottom: 15px;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid rgba(255,255,255,0.3);
    padding-bottom: 5px;
}

/* Sidebar Categories */
.sidebar-categories-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-categories-list a {
    display: block;
    padding: 10px 15px;
    background: rgba(255,255,255,0.1);
    color: white;
    text-decoration: none;
    border-radius: 5px;
    transition: all 0.3s ease;
    font-size: 14px;
}

.sidebar-categories-list a:hover {
    background: white;
    color: #5BC1AC;
    transform: translateX(5px);
}

/* Sidebar Alphabet Grid */
.sidebar-alphabet-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}

.sidebar-alphabet-grid a {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 35px;
    background: rgba(255,255,255,0.1);
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-weight: bold;
    transition: all 0.3s ease;
    font-size: 14px;
}

.sidebar-alphabet-grid a:hover {
    background: white;
    color: #5BC1AC;
    transform: scale(1.1);
}

/* ===== MOBILE NAVIGATION ===== */
#mobile-nav {
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100vh;
    background: #5BC1AC;
    z-index: 10000;
    transition: left 0.3s ease;
    overflow-y: auto;
    box-shadow: 2px 0 15px rgba(0,0,0,0.3);
}

/* Remove any conflicting transform properties */
#mobile-nav.open {
    left: 0;
}

.mobile-nav-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.3);
    background: rgba(0,0,0,0.1);
}

.mobile-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 5px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.3s ease;
}

.mobile-close:hover {
    background: rgba(255,255,255,0.2);
}

.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 9999;
    display: none;
}

.mobile-menu-overlay.active {
    display: block;
}

/* Hamburger button - Square style */
.navbar-toggler {
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 10001;
    background-color: #5BC1AC;
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 8px;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    border: 2px solid white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.navbar-toggler:hover {
    background-color: #f86942;
    transform: scale(1.05);
}

/* Show hamburger on mobile */
@media (max-width: 991px) {
    .navbar-toggler {
        display: flex;
    }
}

/* For very small screens */
@media (max-width: 480px) {
    .navbar-toggler {
        width: 45px;
        height: 45px;
        top: 10px;
        left: 10px;
    }
}
/* Sidebar Section Visibility */
.sidebar-section {
    display: none;
}

.sidebar-section.active {
    display: block;
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 50px;
    right: 50px;
    background: #c00000;
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
    z-index: 1000;
}

.back-to-top:hover {
    background: #f86942;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.back-to-top.show {
    display: flex;
}

/* Adjust back-to-top button position for mobile */
@media (max-width: 768px) {
    .back-to-top {
        bottom: 50px;
        right: 50px;
        width: 45px;
        height: 45px;
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .back-to-top {
        bottom: 35px;
        right: 35px;
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
}

/* Poem Modal - FIXED CENTERING FOR MOBILE */
.poem-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 2000;
    overflow-y: auto;
    padding: 20px;
    box-sizing: border-box;
}

.poem-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.poem-modal-content {
    position: relative;
    background: white;
    margin: 0 auto;
    padding: 40px;
    border-radius: 15px;
    width: 85%;
    max-width: 800px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: modalFadeIn 0.3s ease;
    box-sizing: border-box;
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: translateY(-50px); }
    to { opacity: 1; transform: translateY(0); }
}

.poem-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #f86942;
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: background 0.3s ease;
}

.poem-modal-close:hover {
    background: #e05a35;
}

.poem-modal-body {
    padding: 20px 0;
}

.poem-modal-content-text {
    font-size: 18px;
    line-height: 1.8;
    white-space: pre-line;
    text-align: center;
    font-family: "Crimson Text", serif;
}

.poem-modal-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.poem-nav-btn {
    background: #5BC1AC;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.poem-nav-btn:hover {
    background: #f86942;
}

.poem-nav-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Mobile Modal Adjustments - FIXED CENTERING */
@media (max-width: 768px) {
    .poem-modal {
        padding: 10px;
        align-items: flex-start;
    }

    .poem-modal-content {
        margin: 20px auto;
        padding: 30px 20px;
        width: 85%;
        max-width: 95%;
    }

    .poem-modal-content-text {
        font-size: 16px;
        line-height: 1.6;
    }

    .alphabet-nav {
        grid-template-columns: repeat(4, 1fr);
        gap: 6px;
    }

    .alphabet-nav a {
        height: 40px;
        font-size: 14px;
    }

    .category-header {
        padding: 15px;
        font-size: 16px;
    }

    .sidebar-alphabet-grid a {
        height: 30px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .poem-modal-content {
        margin: 10px auto;
        padding: 20px 15px;
    }

    .poem-modal-nav {
        flex-direction: column;
        gap: 10px;
    }

    .poem-nav-btn {
        justify-content: center;
    }

    .alphabet-nav {
        grid-template-columns: repeat(4, 1fr);
        gap: 4px;
    }

    .alphabet-nav a {
        height: 35px;
        font-size: 12px;
        padding: 0 5px;
    }
}



/* ===== EMERGENCY MOBILE MENU FIX ===== */
#mobile-nav.open {
    left: 0 !important;
    transform: none !important;
    visibility: visible !important;
    opacity: 1 !important;
}

#mobile-nav:not(.open) {
    left: -280px !important;
}

/* Ensure mobile nav is above everything */
#mobile-nav {
    z-index: 10000 !important;
}

.mobile-menu-overlay {
    z-index: 9999 !important;
}

.navbar-toggler {
    z-index: 10001 !important;
}

/* Force show when open */
#mobile-nav.open {
    display: block !important;
    transform: translateX(0) !important;
}
.poem-title {
  font-size: 16px !important;
  font-weight: bold;
  text-shadow: 0px 0px 3px #000;
}
