/* =====================================================
   ALL COURSES SHORTCODE - Styles
   ===================================================== */

/* --- Wrapper --- */
.ahovn-all-courses-wrapper {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    max-width: 1100px;
    margin: 0 auto;
    padding: 10px 0;
}

/* --- Header: Tabs + Top10 Button --- */
.ahovn-courses-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 2px solid #f0f0f0;
}

/* --- Tab Buttons --- */
.ahovn-courses-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    flex: 1;
}

.ahovn-tab-btn {
    background: #f4f5f7;
    border: 2px solid transparent;
    border-radius: 20px;
    padding: 6px 16px;
    font-size: 13px;
    font-weight: 500;
    color: #555;
    cursor: pointer;
    transition: all 0.2s ease;
    line-height: 1.4;
}
.ahovn-tab-btn:hover {
    background: #e8f0fe;
    color: #0073aa;
    border-color: #b3d1f0;
}
.ahovn-tab-btn.active {
    background: #0073aa;
    color: #fff;
    border-color: #0073aa;
    box-shadow: 0 2px 8px rgba(0,115,170,0.3);
}

/* --- Top 10 Button --- */
.ahovn-top10-btn {
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: #fff;
    border: none;
    border-radius: 20px;
    padding: 8px 18px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 3px 10px rgba(243,156,18,0.4);
    white-space: nowrap;
    flex-shrink: 0;
}
.ahovn-top10-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(243,156,18,0.5);
    background: linear-gradient(135deg, #e67e22, #d35400);
}

/* --- Courses Grid --- */
.ahovn-courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 16px;
}

/* --- Course Card --- */
.ahovn-course-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background: #fff;
    border-radius: 14px;
    padding: 18px 12px 14px;
    text-decoration: none;
    color: #333;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
    border: 1px solid #eee;
    transition: all 0.22s ease;
    min-height: 130px;
    position: relative;
}
.ahovn-course-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    border-color: #b3d1f0;
    text-decoration: none;
    color: #333;
}
.ahovn-course-card.ahovn-hidden {
    display: none;
}

/* --- Card Icon Area --- */
.ahovn-course-card-icon {
    width: 60px;
    height: 60px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
    flex-shrink: 0;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0,0,0,0.15);
}
.ahovn-course-card-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 12px;
}
.ahovn-course-icon-text {
    font-size: 28px;
    line-height: 1;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.ahovn-course-icon-default {
    font-size: 26px;
    font-weight: 800;
    color: #fff;
    text-transform: uppercase;
    text-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

/* --- Card Body --- */
.ahovn-course-card-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    width: 100%;
}
.ahovn-course-card-title {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.35;
    color: #2c3e50;
    margin: 0;
    word-break: break-word;
    hyphens: auto;
}
.ahovn-course-card-group {
    font-size: 11px;
    color: #0073aa;
    background: #e8f4fb;
    padding: 1px 7px;
    border-radius: 8px;
}
.ahovn-course-card-count {
    font-size: 11px;
    color: #999;
}

/* --- No Results --- */
.ahovn-no-results {
    text-align: center;
    padding: 40px 20px;
    color: #888;
    font-style: italic;
    background: #fafafa;
    border-radius: 10px;
    border: 2px dashed #e0e0e0;
    margin-top: 10px;
}
.ahovn-no-courses {
    text-align: center;
    color: #888;
    padding: 40px;
}


/* =====================================================
   TOP 10 POPUP MODAL
   ===================================================== */

/* Overlay */
.ahovn-top10-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}
.ahovn-top10-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* Modal Box */
.ahovn-top10-modal {
    background: #fff;
    border-radius: 18px;
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
    transform: translateY(30px) scale(0.97);
    transition: transform 0.25s ease;
}
.ahovn-top10-overlay.active .ahovn-top10-modal {
    transform: translateY(0) scale(1);
}

/* Modal Header */
.ahovn-top10-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px 14px;
    border-bottom: 1px solid #f0f0f0;
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 10;
    border-radius: 18px 18px 0 0;
}
.ahovn-top10-modal-header h2 {
    margin: 0;
    font-size: 18px;
    color: #2c3e50;
    font-weight: 700;
}
.ahovn-top10-close {
    background: none;
    border: none;
    font-size: 28px;
    line-height: 1;
    color: #999;
    cursor: pointer;
    padding: 0 4px;
    border-radius: 50%;
    transition: color 0.15s;
}
.ahovn-top10-close:hover {
    color: #333;
}

/* Period Tabs */
.ahovn-top10-period-tabs {
    display: flex;
    gap: 8px;
    padding: 12px 22px;
    border-bottom: 1px solid #f0f0f0;
}
.ahovn-period-btn {
    flex: 1;
    padding: 7px 10px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    background: #f8f8f8;
    font-size: 13px;
    font-weight: 600;
    color: #555;
    cursor: pointer;
    transition: all 0.18s ease;
}
.ahovn-period-btn:hover {
    background: #e8f4fb;
    border-color: #0073aa;
    color: #0073aa;
}
.ahovn-period-btn.active {
    background: #0073aa;
    border-color: #0073aa;
    color: #fff;
    box-shadow: 0 2px 8px rgba(0,115,170,0.3);
}

/* Top10 Content */
.ahovn-top10-content {
    padding: 16px 22px 22px;
    flex: 1;
}
.ahovn-top10-loading {
    text-align: center;
    padding: 30px 0;
    color: #888;
}
.ahovn-top10-loading .spinner {
    display: block;
    margin: 0 auto 10px;
    visibility: visible;
    width: 20px;
    height: 20px;
}

/* Inside modal reuse leaderboard styles from public-style.css */
.ahovn-top10-content .leaderboard {
    box-shadow: none;
    border: none;
    margin: 0;
}
.ahovn-top10-content .leaderboard-title {
    border-radius: 10px;
    font-size: 1em;
    padding: 10px 15px;
}
.ahovn-top10-content .leaderboard-table td,
.ahovn-top10-content .leaderboard-table th {
    padding: 9px 8px;
}
.ahovn-top10-content .user-info img.avatar {
    width: 32px !important;
    height: 32px !important;
}

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 600px) {
    .ahovn-courses-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 12px;
    }
    .ahovn-course-card {
        padding: 14px 8px 10px;
        min-height: 110px;
    }
    .ahovn-course-card-icon {
        width: 48px;
        height: 48px;
    }
    .ahovn-course-icon-text {
        font-size: 22px;
    }
    .ahovn-courses-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .ahovn-top10-btn {
        width: 100%;
    }
    .ahovn-top10-modal {
        max-height: 95vh;
        border-radius: 14px;
    }
    .ahovn-top10-period-tabs {
        gap: 5px;
        padding: 10px 14px;
    }
}
