/* ==================== cover.css ==================== */
/* 표지 화면 전용 스타일 */

/* ========== 교재 선택 버튼 ========== */
.textbook-buttons {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
}

.textbook-btn {
    padding: 10px 8px;
    font-size: 13px;
    font-weight: 600;
    border: 2px solid var(--border);
    border-radius: 6px;
    background: var(--white);
    color: var(--text);
    cursor: pointer;
    transition: all 0.2s;
}

.textbook-btn:hover {
    border-color: var(--primary);
    transform: translateY(-1px);
}

.textbook-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* ========== 표지 타입 선택 버튼 ========== */
.cover-type-buttons {
    display: flex;
    gap: 6px;
}

.cover-type-btn {
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 600;
    border: 2px solid var(--border);
    border-radius: 6px;
    background: var(--white);
    color: var(--text);
    cursor: pointer;
    transition: all 0.2s;
}

.cover-type-btn:hover {
    border-color: var(--primary);
    transform: translateY(-1px);
}

.cover-type-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* ========== 표지 레이아웃 ========== */
#coverScreen .main-content {
    display: flex;
    gap: 16px;
    padding: 20px;
    max-height: calc(100vh - 40px);
}

#coverScreen .calendar-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow-y: auto;
}

#coverScreen .items-section {
    width: 550px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
}

/* ========== 컨트롤 패널 (좌측 + 중앙) ========== */
.cover-control-panel {
    flex: 1;
    overflow-y: auto;
    padding-right: 10px;
}

.cover-control-panel::-webkit-scrollbar {
    width: 6px;
}

.cover-control-panel::-webkit-scrollbar-track {
    background: var(--surface-muted);
    border-radius: 10px;
}

.cover-control-panel::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 10px;
}

.cover-control-panel::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* ========== 섹션 스타일 ========== */
.cover-section {
    background: var(--surface);
    padding: 12px;
    border-radius: 10px;
    margin-bottom: 12px;
    border: 2px solid var(--border);
}

.cover-section h2 {
    font-size: 14px;
    color: var(--primary);
    margin-bottom: 10px;
    font-weight: 600;
}

/* ========== 배경 드롭다운 ========== */
.background-dropdown {
    width: 100%;
    padding: 8px 12px;
    border: 2px solid var(--border);
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: border-color 0.3s;
    background: var(--white);
    color: var(--text);
}

.background-dropdown:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(106, 59, 255, 0.1);
}

/* ========== 컴팩트 그리드 (3열) ========== */
.cover-compact-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 12px;
}

.cover-compact-section {
    padding: 10px;
}

.cover-compact-section h2 {
    font-size: 12px;
    margin-bottom: 8px;
}

/* ========== 로고 컨트롤 ========== */
.logo-control-compact {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
    align-items: center;
}

.logo-control-compact .checkbox-label {
    font-size: 11px;
    margin-bottom: 0;
}

.upload-btn-small {
    padding: 4px 8px;
    font-size: 10px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.upload-btn-small:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

/* ========== 폼 그룹 컴팩트 ========== */
.form-group-compact {
    margin-bottom: 6px;
}

.form-group-compact label {
    display: block;
    font-size: 10px;
    color: var(--text);
    margin-bottom: 3px;
    font-weight: 500;
}

.form-group-compact input[type="text"],
.form-group-compact select {
    width: 100%;
    padding: 4px 6px;
    border: 2px solid var(--border);
    border-radius: 5px;
    font-size: 11px;
    background: var(--white);
    color: var(--text);
}

.form-group-compact input[type="range"] {
    width: calc(100% - 45px);
    margin-right: 5px;
}

.form-group-compact span {
    font-size: 10px;
    color: var(--text-muted);
}

/* ========== 템플릿 셀렉트 ========== */
.template-select-compact {
    width: 100%;
    padding: 4px 6px;
    border: 2px solid var(--border);
    border-radius: 5px;
    font-size: 11px;
    margin-bottom: 4px;
    background: var(--white);
    color: var(--text);
}

/* ========== 버튼 컴팩트 ========== */
.btn-compact {
    width: 100%;
    padding: 5px;
    margin-bottom: 4px;
    font-size: 11px;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-compact.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-compact.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.btn-compact.btn-secondary {
    background: #48bb78;
    color: white;
}

.btn-compact.btn-secondary:hover {
    background: #38a169;
    transform: translateY(-1px);
}

.btn-compact.btn-tertiary {
    background: var(--surface-muted);
    color: var(--text);
}

.btn-compact.btn-tertiary:hover {
    background: var(--border);
}

/* ========== 체크박스 라벨 ========== */
.checkbox-label {
    display: flex;
    align-items: center;
    font-size: 12px;
    color: var(--text);
    margin-bottom: 5px;
    font-weight: 600;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    margin-right: 6px;
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--primary);
}

.checkbox-inline {
    margin-bottom: 0;
    font-size: 11px;
    font-weight: 500;
}

.checkbox-inline input[type="checkbox"] {
    width: 14px;
    height: 14px;
    margin-right: 4px;
}

/* ========== 필드 그리드 (3열) ========== */
.fields-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

/* ========== 필드 스타일 ========== */
.field-full {
    padding: 12px;
    background: var(--white);
    border-radius: 6px;
    border: 2px solid var(--border);
}

.field-controls {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.field-text {
    width: 100%;
    padding: 6px 8px;
    border: 2px solid var(--border);
    border-radius: 5px;
    font-size: 13px;
    transition: border-color 0.3s;
    background: var(--white);
    color: var(--text);
}

.field-text:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(106, 59, 255, 0.1);
}

.field-text:disabled {
    background: var(--surface-muted);
    cursor: not-allowed;
}

/* ========== 필드 설정 그리드 ========== */
.field-settings {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.setting-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.setting-item label {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
}

.field-size,
.field-color,
.field-font,
.field-font-custom,
.field-align {
    padding: 5px;
    border: 2px solid var(--border);
    border-radius: 5px;
    font-size: 12px;
    width: 100%;
    background: var(--white);
    color: var(--text);
}

.field-size:focus,
.field-font:focus,
.field-font-custom:focus,
.field-align:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(106, 59, 255, 0.1);
}

.field-color {
    height: 32px;
    cursor: pointer;
}

/* ========== 커스텀 폰트 입력 ========== */
.custom-font-input {
    grid-column: 1 / -1;
}

/* ========== 프리뷰 패널 (우측) ========== */
.cover-preview-panel {
    flex: 0 0 550px;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.cover-preview-panel h2 {
    font-size: 14px;
    color: var(--primary);
    margin-bottom: 8px;
    font-weight: 600;
}

.canvas-wrapper {
    background: var(--surface-muted);
    border-radius: 10px;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.1);
    flex: 1;
    overflow: hidden;
}

#coverCanvas {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
    cursor: default;
    background: white;
}

.hint {
    margin-top: 6px;
    text-align: center;
    color: var(--text-muted);
    font-size: 10px;
}

/* ========== 반응형 ========== */
@media (max-width: 1600px) {
    .fields-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 1200px) {
    .fields-grid {
        grid-template-columns: 1fr;
    }
    
    .cover-compact-grid {
        grid-template-columns: 1fr;
    }
}

/* ========== 인쇄 최적화 ========== */
@media print {
    #coverScreen .sidebar,
    #coverScreen .calendar-section {
        display: none !important;
    }

    #coverScreen .items-section {
        width: 100% !important;
    }

    .canvas-wrapper {
        padding: 0 !important;
        box-shadow: none !important;
    }

    #coverCanvas {
        max-width: 100% !important;
        max-height: 100% !important;
    }
}