:root {
    --bg: #f4f7fb;
    --panel: #ffffff;
    --text: #1f2937;
    --muted: #6b7280;
    --primary: #2563eb;
    --line: #e5e7eb;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: Arial, sans-serif; background: var(--bg); color: var(--text); }
.topbar {
    display: flex; justify-content: space-between; align-items: center;
    padding: 16px 28px; background: #111827; color: white;
}
.brand { font-weight: 700; font-size: 20px; }
.topbar nav { display: flex; gap: 12px; align-items: center; }
.page { max-width: 1320px; margin: 0 auto; padding: 24px; }
.center-card, .panel, .stat-card { background: var(--panel); border-radius: 18px; box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06); }
.center-card { max-width: 520px; margin: 48px auto; padding: 32px; text-align: center; }
.form-card { text-align: left; }
.hero h1 { margin-top: 0; font-size: 34px; }
.role-grid { display: grid; gap: 16px; grid-template-columns: repeat(2, 1fr); margin-top: 20px; }
.role-card {
    display: block; padding: 28px; border: 1px solid var(--line); border-radius: 16px; text-decoration: none;
    color: var(--text); font-weight: 700; background: #f8fafc;
}
.stack-form { display: grid; gap: 12px; }
input, button { font-size: 15px; }
input[type='text'], input[type='password'], input[type='date'] {
    width: 100%; padding: 12px 14px; border: 1px solid #d1d5db; border-radius: 12px; background: white;
}
.primary-btn, .ghost-btn {
    padding: 11px 16px; border-radius: 12px; border: none; cursor: pointer; text-decoration: none;
}
.primary-btn { background: var(--primary); color: white; }
.primary-btn.small { padding: 10px 12px; }
.ghost-btn { background: #eef2ff; color: #1d4ed8; }
.inline-block { display: inline-block; }
.helper-links { margin-top: 14px; display: flex; gap: 14px; }
.hint-box, .flash { margin-top: 16px; background: #eff6ff; border-radius: 12px; padding: 12px; }
.flash-wrap { display: grid; gap: 8px; margin-bottom: 16px; }
.dashboard { display: grid; gap: 20px; }
.dashboard-head { display: flex; justify-content: space-between; align-items: center; }
.grid { display: grid; gap: 20px; }
.two-col { grid-template-columns: 1.3fr 1fr; }
.main-grid { align-items: start; }
.panel { padding: 20px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.lecture-video, .webcam-feed { width: 100%; border-radius: 16px; background: #111827; }
.webcam-feed { min-height: 320px; object-fit: cover; }
.status-box {
    margin-top: 16px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px;
    background: #f8fafc; border-radius: 16px; padding: 14px;
}
.stats-grid { grid-template-columns: repeat(3, 1fr); }
.stat-card { padding: 22px; }
.stat-card span { display: block; color: var(--muted); margin-bottom: 8px; }
.stat-card strong { font-size: 28px; }
.toolbar { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; margin-bottom: 16px; }
canvas { width: 100% !important; height: 320px !important; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td { padding: 12px; border-bottom: 1px solid var(--line); text-align: left; }
.pill { display: inline-block; padding: 6px 10px; border-radius: 999px; background: #dcfce7; color: #166534; font-size: 13px; }
.pill.muted { background: #e5e7eb; color: #374151; }
.small-text { color: var(--muted); font-size: 13px; margin-top: 10px; }
.welcome { color: #dbeafe; }
@media (max-width: 980px) {
    .two-col, .stats-grid, .role-grid { grid-template-columns: 1fr; }
    .dashboard-head { flex-direction: column; align-items: start; gap: 12px; }
    .status-box { grid-template-columns: 1fr; }
}

.study-layout { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(320px, 0.9fr); gap: 20px; align-items: start; }
.study-sidebar { display: grid; gap: 20px; }
.compact-panel { padding: 18px; }
.small-feed { min-height: 220px; max-height: 260px; object-fit: cover; }
.one-col { grid-template-columns: 1fr; }
.compact-stats { grid-template-columns: 1fr; }
.toolbar-tight { gap: 10px; }
@media (max-width: 980px) {
    .study-layout { grid-template-columns: 1fr; }
}


.lecture-link-toolbar { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; }
.lecture-stage { min-height: 420px; display: flex; align-items: center; justify-content: center; background: #0f172a; border-radius: 18px; overflow: hidden; }
.lecture-frame { width: 100%; aspect-ratio: 16 / 9; }
.lecture-frame iframe { width: 100%; height: 100%; border: 0; }
.placeholder-box { width: 100%; min-height: 320px; display: grid; place-items: center; text-align: center; padding: 28px; color: #e5e7eb; }
.placeholder-box strong { font-size: 20px; display: block; margin-bottom: 10px; }
.placeholder-box p { margin: 0; max-width: 640px; color: #cbd5e1; }
.external-box { gap: 16px; }
.inline-link-box { margin-top: 10px; padding: 12px 14px; width: 100%; max-width: 760px; border-radius: 12px; background: rgba(255,255,255,0.08); color: #bfdbfe; overflow-wrap: anywhere; }
.disabled-link { opacity: 0.55; pointer-events: none; }
@media (max-width: 980px) {
    .lecture-link-toolbar { grid-template-columns: 1fr; }
}

.danger-btn { padding: 11px 16px; border-radius: 12px; border: none; cursor: pointer; background: #fee2e2; color: #b91c1c; }
.embed-note { margin-top: 12px; }
/* style.css 파일 맨 아래에 추가하세요 */

/* 1. 강의 화면 전체 높이 키우기 */
.lecture-stage {
    min-height: 700px !important; /* 기존 420px에서 대폭 확대 */
}

/* 2. 전체 페이지 너비 확장 (강의 화면이 더 넓게 퍼지도록) */
.page {
    max-width: 1600px !important; /* 기존 1320px에서 확장 */
}

/* 3. 강의와 캠 배치를 세로로 변경 (강의를 한 줄 전체로 쓰기 위함) */
@media (min-width: 981px) {
    .study-layout {
        grid-template-columns: 1fr !important; /* 2단 구성을 1단으로 강제 변경 */
    }
    
    .side-panel {
        display: grid;
        grid-template-columns: 1fr 1fr; /* 하단에 캠과 통계가 나란히 나오게 배치 */
        gap: 20px;
    }
}
/* 웹캠 화면 크기를 조절하는 코드 */
.one-col .webcam-panel {
    max-width: 50%; /* 웹캠 박스 전체 너비를 강의 화면의 절반으로 제한 */
    margin: 0 auto; /* 가운데 정렬 (왼쪽 정렬을 원하시면 이 줄은 빼세요) */
}

.one-col .webcam-feed {
    width: 100%;    /* 박스 너비 안에서 꽉 차게 */
    height: auto;   /* 비율 유지 */
    min-height: unset; /* 기존의 최소 높이 설정 해제 */
}

/* 아래 통계 카드들도 너무 길어지지 않게 조정 */
.one-col .study-sidebar {
    display: flex;
    flex-direction: column;
    align-items: center; /* 사이드바 내용물 가운데 정렬 */
}

.one-col .compact-stats {
    width: 50%; /* 통계 카드들도 웹캠과 같은 너비로 맞춤 */
}
/* 1. 검은색 배경 박스 자체의 최소 높이를 없애거나 줄임 */
.one-col .lecture-stage {
    min-height: auto !important; /* 고정된 높이를 해제 */
    height: auto !important; 
    background: #000; /* 여백이 남더라도 검은색으로 통일 */
}
/* 강의 화면을 가로세로 큼직하게 만드는 설정 */

.one-col .lecture-stage {
    /* 1. 최소 높이를 대폭 키움 (가로와 비슷해 보이도록) */
    min-height: 800px !important; 
    height: 800px !important;
    background: #000;
}

.one-col .lecture-frame {
    /* 2. 비율 제한을 풀고 부모 박스 높이에 맞춤 */
    width: 100% !important;
    height: 100% !important;
    aspect-ratio: auto !important; 
}

/* 내부 영상/유튜브 아이프레임도 꽉 차게 */
.one-col .lecture-frame iframe, 
.one-col .lecture-frame video {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain; /* 영상이 찌그러지지 않게 꽉 채움 */
}