/* Library Page Specific Styles - Only loads on library.html */
/* Cycling Over Sixty - Library Page CSS */

/* ===== LIBRARY HERO SECTION ===== */
.library-hero {
    background: linear-gradient(135deg, #2980b9 0%, #3498db 100%);
    color: white;
    padding: 80px 20px;
    margin-bottom: 40px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-heavy);
    text-align: center;
}

.library-hero .hero-content h2 {
    font-size: 3.5rem;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    animation: fadeInUp 1s ease-out;
}

.library-hero .hero-subtitle {
    font-size: 1.4rem;
    margin-bottom: 40px;
    opacity: 0.95;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    animation: fadeInUp 1s ease-out 0.2s both;
}

/* ===== CATEGORY NAVIGATION ===== */
.library-categories {
    margin-bottom: 50px;
}

.library-categories h3 {
    font-size: 2.2rem;
    color: var(--text-dark);
    text-align: center;
    margin-bottom: 30px;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.category-card {
    background: var(--background-white);
    padding: 25px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-light);
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    transition: all var(--transition-smooth);
    border: 2px solid transparent;
    cursor: pointer;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-medium);
    border-color: var(--primary-green);
}

.category-card.active {
    border-color: var(--primary-green);
    background: linear-gradient(135deg, #f8fff8, #ffffff);
}

.category-icon {
    font-size: 2.5rem;
    margin-bottom: 5px;
    transition: transform var(--transition-smooth);
}

.category-card:hover .category-icon {
    transform: scale(1.2);
}

.category-title {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--text-dark);
    text-align: center;
    margin: 0;
}

/* Category-specific colors */
.category-card.cardiovascular:hover { border-color: #e74c3c; }
.category-card.bone-health:hover { border-color: #f39c12; }
.category-card.mental-wellbeing:hover { border-color: #9b59b6; }
.category-card.weight-management:hover { border-color: #27ae60; }
.category-card.mobility-balance:hover { border-color: #3498db; }
.category-card.longevity:hover { border-color: #2ecc71; }
.category-card.safety:hover { border-color: #e67e22; }
.category-card.nutrition:hover { border-color: #16a085; }

/* ===== ARTICLE LIST SECTION ===== */
.article-list {
    margin-bottom: 50px;
}

.category-section {
    margin-bottom: 50px;
    scroll-margin-top: 100px;
}

.category-heading {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 2rem;
    color: var(--text-dark);
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 3px solid var(--primary-green);
}

.category-heading .category-icon {
    font-size: 2rem;
}

.article-category-container {
    display: grid;
    gap: 20px;
}

/* ===== ARTICLE ITEMS ===== */
.article-item {
    background: var(--background-white);
    padding: 25px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-light);
    transition: all var(--transition-smooth);
    border-left: 4px solid var(--primary-green);
    animation: fadeInUp 0.8s ease-out;
}

.article-item:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-medium);
}

.article-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.article-item h4 {
    margin-bottom: 15px;
    font-size: 1.3rem;
    line-height: 1.4;
}

.article-item h4 a {
    color: var(--text-dark);
    text-decoration: none;
    transition: color var(--transition-smooth);
}

.article-item h4 a:hover {
    color: var(--primary-green);
    text-decoration: underline;
}

.article-item p {
    color: var(--text-medium);
    line-height: 1.6;
    margin-bottom: 15px;
}

/* ===== ARTICLE TAGS ===== */
.article-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 15px;
}

.tag {
    background: var(--background-hero);
    color: var(--text-medium);
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* ===== READING LIST CTA ===== */
.reading-list-cta {
    background: linear-gradient(135deg, var(--primary-green), var(--accent-green));
    color: white;
    padding: 50px 30px;
    border-radius: var(--border-radius);
    text-align: center;
    margin-bottom: 50px;
    box-shadow: var(--shadow-heavy);
}

.cta-content h3 {
    font-size: 2.5rem;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.cta-content p {
    font-size: 1.2rem;
    margin-bottom: 30px;
    opacity: 0.95;
}

.cta-actions {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.cta-button {
    padding: 15px 30px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all var(--transition-smooth);
    text-decoration: none;
    display: inline-block;
}

.cta-button.primary {
    background: var(--background-white);
    color: var(--accent-green);
    border: 3px solid var(--background-white);
}

.cta-button.primary:hover {
    background: transparent;
    color: white;
    border-color: white;
    transform: translateY(-2px);
}

.cta-button.secondary {
    background: transparent;
    color: white;
    border: 3px solid white;
}

.cta-button.secondary:hover {
    background: white;
    color: var(--accent-green);
    transform: translateY(-2px);
}

/* Search and filter functionality removed for easier maintenance */

/* ===== LOADING STATES ===== */
.loading-spinner {
    display: none;
    text-align: center;
    padding: 40px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-green);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===== ARTICLE SUGGESTION MODAL ===== */
.suggestion-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    animation: fadeIn 0.3s ease-out;
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--background-white);
    padding: 40px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-heavy);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header h3 {
    margin: 0;
    color: var(--text-dark);
}

.close-modal {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-light);
    transition: color var(--transition-smooth);
}

.close-modal:hover {
    color: var(--text-dark);
}

.suggestion-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: var(--text-dark);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-family: inherit;
    transition: border-color var(--transition-smooth);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary-green);
    outline: none;
    box-shadow: 0 0 0 3px rgba(164, 226, 31, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.submit-suggestion {
    background: var(--primary-green);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: var(--border-radius);
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all var(--transition-smooth);
}

.submit-suggestion:hover {
    background: var(--accent-green);
    transform: translateY(-2px);
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .library-hero {
        padding: 60px 20px;
    }
    
    .library-hero .hero-content h2 {
        font-size: 2.5rem;
    }
    
    .library-hero .hero-subtitle {
        font-size: 1.2rem;
    }
    
    .category-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 15px;
    }
    
    .category-card {
        padding: 20px;
    }
    
    .category-heading {
        font-size: 1.8rem;
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .article-item {
        padding: 20px;
    }
    
    .article-item h4 {
        font-size: 1.2rem;
    }
    
    .library-controls {
        flex-direction: column;
        align-items: stretch;
        padding: 20px;
    }
    
    .search-box {
        min-width: auto;
    }
    
    .filter-buttons {
        justify-content: center;
    }
    
    .cta-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .cta-button {
        min-width: 200px;
        text-align: center;
    }
    
    .modal-content {
        padding: 30px 20px;
        max-width: 95%;
    }
}

@media (max-width: 480px) {
    .library-hero {
        padding: 40px 15px;
    }
    
    .library-hero .hero-content h2 {
        font-size: 2rem;
    }
    
    .library-hero .hero-subtitle {
        font-size: 1rem;
    }
    
    .category-grid {
        grid-template-columns: 1fr;
    }
    
    .category-card {
        padding: 15px;
    }
    
    .category-icon {
        font-size: 2rem;
    }
    
    .category-title {
        font-size: 1rem;
    }
    
    .category-heading {
        font-size: 1.6rem;
    }
    
    .article-item {
        padding: 15px;
    }
    
    .article-item h4 {
        font-size: 1.1rem;
    }
    
    .library-controls {
        padding: 15px;
    }
    
    .filter-btn {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
    
    .cta-content h3 {
        font-size: 2rem;
    }
    
    .cta-content p {
        font-size: 1rem;
    }
    
    .cta-button {
        padding: 12px 25px;
        font-size: 1rem;
    }
}

/* ===== PRINT STYLES ===== */
@media print {
    .library-hero,
    .reading-list-cta,
    .back-to-top {
        display: none;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .category-section {
        break-inside: avoid;
        margin-bottom: 30px;
    }
    
    .article-item {
        break-inside: avoid;
        margin-bottom: 15px;
        border: 1px solid #ddd;
        box-shadow: none;
    }
    
    .article-item h4 a {
        color: black;
        text-decoration: underline;
    }
    
    .category-heading {
        border-bottom-color: #ddd;
    }
}

/* ===== ANIMATION DELAYS FOR STAGGERED LOADING ===== */
.article-item:nth-child(1) { animation-delay: 0.1s; }
.article-item:nth-child(2) { animation-delay: 0.2s; }
.article-item:nth-child(3) { animation-delay: 0.3s; }
.article-item:nth-child(4) { animation-delay: 0.4s; }
.article-item:nth-child(5) { animation-delay: 0.5s; }

.category-card:nth-child(1) { animation: fadeInUp 0.8s ease-out 0.1s both; }
.category-card:nth-child(2) { animation: fadeInUp 0.8s ease-out 0.2s both; }
.category-card:nth-child(3) { animation: fadeInUp 0.8s ease-out 0.3s both; }
.category-card:nth-child(4) { animation: fadeInUp 0.8s ease-out 0.4s both; }
.category-card:nth-child(5) { animation: fadeInUp 0.8s ease-out 0.5s both; }
.category-card:nth-child(6) { animation: fadeInUp 0.8s ease-out 0.6s both; }
.category-card:nth-child(7) { animation: fadeInUp 0.8s ease-out 0.7s both; }
.category-card:nth-child(8) { animation: fadeInUp 0.8s ease-out 0.8s both; }