/**
 * YSP Course Browser Styles (Harmonised)
 * Grammar / Lexis / Skills pathways
 * Visual system aligned with YSP dashboards
 */

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #0f6174;
    min-height: 100vh;
    padding: 20px;
    color: #314357;
}

.course-browser {
    max-width: 1200px;
    margin: 0 auto;
    background: transparent;
    border-radius: 18px;
    overflow: hidden;
}

/* ===== HEADER ===== */

.header-navigation {
    text-align: left;
    margin-bottom: 20px;
}

.back-to-home {
    color: rgba(255,255,255,0.9);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    padding: 8px 16px;
    background: rgba(255,255,255,0.12);
    border-radius: 8px;
    display: inline-block;
    transition: all 0.25s ease;
}

.back-to-home:hover {
    background: rgba(255,255,255,0.18);
    color: #ffffff;
}

/* YSP teal header */

.browser-header {
    background: linear-gradient(135deg,#2a7f92 0%,#236f81 100%);
    color:white;
    padding:34px 30px;
    text-align:center;
    margin:0 0 20px 0;
    border-radius:18px 18px 18px 18px;
    box-shadow:0 8px 24px rgba(0,0,0,0.12);
}

.browser-header h1{
    font-size:2.5rem;
    margin-bottom:10px;
    font-weight:700;
    color:#fff!important;
}

.browser-header p{
    font-size:1.2rem;
    opacity:.95;
    margin-bottom:10px;
}

.membership-note{
    font-size:.95em;
    color:rgba(255,255,255,.88);
    margin-top:10px;
    font-style:italic;
}

.membership-note a{
    color:#fff;
    text-decoration:underline;
}

/* ===== LANDING PAGE ===== */

.landing-page{
    padding:30px 40px 40px;
    background:transparent;
    border-radius:0 0 18px 18px;
    box-shadow:0 12px 32px rgba(0,0,0,0.10);
}

.categories-grid{
    display:flex;
    flex-wrap:wrap;
    gap:30px;
    justify-content:center;
}

.landing-card{
    background:#ffffff;
    border:1px solid #d9dee5;
    border-top-width:1px;
    border-radius:16px;
    padding:32px;
    transition:all .25s ease;
    cursor:pointer;
    min-height:220px;
    display:flex;
    flex-direction:column;
    flex:1 1 350px;
    max-width:400px;
    box-shadow:0 8px 18px rgba(0,0,0,.06);
}

.landing-card:hover{
    transform:translateY(-4px);
    box-shadow:0 14px 28px rgba(0,0,0,.10);
}

/* category accent borders */

.landing-card[data-db-id="10"]{
    border-top-color:#8b5cf6;
}

.landing-card[data-db-id="11"]{
    border-top-color:#27c28a;
}

.landing-card[data-db-id="12"]{
    border-top-color:#f0b316;
}

.card-icon{
    font-size:1.5rem;
}

.card-title{
    font-size:1.5rem;
    font-weight:700;
    color:#2f4054;
    margin:0;
}

.card-badge{
    color:white;
    padding:8px 14px;
    border-radius:999px;
    font-size:.72rem;
    font-weight:700;
    text-transform:uppercase;
    letter-spacing:.7px;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    line-height:1.2;
    min-height:32px;
}

.landing-card[data-db-id="10"] .card-badge{
    background:linear-gradient(135deg,#8b5cf6,#a78bfa);
}

.landing-card[data-db-id="11"] .card-badge{
    background:linear-gradient(135deg,#1fb981,#3dd39a);
}

.landing-card[data-db-id="12"] .card-badge{
    background:linear-gradient(135deg,#e29a08,#f4bf2a);
    color:#2f2a14;
}

.card-description{
    font-size:1.05rem;
    line-height:1.6;
    color:#5f6b7a;
    margin-bottom:20px;
    flex-grow:1;
}

.card-metrics{
    display:flex;
    gap:20px;
    margin-bottom:20px;
    font-size:.9rem;
    flex-wrap:wrap;
}

.metric-group{
    display:flex;
    gap:16px;
}

.metric-item{
    display:flex;
    flex-direction:column;
    align-items:center;
}

.metric-value{
    font-size:1.4rem;
    font-weight:700;
    color:#2f4054;
}

.metric-label{
    font-size:.75rem;
    color:#6c757d;
    text-transform:uppercase;
}

.cefr-mini-badges{
    display:flex;
    flex-wrap:wrap;
    gap:6px;
    margin-top:10px;
}

.cefr-mini-badge{
    padding:3px 8px;
    border-radius:10px;
    font-size:.75rem;
    font-weight:600;
    background:#e9ecef;
    color:#495057;
}

.cefr-mini-badge.cefr-a2{background:#dbeafe;color:#1e40af;}
.cefr-mini-badge.cefr-b1{background:#dcfce7;color:#166534;}
.cefr-mini-badge.cefr-b1b2{background:#fef9c3;color:#854d0e;}
.cefr-mini-badge.cefr-b2{background:#fce7f3;color:#9d174d;}
.cefr-mini-badge.cefr-c1{background:#ede9fe;color:#5b21b6;}

.card-action{
    margin-top:auto;
}

/* buttons */

.explore-btn{
    background:#1b6b7e;
    color:white;
    padding:12px 24px;
    border-radius:8px;
    font-weight:600;
    text-decoration:none;
    display:inline-block;
    transition:all .2s ease;
    border:none;
    cursor:pointer;
    font-size:1rem;
    box-shadow:0 4px 12px rgba(91,58,164,.18);
}

.explore-btn:hover{
    background:#165a69;
    transform:translateY(-1px);
    box-shadow:0 8px 16px rgba(91,58,164,.24);
}

/* ===== DRILL DOWN PAGE ===== */

.drill-down-page{
    padding:30px 40px;
    background: linear-gradient(135deg,#2a7f92 0%,#236f81 100%);
    border-radius:18px 18px 18px 18px;
}

.drill-down-header{
    display:flex;
    align-items:center;
    gap:20px;
    margin-bottom:30px;
    padding-bottom:20px;
    border-bottom:1px solid #e5e7eb;
}

.back-btn{
    background:#f6f7f9;
    border:1px solid #d8dee6;
    color:#4b5563;
    padding:10px 20px;
    border-radius:8px;
    cursor:pointer;
    font-weight:500;
    transition:all .25s ease;
}

.back-btn:hover{
    background:#eef2f6;
    border-color:#2a7f92;
    color:#2a7f92;
}

#category-title{
    font-size:2rem;
    color:#2f4054;
}

/* filters */

.drill-down-filters{
    background:#f7f8fa;
    padding:20px;
    border-radius:12px;
    margin-bottom:30px;
    display:flex;
    gap:20px;
    align-items:end;
    flex-wrap:wrap;
    border:1px solid #e6eaf0;
}

.filter-group{
    display:flex;
    flex-direction:column;
    gap:8px;
    min-width:200px;
}

.filter-group label{
    font-weight:600;
    color:#4b5563;
    font-size:.9rem;
}

.filter-group select,
.filter-group input{
    padding:10px 15px;
    border:1px solid #d8dee6;
    border-radius:8px;
    font-size:1rem;
    background:white;
}

.filter-group select:focus,
.filter-group input:focus{
    outline:none;
    border-color:#2a7f92;
    box-shadow:0 0 0 3px rgba(42,127,146,.12);
}

.clear-btn{
    background:#dc3545;
    color:white;
    border:none;
    padding:10px 15px;
    border-radius:8px;
    cursor:pointer;
}

/* ===== CONTENT GRID ===== */

.content-cards-grid{
    display:grid;
    grid-template-columns:repeat(auto-fill,minmax(320px,1fr));
    gap:24px;
}

.lexical-content-card{
    background:#ffffff;
    border:1px solid #000;
    border-radius:12px;
    padding:24px;
    display:flex;
    flex-direction:column;
    box-shadow:none;
    transition:transform .15s ease;
}

.lexical-content-card:hover{
    transform:translateY(-2px);
}

.lexical-title{
    font-size:1.3rem;
    font-weight:700;
    color:#2f4054;
}

.lexical-description{
    font-size:.95rem;
    line-height:1.6;
    color:#6b7280;
}

/* responsive */

@media(max-width:768px){

body{padding:10px;}

.categories-grid{
flex-direction:column;
gap:16px;
align-items:stretch;
}

.content-cards-grid{
grid-template-columns:1fr;
}

.drill-down-page{
padding:20px;
}

.drill-down-header{
flex-direction:column;
align-items:flex-start;
gap:15px;
}

.drill-down-filters{
flex-direction:column;
align-items:stretch;
}

.filter-group{
min-width:auto;
}

}

@media(max-width:480px){

.landing-card{
padding:18px;
}

}

.category-title {
    color: #ffffff;
}


.course-card-header { cursor: pointer; }
.course-card-header:hover .explore-btn { text-decoration: underline; }

.course-units-panel {
    border-top: 1px solid #e0e0e0;
    padding: 8px 0;
}
.course-unit-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.15s;
}
.course-unit-row:hover { background: #f7f7f7; }
.unit-chapter { font-weight: 700; color: #666; min-width: 40px; font-size: 0.85em; }
.unit-title   { flex: 1; font-weight: 500; }
.unit-pages   { color: #888; font-size: 0.85em; white-space: nowrap; }
.unit-cta     { font-size: 0.85em; color: #0073aa; white-space: nowrap; }
