/* Home Page Specific Styles */

/* Section Headers */
.section-header {
    text-align: center;
    margin-bottom: 1rem;
}

.section-title {
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    background: linear-gradient(45deg, #3498db, #2ecc71);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-flex;
    align-items: center;
}

.section-subtitle {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin: 0;
}

/* User Digest Section */
.user-digest-section {
    margin-top: 0;
}

.digest-card {
    background: var(--bg-gradient);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    padding: 1.25rem;
    display: flex;
    gap: 1.25rem;
    align-items: center;
    box-shadow: 0 3px 15px var(--shadow);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.digest-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(to right, #3498db, #2ecc71);
}

.digest-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px var(--shadow);
}

.digest-card.digest-placeholder {
    background: rgba(52, 152, 219, 0.05);
    border: 2px dashed var(--border-color);
}

.digest-content {
    flex: 1;
}

.digest-label {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: linear-gradient(135deg, #f39c12, #e74c3c);
    color: #ffffff;
    padding: 0.3rem 0.75rem;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.digest-placeholder .digest-label {
    background: linear-gradient(135deg, #3498db, #2980b9);
}

.digest-title {
    color: var(--text-primary);
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.digest-description {
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.5;
    margin-bottom: 0.75rem;
}

.digest-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
}

/* Page header styling - Extracted from home_view.php */
.page-header-section {
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.1) 0%, rgba(46, 204, 113, 0.1) 100%);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.page-header-section h1 {
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0;
}

/* Light mode overrides */
body.light-mode .page-header-section {
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.05) 0%, rgba(46, 204, 113, 0.05) 100%);
}

.digest-date {
    color: var(--text-muted);
    font-size: 0.8rem;
    display: flex;
    align-items: center;
}

.btn-read-digest,
.btn-explore {
    background: linear-gradient(135deg, #3498db, #2ecc71);
    color: #ffffff;
    border: none;
    padding: 0.5rem 1.25rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(52, 152, 219, 0.3);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.btn-read-digest:hover,
.btn-explore:hover {
    color: #ffffff;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
}

.digest-image {
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, #3498db, #2ecc71);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.digest-image i {
    font-size: 2.5rem;
    color: #ffffff;
    opacity: 0.9;
}

/* Category Cards */
.category-card {
    background: var(--bg-gradient);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 8px var(--shadow);
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px var(--shadow);
}

.category-badge {
    background: linear-gradient(135deg, #3498db, #2ecc71);
    color: #ffffff;
    padding: 0.75rem;
    text-align: center;
    font-weight: 700;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.category-content {
    padding: 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.category-newsletter-title {
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.category-newsletter-desc {
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.4;
    margin-bottom: auto;
    flex: 1;
}

.category-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
}

.category-date {
    color: var(--text-muted);
    font-size: 0.75rem;
    display: flex;
    align-items: center;
}

.btn-view-category {
    background: var(--accent-blue);
    color: #ffffff;
    border: none;
    padding: 0.4rem 1rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.btn-view-category:hover {
    background: #2980b9;
    color: #ffffff;
    text-decoration: none;
    transform: translateX(5px);
}

.category-empty {
    text-align: center;
    padding: 2rem 0;
    color: var(--text-muted);
}

.category-empty i {
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

/* Popular Cards */
.popular-card {
    background: var(--bg-gradient);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem;
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 8px var(--shadow);
    position: relative;
    overflow: hidden;
}

.popular-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: linear-gradient(to bottom, #e74c3c, #c0392b);
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.popular-card:hover::before {
    transform: scaleY(1);
}

.popular-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px var(--shadow);
}

.popular-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.75rem;
}

.popular-icon i {
    font-size: 1.5rem;
    color: #ffffff;
}

.popular-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.popular-title {
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.popular-desc {
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.4;
    margin-bottom: 0.75rem;
    flex: 1;
}

.popular-stats {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.stat-item {
    color: var(--text-secondary);
    font-size: 0.8rem;
    display: flex;
    align-items: center;
}

.stat-item i {
    color: var(--accent-red);
}

.btn-read-popular {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: #ffffff;
    border: none;
    padding: 0.5rem 1.25rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    box-shadow: 0 3px 10px rgba(231, 76, 60, 0.3);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
}

.btn-read-popular:hover {
    color: #ffffff;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(231, 76, 60, 0.4);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--text-secondary);
    background: var(--card-bg);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.empty-state i {
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    font-size: 2rem;
}

.empty-state h4 {
    color: var(--text-primary);
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.empty-state p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin: 0;
}

/* Responsive Design */
@media (max-width: 992px) {
    .section-title {
        font-size: 1.35rem;
    }

    .digest-card {
        flex-direction: column;
        text-align: center;
        padding: 1rem;
    }

    .digest-image {
        width: 80px;
        height: 80px;
    }

    .digest-image i {
        font-size: 2rem;
    }

    .digest-meta {
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .section-title {
        font-size: 1.25rem;
    }

    .section-subtitle {
        font-size: 0.8rem;
    }

    .digest-card {
        padding: 1rem;
    }

    .digest-title {
        font-size: 1.1rem;
    }

    .digest-description {
        font-size: 0.8rem;
    }

    .category-newsletter-title,
    .popular-title {
        font-size: 1rem;
    }

    .category-newsletter-desc,
    .popular-desc {
        font-size: 0.8rem;
    }

    .popular-stats {
        gap: 0.75rem;
    }

    .btn-read-digest,
    .btn-explore,
    .btn-read-popular {
        padding: 0.4rem 1rem;
        font-size: 0.8rem;
    }
}

/* Light Mode Adjustments */
body.light-mode .category-card,
body.light-mode .popular-card,
body.light-mode .digest-card {
    background: var(--bg-secondary);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
}

body.light-mode .category-card:hover,
body.light-mode .popular-card:hover,
body.light-mode .digest-card:hover {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
}

body.light-mode .digest-card.digest-placeholder {
    background: rgba(52, 152, 219, 0.05);
}

body.light-mode .empty-state {
    background: rgba(0, 0, 0, 0.02);
}
/* Additional Home View Styles */

/* Remove overflow restrictions */
html, body {
    overflow: hidden !important;
}

.container {
    overflow: visible !important;
}

/* Ensure dropdown menu can escape bounds */
.newest-category-section {
    overflow: visible !important;
}

.dropdown {
    position: static !important;
}

.dropdown-menu {
    position: absolute !important;
}

/* Category View More Styling */
.category-hidden {
    display: none;
}

#viewMoreCategoriesBtn {
    transition: all 0.3s ease;
    padding: 8px 16px;
    font-weight: 500;
    border-radius: 8px;
    font-size: 0.875rem;
    max-width: 280px;
    background: linear-gradient(135deg, #3498db, #2ecc71);
    color: #ffffff;
    border: none;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.3);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

#viewMoreCategoriesBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.4);
    background: linear-gradient(135deg, #2980b9, #27ae60);
}

/* Dropdown menu styling - consistent with site style */
.category-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--bg-gradient);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: 0 5px 20px var(--shadow);
    min-width: 280px;
    max-height: 400px;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s, background 0.3s ease;
    z-index: 1000;
    pointer-events: none;
    margin-top: 5px;
}

.category-dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.category-dropdown-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.8rem 1.2rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.3s;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    border-radius: 8px;
    margin: 2px 8px;
}

.category-dropdown-item:last-child {
    border-bottom: none;
}

.category-dropdown-item:hover {
    background-color: var(--hover-bg);
    color: var(--accent-blue);
    transform: translateX(4px);
}

.category-name {
    display: flex;
    align-items: center;
    flex: 1;
}

.favorite-btn-icon-small {
    background: none;
    border: none;
    color: #e74c3c;
    cursor: pointer;
    padding: 4px 8px;
    transition: all 0.2s ease;
    font-size: 0.85rem;
    border-radius: 50%;
}

.favorite-btn-icon-small:hover {
    color: #c0392b;
    background-color: rgba(231, 76, 60, 0.1);
    transform: scale(1.1);
}

.favorite-btn-icon-small.active i {
    color: #e74c3c;
    font-weight: 900;
}

/* Light mode dropdown */
body.light-mode .category-dropdown-menu {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    box-shadow: 0 5px 20px var(--shadow);
}

body.light-mode .category-dropdown-item {
    color: #2c3e50;
}

body.light-mode .category-dropdown-item:hover {
    background-color: rgba(52, 152, 219, 0.08);
    color: #2980b9;
}

/* Highlight flash animation */
@keyframes highlightFlash {
    0%, 100% {
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }
    50% {
        box-shadow: 0 0 20px rgba(52, 152, 219, 0.6);
        transform: scale(1.02);
    }
}

.highlight-flash .category-card {
    animation: highlightFlash 1s ease-in-out;
}

.category-dropdown-wrapper {
    position: relative;
    display: inline-block;
    margin-bottom: 20px;
}

/* Category card clickable styling */
.category-card {
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 180px;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(52, 152, 219, 0.3);
}

.category-count-display {
    text-align: center;
    padding: 20px 15px;
}

.count-number {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #3498db, #2ecc71);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
    margin-bottom: 8px;
}

.count-label {
    font-size: 0.95rem;
    color: #95a5a6;
    font-weight: 500;
}

.category-icon-display {
    font-size: 1.8rem;
    color: #3498db;
    margin-bottom: 10px;
}

body.light-mode .count-label {
    color: #7f8c8d;
}

body.light-mode .category-icon-display {
    color: #2980b9;
}

/* Notification animations */
@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}
