/* ─── Base ─── */
:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --dark: #0f172a;
    --surface: #ffffff;
    --bg: #f8fafc;
    --text: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --radius: 12px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,.06);
    --shadow: 0 4px 12px rgba(0,0,0,.08);
    --shadow-lg: 0 8px 30px rgba(0,0,0,.12);
}

* { box-sizing: border-box; }

body {
    font-family: 'Inter', 'Noto Sans KR', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main { flex: 1; }

/* ─── Navbar ─── */
.navbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    padding: .75rem 0;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--primary) !important;
}

.nav-link {
    font-weight: 500;
    color: var(--text-muted) !important;
    transition: color .2s;
}

.nav-link:hover { color: var(--primary) !important; }

/* ─── Hero ─── */
.hero-section {
    padding: 5rem 0 3rem;
}

.min-vh-75 { min-height: 60vh; }

.hero-title {
    font-size: 2.75rem;
    font-weight: 800;
    line-height: 1.2;
    color: var(--dark);
}

.text-gradient {
    background: linear-gradient(135deg, var(--primary) 0%, #7c3aed 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.125rem;
    color: var(--text-muted);
    line-height: 1.7;
    margin-top: 1rem;
    max-width: 520px;
}

.hero-illustration {
    font-size: 12rem;
    color: var(--primary);
    opacity: .15;
    line-height: 1;
}

/* ─── Lab Cards ─── */
.lab-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    text-align: center;
    transition: transform .2s, box-shadow .2s;
    position: relative;
    overflow: hidden;
}

.lab-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
}

.lab-color-0::before { background: linear-gradient(90deg, #2563eb, #7c3aed); }
.lab-color-1::before { background: linear-gradient(90deg, #059669, #0d9488); }
.lab-color-2::before { background: linear-gradient(90deg, #d97706, #dc2626); }

.lab-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
}

.lab-card-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 1rem;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.lab-color-0 .lab-card-icon { background: #eff6ff; color: #2563eb; }
.lab-color-1 .lab-card-icon { background: #ecfdf5; color: #059669; }
.lab-color-2 .lab-card-icon { background: #fef3c7; color: #d97706; }

.lab-card-photo {
    width: 100px;
    height: 120px;
    border-radius: 14px;
    object-fit: cover;
    margin-bottom: 1rem;
    border: 3px solid #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,.1);
}

.lab-card h4 {
    font-weight: 800;
    margin-bottom: .25rem;
}

.lab-card p {
    color: var(--text-muted);
    font-size: .9rem;
    margin-bottom: 0;
}

/* ─── Feature Cards ─── */
.feature-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    text-align: center;
    transition: transform .2s, box-shadow .2s;
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
}

.feature-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 1rem;
    background: linear-gradient(135deg, #eff6ff 0%, #f0f0ff 100%);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--primary);
}

.feature-card h5 { font-weight: 700; }

/* ─── Auth Card ─── */
.auth-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2.5rem;
    box-shadow: var(--shadow);
}

.auth-card h3 { font-weight: 700; }

/* ─── Course Section ─── */
.course-header {
    padding: 1rem 1.25rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.course-header h4 { font-weight: 700; }

/* ─── Lecture Cards ─── */
.lecture-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.lecture-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform .2s, box-shadow .2s;
    height: 100%;
}

.lecture-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}

.lecture-thumbnail {
    position: relative;
    aspect-ratio: 16/9;
    background: #0f172a;
    overflow: hidden;
}

.lecture-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .3s;
}

.lecture-card:hover .lecture-thumbnail img {
    transform: scale(1.05);
}

.thumbnail-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .25rem;
    background: linear-gradient(135deg, #1e3a5f 0%, #0f172a 100%);
    position: relative;
    overflow: hidden;
}

.thumbnail-placeholder::before {
    content: '';
    position: absolute;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    top: -60px;
    right: -40px;
    opacity: .12;
    background: #fff;
}

.thumb-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: #fff;
    line-height: 1;
    text-shadow: 0 2px 8px rgba(0,0,0,.3);
    position: relative;
}

.thumb-course {
    font-size: .7rem;
    font-weight: 600;
    color: rgba(255,255,255,.6);
    letter-spacing: .5px;
    position: relative;
}

.thumb-color-0 { background: linear-gradient(135deg, #1e3a5f 0%, #0f172a 100%); }
.thumb-color-1 { background: linear-gradient(135deg, #4c1d95 0%, #1e1b4b 100%); }
.thumb-color-2 { background: linear-gradient(135deg, #065f46 0%, #022c22 100%); }
.thumb-color-3 { background: linear-gradient(135deg, #9a3412 0%, #431407 100%); }
.thumb-color-4 { background: linear-gradient(135deg, #1e40af 0%, #172554 100%); }

.duration-badge {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0,0,0,.8);
    color: #fff;
    font-size: .75rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
}

.play-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,.3);
    opacity: 0;
    transition: opacity .3s;
    font-size: 3rem;
    color: #fff;
}

.lecture-card:hover .play-overlay { opacity: 1; }

.lecture-info {
    padding: 1rem;
}

.lecture-title {
    font-weight: 600;
    font-size: .9rem;
    line-height: 1.4;
    margin-bottom: .25rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.lecture-desc {
    font-size: .8rem;
    color: var(--text-muted);
    margin-bottom: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ─── Video Player ─── */
.video-wrapper {
    position: relative;
    background: #000;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.video-wrapper iframe {
    width: 100%;
    aspect-ratio: 16/9;
    border: 0;
}

.external-link-box {
    padding: 4rem 2rem;
    text-align: center;
    background: #f1f5f9;
    border-radius: var(--radius);
}

.lecture-description {
    white-space: pre-wrap;
    line-height: 1.8;
    color: var(--text-muted);
}

/* ─── Sidebar Playlist ─── */
.sidebar-playlist {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.sidebar-title {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    font-weight: 700;
    margin: 0;
}

.playlist-items {
    max-height: 70vh;
    overflow-y: auto;
}

.playlist-item {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .75rem 1.25rem;
    text-decoration: none;
    color: var(--text);
    border-bottom: 1px solid var(--border);
    font-size: .85rem;
    transition: background .15s;
}

.playlist-item:last-child { border-bottom: 0; }
.playlist-item:hover { background: #f1f5f9; color: var(--text); }

.playlist-item.active {
    background: #eff6ff;
    border-left: 3px solid var(--primary);
    font-weight: 600;
    color: var(--primary);
}

.playlist-number {
    width: 24px;
    text-align: center;
    flex-shrink: 0;
    color: var(--text-muted);
    font-size: .8rem;
}

.playlist-title {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.playlist-duration {
    color: var(--text-muted);
    font-size: .75rem;
    flex-shrink: 0;
}

/* ─── Admin ─── */
.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}

.stat-number {
    font-size: 1.75rem;
    font-weight: 800;
    line-height: 1;
}

.stat-label {
    font-size: .85rem;
    color: var(--text-muted);
    margin-top: .25rem;
}

.admin-menu-card {
    display: block;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    text-align: center;
    text-decoration: none;
    color: var(--text);
    transition: transform .2s, box-shadow .2s;
}

.admin-menu-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
    color: var(--text);
}

.admin-menu-card i {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: .75rem;
    display: block;
}

.admin-menu-card h5 { font-weight: 700; }
.admin-menu-card p { color: var(--text-muted); font-size: .9rem; margin-bottom: .5rem; }

/* ─── Tables ─── */
.table { font-size: .9rem; }
.table th {
    font-weight: 600;
    color: var(--text-muted);
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: .5px;
    border-bottom-width: 2px;
}

/* ─── Buttons ─── */
.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
    font-weight: 600;
}

.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

/* ─── Footer ─── */
footer {
    border-top: 1px solid var(--border);
}

/* ─── Cards ─── */
.card {
    border-radius: var(--radius);
    border-color: var(--border);
    box-shadow: var(--shadow-sm);
}

/* ─── Alerts ─── */
.alert { border-radius: var(--radius); }

/* ─── Equipment ─── */
.equipment-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    height: 100%;
    transition: transform .2s, box-shadow .2s;
}

.equipment-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}

.equipment-photo {
    aspect-ratio: 16/10;
    overflow: hidden;
    background: #f1f5f9;
}

.equipment-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .3s;
}

.equipment-card:hover .equipment-photo img {
    transform: scale(1.05);
}

.equipment-photo-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: #94a3b8;
    background: linear-gradient(135deg, #e2e8f0 0%, #f1f5f9 100%);
}

.equipment-body {
    padding: 1.25rem;
}

.equipment-name {
    font-weight: 700;
    margin-bottom: .5rem;
}

.equipment-desc {
    font-size: .875rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: .75rem;
}

.equipment-specs {
    background: var(--bg);
    border-radius: 8px;
    padding: .75rem 1rem;
    margin-top: .5rem;
}

.equipment-specs h6 {
    font-size: .8rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: .5rem;
}

.specs-content {
    font-size: .8rem;
    white-space: pre-wrap;
    line-height: 1.6;
    color: var(--text);
}

/* ─── Resources ─── */
.resource-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    height: 100%;
    transition: transform .2s, box-shadow .2s;
}

.resource-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.resource-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
    margin-right: 1rem;
}

.resource-body { min-width: 0; flex: 1; }

.resource-title {
    font-weight: 600;
    font-size: .95rem;
    margin-bottom: .25rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.resource-desc {
    font-size: .8rem;
    color: var(--text-muted);
    margin-bottom: .35rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.resource-meta {
    font-size: .75rem;
}

/* ─── Members ─── */
.member-section-title {
    font-weight: 700;
    padding-bottom: .5rem;
    border-bottom: 2px solid var(--primary);
    display: inline-block;
    margin-bottom: 1rem;
}

.member-group-label {
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: .75rem;
    padding-left: .25rem;
    border-left: 3px solid var(--primary);
    padding-left: .75rem;
}

.member-card {
    text-align: center;
    padding: 1.25rem .75rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: transform .2s, box-shadow .2s;
}

.member-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}

.member-photo {
    width: 90px;
    height: 90px;
    margin: 0 auto .75rem;
    border-radius: 50%;
    overflow: hidden;
}

.member-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.member-photo-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
    font-size: 2rem;
    color: #6366f1;
}

.member-photo-placeholder.alumni {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #d97706;
}

.member-name {
    font-weight: 700;
    font-size: .95rem;
    margin-bottom: .15rem;
}

.member-year {
    font-size: .75rem;
    color: var(--primary);
    font-weight: 600;
}

.member-workplace {
    font-size: .75rem;
    color: var(--text-muted);
    line-height: 1.3;
}

/* ─── Materials ─── */
.materials-section h5 { font-weight: 700; }

.materials-list {
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

.material-item {
    display: flex;
    align-items: center;
    padding: .75rem 1rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    text-decoration: none;
    color: var(--text);
    transition: background .15s, box-shadow .15s;
}

.material-item:hover {
    background: #e8f0fe;
    color: var(--text);
    box-shadow: var(--shadow-sm);
}

.material-item i:first-child { font-size: 1.4rem; }

.material-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

.material-name {
    font-weight: 500;
    font-size: .9rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.material-size {
    font-size: .75rem;
    color: var(--text-muted);
}

/* ─── Upload Area ─── */
.upload-area {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    transition: border-color .2s, background .2s;
}

.upload-area.drag-over {
    border-color: var(--primary);
    background: #eff6ff;
}

.upload-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    cursor: pointer;
    text-align: center;
    width: 100%;
    margin: 0;
}

/* ─── Responsive ─── */
@media (max-width: 768px) {
    .hero-title { font-size: 2rem; }
    .hero-section { padding: 3rem 0 2rem; }
    .min-vh-75 { min-height: auto; }
    .auth-card { padding: 1.5rem; }
}
