/**
 * Dashboard Styles
 *
 * All styles for the My Account dashboard page.
 * Enqueued only on the dashboard template.
 *
 * @package ClassroomSecrets
 */

/* ============================================================================
   WELCOME SECTION - Teacher/Parent
   ========================================================================= */

.dashboard-welcome-title {
    color: #616160 !important;
}

.dashboard-avatar {
    height: 250px;
    float: right;
    margin: -40px 0 0 0;
}

.dashboard-section-divider {
    border-top: 1px solid #707070;
    padding-top: 20px;
}

.dashboard-section-bottom-divider {
    border-bottom: 1px solid #707070;
    border-top: 1px solid #707070;
    padding-top: 20px;
}

.dashboard-intro-text {
    margin-bottom: 20px;
}

.dashboard-view-button {
    float: right;
    padding: 5px;
    background-color: #0062A1;
    color: #fff;
    text-align: center;
    width: 100px;
    border-radius: 4px;
    border: 1px solid #0062A1;
    margin-bottom: 5px;
    margin-right: 0;
    margin-top: -4px;
}

.dashboard-sidebar-image {
    width: 100%;
    height: auto;
    border-radius: 8px;
}

.dashboard-sidebar-right {
    float: right;
}

.dashboard-clear-section {
    clear: both;
    margin-top: 40px;
}

.dashboard-challenge-banner {
    margin-top: 20px;
}

/* ============================================================================
   PROGRAMMES SECTION
   ========================================================================= */

.programme-section {
    margin-top: 20px;
}

.programme-section-title {
    text-align: center;
}

.programme-description {
    margin-top: 0;
}

.programme-navigation {
    margin-top: 20px;
}

.programme-navigation-inner {
    width: 100%;
    clear: both;
    text-align: center;
}

.programme-weekly-container {
    margin-left: 0;
    margin-right: 0;
}

.programme-weekly-title {
    color: #616160;
    border-bottom: solid 1px #616160;
    line-height: 0.1em;
    margin: 40px 0 20px 0;
}

.programme-weekly-title-text {
    background-color: #F0F0F0;
    padding-right: 10px;
}

.programme-featured-image {
    margin-bottom: 10px;
}

/* ============================================================================
   COURSES SECTION
   ========================================================================= */

.courses-section {
    margin-top: 20px;
}

.courses-section-title {
    text-align: center;
}

.course-description {
    margin-top: 0;
}

.course-navigation {
    margin-top: 20px;
}

.course-navigation-inner {
    width: 100%;
    clear: both;
    text-align: center;
}

.course-header-section {
    color: #616160;
    border-bottom: solid 1px #616160;
    line-height: 0.1em;
    margin: 40px 0 20px 0;
}

.course-header-text {
    background-color: #F0F0F0;
    padding-right: 10px;
}

.course-tasks-title {
    color: #FFBB00;
    font-weight: bold;
    margin-top: 0;
    line-height: 100px;
}

.course-tasks-icon {
    height: 100px;
    width: 100px;
    float: left;
    margin-right: 10px;
}

.course-row-container {
    margin-left: 0;
    margin-right: 0;
}

/* ============================================================================
   RESOURCES SECTION - Assigned Resources (Learner Dashboard)
   Horizontal scrolling cards with subject grouping

   AGGRESSIVE OVERRIDES - WordPress/WooCommerce CSS fights us hard
   ========================================================================= */

.resources-practice-title {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--charcoal);
    font-family: sofia-pro, sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 2rem 0 1rem 0;
    line-height: 1.3;
}

.resources-practice-icon {
    height: 48px;
    width: 48px;
    flex-shrink: 0;
}

/* Subject Container - the colored box per subject */
/* NOTE: background-color is set via inline styles in PHP, NOT here */
/* This allows quiz sections to use year-group colors and practice sections to use green */
.resource-subject-container {
    border-radius: 16px !important;
    margin: 0 0 1.5rem 0 !important;
    overflow: hidden !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08) !important;
    padding: 0 !important;
    border: none !important;
}

/* FORCE white text on ALL headers inside colored containers - NUCLEAR */
.resource-subject-container h2,
.resource-subject-container h2 *,
.resource-subject-container h2 strong,
.resource-subject-container h3,
.resource-subject-container h3 *,
.resource-subject-container h4,
.resource-subject-container h4 *,
.resource-subject-container .resource-subject-header,
.resource-subject-container .resource-subject-header *,
.resource-subject-container .resource-subject-header strong {
    color: #FFFFFF !important;
    font-family: sofia-pro, sans-serif !important;
    font-size: 1.25rem !important;
    margin: 0 !important;
    padding: 0.75rem 1rem 0.5rem 1rem !important;
    text-shadow: 0 1px 2px rgba(0,0,0,0.15) !important;
    background: transparent !important;
    background-color: transparent !important;
}

.resource-subject-info {
    padding: 0 1rem 0.75rem 1rem !important;
}

/* ALL text inside subject info MUST be white */
.resource-subject-info p,
.resource-subject-info span,
.resource-subject-info i,
.resource-subject-info strong,
.resource-subject-count,
.resource-subject-count *,
.resource-subject-count i {
    color: #FFFFFF !important;
    font-size: 0.85rem !important;
    margin: 0 !important;
    padding: 0 !important;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1) !important;
}

/* ============================================================================
   CARDS CONTAINER - HORIZONTAL SCROLL
   ========================================================================= */

.resource-cards-container {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    gap: 14px !important;
    overflow-x: scroll !important;
    overflow-y: hidden !important;
    padding: 14px !important;
    background-color: #F6F6F6 !important;
    scroll-behavior: smooth !important;
    -webkit-overflow-scrolling: touch !important;
    /* Show thin scrollbar for accessibility */
    scrollbar-width: thin !important;
    scrollbar-color: rgba(0,0,0,0.3) transparent !important;
}

/* Webkit scrollbar styling (Chrome, Safari, Edge) */
.resource-cards-container::-webkit-scrollbar {
    height: 8px !important;
    display: block !important;
}

.resource-cards-container::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.05) !important;
    border-radius: 4px !important;
}

.resource-cards-container::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.25) !important;
    border-radius: 4px !important;
}

.resource-cards-container::-webkit-scrollbar-thumb:hover {
    background: rgba(0,0,0,0.4) !important;
}

/* Kill Bootstrap row behavior that's breaking horizontal scroll */
.resource-cards-container.row,
div.row.resource-cards-container,
.resource-subject-area-row {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    margin: 0 !important;
    overflow-x: scroll !important;
    overflow-y: hidden !important;
    scrollbar-width: thin !important;
    scrollbar-color: rgba(0,0,0,0.3) transparent !important;
}

.resource-cards-container.row::-webkit-scrollbar,
div.row.resource-cards-container::-webkit-scrollbar,
.resource-subject-area-row::-webkit-scrollbar {
    height: 8px !important;
    display: block !important;
}

/* ============================================================================
   INDIVIDUAL RESOURCE CARDS
   ========================================================================= */

.resource-card {
    flex: 0 0 260px !important;
    min-width: 260px !important;
    max-width: 260px !important;
    background: #FFFFFF !important;
    border-radius: 12px !important;
    padding: 14px !important;
    display: flex !important;
    flex-direction: column !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06) !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease !important;
    margin: 0 !important;
    width: 260px !important;
}

.resource-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1) !important;
}

.resource-card-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    margin-bottom: 8px !important;
}

.resource-card-type {
    flex: 1 !important;
}

.resource-card-type .resourcetype,
.resource-card-type p.resourcetype {
    font-size: 0.7rem !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    color: #A6A6A6 !important;
    margin: 0 !important;
    font-weight: 600 !important;
}

.resource-card-status {
    flex-shrink: 0 !important;
}

.resource-card-title,
.resource-card h3 {
    font-family: sofia-pro, sans-serif !important;
    font-size: 0.95rem !important;
    font-weight: 600 !important;
    color: #343434 !important;
    margin: 0 0 8px 0 !important;
    line-height: 1.3 !important;
    min-height: auto !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
}

.resource-card-image {
    width: 100% !important;
    aspect-ratio: 4 / 3 !important;
    border-radius: 8px !important;
    overflow: hidden !important;
    margin-bottom: 10px !important;
    background: #F6F6F6 !important;
}

.resource-card-image img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}

.resource-card-play {
    display: block !important;
    width: 100% !important;
    padding: 10px 16px !important;
    background: #00ABC8 !important;
    color: #FFFFFF !important;
    text-align: center !important;
    text-decoration: none !important;
    font-weight: 700 !important;
    font-size: 0.9rem !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
    border-radius: 8px !important;
    transition: background 0.2s ease !important;
    margin-top: auto !important;
}

.resource-card-play:hover {
    background: #1183B8 !important;
    color: #FFFFFF !important;
}

/* ============================================================================
   FOOTER - Scroll hint and Key
   ========================================================================= */

.resource-footer {
    display: flex !important;
    justify-content: space-between !important;
    align-items: flex-start !important;
    flex-wrap: wrap !important;
    gap: 12px !important;
    padding: 12px 16px !important;
    background: #F6F6F6 !important;
    border-radius: 0 0 16px 16px !important;
}

.resource-scroll-hint {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    color: #A6A6A6 !important;
    font-size: 0.8rem !important;
    animation: pulse-hint 2s ease-in-out infinite !important;
}

.resource-scroll-hint i {
    font-size: 0.85rem !important;
}

@keyframes pulse-hint {
    0%, 100% { opacity: 0.6; transform: translateX(0); }
    50% { opacity: 1; transform: translateX(4px); }
}

/* ============================================================================
   LEGACY CARD CLASSES - Force horizontal scroll on these too
   ========================================================================= */

/* These old Bootstrap row classes are used in functions.php quiz rendering */
.itemsrow.cskrow,
.row.itemsrow.cskrow,
div.row.itemsrow {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    gap: 14px !important;
    padding: 14px !important;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
    margin: 0 !important;
}

.itemsrow.cskrow::-webkit-scrollbar,
.row.itemsrow.cskrow::-webkit-scrollbar,
div.row.itemsrow::-webkit-scrollbar {
    display: none !important;
}

/* Old card classes need fixed widths to enable horizontal scroll */
.itemsrow .cskitemcard,
.itemsrow .cskassignmentcard,
.cskrow .cskitemcard,
.cskrow .cskassignmentcard,
.col-md-4.cskitemcard,
.col-md-3.cskassignmentcard {
    flex: 0 0 260px !important;
    min-width: 260px !important;
    max-width: 260px !important;
    width: 260px !important;
    margin: 0 !important;
    padding: 14px !important;
    background: #FFFFFF !important;
    border-radius: 12px !important;
}

/* ============================================================================
   RESOURCES SECTION - Year Group Resources
   ========================================================================= */

.year-group-section {
    margin-top: 40px;
}

.year-group-section-title {
    font-weight: bold;
}

.year-group-resource-link {
    margin: 0 auto;
}

/* ============================================================================
   ASSIGNMENT KEY (Legend) - Child-friendly version
   ========================================================================= */

.assignment-key-container {
    flex: 1;
}

.assignment-key-items {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.assignment-key-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--charcoal);
}

.assignment-key-item span {
    font-weight: 500;
}

.assignment-key-note {
    font-size: 0.75rem;
    color: var(--mercury);
    display: flex;
    align-items: center;
    gap: 4px;
}

.assignment-key-note i {
    color: var(--dune);
    font-size: 0.7rem;
}

/* Status badges used in key and on cards */
.status-badge {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.status-badge i {
    font-size: 10px;
}

.status-new {
    background: var(--light);
    border: 2px solid var(--mercury);
}

.status-new i {
    color: var(--mercury);
    font-size: 6px;
}

.status-retry {
    background: var(--dune);
}

.status-retry i {
    color: var(--white);
}

/* Note: Status indicator styles (.result-assigned-*, .result-unassigned-*)
   are defined in style.css for site-wide consistency */

/* ============================================================================
   SECTION TITLES - Consistent headers for learner dashboard
   ========================================================================= */

.csk-section-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: sofia-pro, sans-serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--charcoal);
    margin: 2rem 0 1rem 0;
    line-height: 1.3;
}

.csk-section-title i {
    color: var(--adriatic);
    font-size: 1.2rem;
}

/* ============================================================================
   LEARNER WELCOME
   ========================================================================= */

.learner-name-highlight {
    color: var(--med);
}

.learner-bottom-margin {
    margin-bottom: 40px;
}

/* ============================================================================
   DASHBOARD BACKGROUND ELEMENTS
   ========================================================================= */

.dashbg {
    position: relative;
}

.dashbg h2 i {
    position: absolute;
    top: 25px;
    left: 25px;
    z-index: 5;
    color: #6fc36c;
}

.dashbg h2 i::after {
    display: block;
    position: absolute;
    content: '';
    width: 30px;
    height: 30px;
    background: white;
    padding: 10px;
    top: -8px;
    left: -10px;
    z-index: -1;
    border-radius: 100px;
}

@media screen and (max-width: 950px) {
    .dashbg h2 i {
        display: none;
    }
}

/* ============================================================================
   NOTIFICATION TOP BAR (Slim alert strip)
   ========================================================================= */

.csk-topbar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    width: 100%;
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 500;
    line-height: 1.4;
    letter-spacing: 0.01em;
}

/* Expired - coral strip */
.csk-topbar--expired {
    background: #EB5B50;
    color: #fff;
}

/* Trial - amber strip */
.csk-topbar--trial {
    background: #FFB800;
    color: #1a1a1a;
}

.csk-topbar__icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.csk-topbar__icon svg {
    width: 20px;
    height: 20px;
}

.csk-topbar__text {
    margin: 0;
}

.csk-topbar__text strong {
    font-weight: 700;
}

.csk-topbar__link {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 1rem;
    font-size: 0.85rem;
    font-weight: 700;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.csk-topbar__link svg {
    width: 14px;
    height: 14px;
    transition: transform 0.2s ease;
}

.csk-topbar__link:hover svg {
    transform: translateX(2px);
}

/* Expired link - white pill */
.csk-topbar--expired .csk-topbar__link {
    background: rgba(255,255,255,0.95);
    color: #EB5B50;
}

.csk-topbar--expired .csk-topbar__link:hover {
    background: #fff;
    color: #c43a30;
}

/* Trial link - dark pill */
.csk-topbar--trial .csk-topbar__link {
    background: rgba(0,0,0,0.15);
    color: #1a1a1a;
}

.csk-topbar--trial .csk-topbar__link:hover {
    background: rgba(0,0,0,0.25);
}

/* Payment due - orange strip */
.csk-topbar--payment {
    background: #f97316;
    color: #fff;
}

.csk-topbar--payment .csk-topbar__link {
    background: rgba(255,255,255,0.95);
    color: #f97316;
}

.csk-topbar--payment .csk-topbar__link:hover {
    background: #fff;
    color: #ea580c;
}

/* Info/orphaned - teal strip */
.csk-topbar--info {
    background: #00B2CE;
    color: #fff;
}

.csk-topbar--info a {
    color: #fff;
    text-decoration: underline;
    font-weight: 600;
}

.csk-topbar--info a:hover {
    text-decoration: none;
}

/* Responsive - stack on very small screens */
@media (max-width: 500px) {
    .csk-topbar {
        flex-wrap: wrap;
        text-align: center;
        padding: 0.75rem 1rem;
        gap: 0.5rem;
    }

    .csk-topbar__icon {
        display: none;
    }

    .csk-topbar__text {
        flex-basis: 100%;
    }
}

/* Legacy classes - keep for backwards compatibility */
.csk-notification-banner {
    display: none;
}
