/**
 * assets/css/frontend-cards.css
 * Card-based layout system for front-end pages
 * Design pattern sourced from instructor_resources.php
 */

/* ─── Body ─── */
body {
    background-color: #f0f2f5;
    font-family: 'Sarabun', 'Pridi', 'Prompt', sans-serif;
}

/* ─── Page wrapper ─── */
.fc-page-wrapper {
    padding: 24px 0;
}

/* ─── Generic content card ─── */
.fc-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.04);
    transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.fc-card:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.10);
    transform: translateY(-2px);
}

/* ─── Stat / Summary cards (horizontal: number left, icon right) ─── */
.fc-stat-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.04);
    transition: box-shadow 0.25s ease, transform 0.25s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
    text-decoration: none;
    color: inherit;
}

/* ─── Top row: number (left) + icon (right) ─── */
.fc-stat-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.fc-stat-card:hover {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.10);
    transform: translateY(-2px);
    color: inherit;
}

.fc-stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: #2c3e50;
    line-height: 1.1;
    margin-bottom: 4px;
}

/* Alias kept for backward compatibility */
.fc-stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #2c3e50;
    line-height: 1.1;
    margin-bottom: 4px;
}

.fc-stat-label {
    font-size: 0.875rem;
    color: #6c757d;
    font-weight: 400;
}

.fc-stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    flex-shrink: 0;
}

/* ─── Stat grid (2 col mobile → 4 col desktop) ─── */
.fc-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

@media (min-width: 640px) {
    .fc-stats-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ─── Item / resource cards ─── */
.fc-item-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.04);
    transition: box-shadow 0.25s ease, transform 0.25s ease;
    height: 100%;
}

.fc-item-card:hover {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.10);
    transform: translateY(-2px);
}

/* ─── Course card override ─── */
.fc-course-card {
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.04);
    transition: box-shadow 0.25s ease, transform 0.25s ease;
    height: 100%;
}

.fc-course-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    transform: translateY(-3px);
}

.fc-course-card .card-body {
    padding: 16px 20px;
}

.fc-course-card .card-img-top {
    border-radius: 0;
    height: 180px;
    object-fit: cover;
}

/* ─── Section filter / toolbar ─── */
.fc-filter-bar {
    background: #ffffff;
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.04);
}

/* ─── Section header within card ─── */
.fc-section-header {
    border-bottom: 2px solid #f0f2f5;
    padding-bottom: 12px;
    margin-bottom: 20px;
}

.fc-section-header h5,
.fc-section-header h4,
.fc-section-header h3 {
    margin-bottom: 0;
    font-weight: 600;
    color: #2c3e50;
}

/* ─── Icon badge (like resource-icon) ─── */
.fc-icon-badge {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}

/* ─── Label / pill badges ─── */
.fc-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.3px;
}

/* ─── Sidebar compatibility ─── */
.fc-sidebar-card {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.04);
    overflow: hidden;
    margin-bottom: 20px;
}

/* ─── Welcome Hero Banner ─── */
.welcome-hero {
    background: linear-gradient(135deg, #1a5f5f 0%, #2d8989 45%, #5fb3b3 78%, #7ec99a 100%);
    border-radius: 16px;
    padding: 20px;
    margin: 0 0 16px;
    color: #fff;
    position: relative;
    overflow: hidden;
}
.welcome-hero::before {
    content: '';
    position: absolute;
    top: -55px; right: -55px;
    width: 190px; height: 190px;
    background: rgba(255,255,255,0.08);
    border-radius: 50%;
    pointer-events: none;
}
.welcome-hero::after {
    content: '';
    position: absolute;
    bottom: -40px; left: -30px;
    width: 150px; height: 150px;
    background: rgba(255,255,255,0.05);
    border-radius: 50%;
    pointer-events: none;
}
.hero-dot-accent {
    position: absolute;
    top: 50%; right: 110px;
    transform: translateY(-50%);
    width: 7px; height: 7px;
    background: rgba(255,255,255,0.3);
    border-radius: 50%;
    pointer-events: none;
    box-shadow: 0 0 0 12px rgba(255,255,255,0.07), 16px -16px 0 rgba(255,255,255,0.12);
}

/* Content inside hero (for pages that use .content wrapper) */
.welcome-hero .content {
    position: relative;
    z-index: 2;
}
.welcome-hero h2,
.welcome-hero h3,
.welcome-hero h4 { color: #fff; font-weight: 700; margin-bottom: 0.4rem; }
.welcome-hero p   { color: rgba(255,255,255,0.88); margin-bottom: 0; }

/* Top row: avatar + name | progress pill */
.hero-top {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 16px;
}
.hero-identity {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}
.hero-avatar {
    width: 50px; height: 50px;
    border-radius: 50%;
    border: 2.5px solid rgba(255,255,255,0.55);
    overflow: hidden;
    flex-shrink: 0;
    background: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    font-weight: 700;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
}
.hero-avatar img { width: 100%; height: 100%; object-fit: cover; }
.hero-greeting {
    font-size: clamp(0.95rem, 2.8vw, 1.15rem);
    font-weight: 700;
    margin-bottom: 4px;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}
.hero-meta {
    font-size: 0.72rem;
    opacity: 0.72;
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}
.hero-meta .hero-sep { opacity: 0.45; }
.hero-progress-pill {
    background: rgba(255,255,255,0.14);
    border: 1px solid rgba(255,255,255,0.28);
    border-radius: 50px;
    padding: 6px 14px;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.75rem;
    white-space: nowrap;
    flex-shrink: 0;
    backdrop-filter: blur(6px);
}
.hero-progress-pill strong { font-weight: 700; font-size: 0.88rem; }

/* Hero action buttons */
.hero-actions {
    position: relative;
    z-index: 1;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.btn-hero-primary {
    background: rgba(255,255,255,0.95);
    color: #1a5f5f;
    font-weight: 600;
    border: none;
    border-radius: 50px;
    padding: 8px 20px;
    font-size: 0.84rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    transition: all 0.2s ease;
    box-shadow: 0 2px 10px rgba(0,0,0,0.14);
    white-space: nowrap;
}
.btn-hero-primary:hover {
    background: #fff;
    transform: translateY(-1px);
    box-shadow: 0 5px 16px rgba(0,0,0,0.2);
    color: #1a5f5f;
}
.btn-hero-secondary {
    background: rgba(255,255,255,0.14);
    color: #fff;
    border: 1.5px solid rgba(255,255,255,0.4);
    border-radius: 50px;
    padding: 8px 20px;
    font-size: 0.84rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    transition: all 0.2s ease;
    white-space: nowrap;
    backdrop-filter: blur(4px);
}
.btn-hero-secondary:hover {
    background: rgba(255,255,255,0.24);
    color: #fff;
    transform: translateY(-1px);
}

@media (min-width: 576px) {
    .welcome-hero { padding: 24px 28px; }
    .hero-greeting { max-width: none; }
    .hero-avatar { width: 56px; height: 56px; }
}
@media (max-width: 575px) {
    .hero-progress-pill { display: none; }
    .hero-dot-accent    { display: none; }
    .btn-hero-primary,
    .btn-hero-secondary { padding: 7px 16px; font-size: 0.8rem; }
}

/* ─── Progress bars ─── */
.fc-progress-label {
    font-size: 0.75rem;
    color: #6c757d;
    margin-bottom: 4px;
}

/* ─── Empty state ─── */
.fc-empty-state {
    text-align: center;
    padding: 60px 24px;
    color: #adb5bd;
}

.fc-empty-state i {
    font-size: 3.5rem;
    margin-bottom: 16px;
    opacity: 0.5;
}

.fc-empty-state p {
    font-size: 0.9375rem;
    margin-bottom: 0;
}

/* ─── Existing Bootstrap .card override for front-end ─── */
.fc-area .card,
.card.fc-styled {
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.04) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06) !important;
    transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.fc-area .card:hover,
.card.fc-styled:hover {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.10) !important;
    transform: translateY(-2px);
}

/* ─── Color helpers for icon badges ─── */
.fc-bg-teal   { background: rgba(95, 179, 179, 0.15); color: #5fb3b3; }
.fc-bg-green  { background: rgba(136, 201, 153, 0.15); color: #5a9e6b; }
.fc-bg-yellow { background: rgba(240, 230, 166, 0.4);  color: #a08c00; }
.fc-bg-blue   { background: rgba(14, 165, 233, 0.12);  color: #0284c7; }
.fc-bg-red    { background: rgba(239, 68, 68, 0.12);   color: #dc2626; }
.fc-bg-purple { background: rgba(139, 92, 246, 0.12);  color: #7c3aed; }
.fc-bg-orange { background: rgba(249, 115, 22, 0.12);  color: #ea580c; }

/* ─── Responsive tweaks ─── */
@media (max-width: 639px) {
    .fc-stat-card {
        padding: 14px 16px;
        border-radius: 10px;
    }
    .fc-stat-top {
        margin-bottom: 6px;
    }
    .fc-stat-icon {
        width: 44px;
        height: 44px;
        border-radius: 10px;
        font-size: 1.2rem;
    }
    .fc-stat-number,
    .fc-stat-value {
        font-size: 1.5rem;
    }
    .fc-stat-label {
        font-size: 0.75rem;
    }
    .fc-stats-grid {
        gap: 12px;
    }
}

@media (max-width: 768px) {
    .fc-card,
    .fc-item-card {
        padding: 16px;
        border-radius: 10px;
    }
}
