/* ==================== buildup.css ==================== */
/* 빌드업 화면 전용 스타일 */
/* 공통 레이아웃은 common.css에 있음 */

/* ========== 학교 리스트 ========== */
.school-list {
    border-top: 1px solid rgba(155, 136, 219, 0.2);
    padding-top: 15px;
    margin-bottom: 15px;
    flex: 1;
    overflow-y: auto;
}

.school-item {
    display: flex;
    align-items: center;
    padding: 10px;
    margin-bottom: 6px;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.school-item:hover {
    background: var(--subtle);
    border-color: var(--menu-primary);
}

.school-item.active {
    background: var(--subtle);
    border-left: 3px solid var(--menu-primary);
}

.school-item input {
    margin-right: 10px;
    width: 16px;
    height: 16px;
}

.school-name {
    flex: 1;
    font-size: 13px;
    color: var(--menu-text);
}

/* ========== 컨트롤 버튼 ========== */
.items-controls {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.control-btn {
    flex: 1;
    padding: 8px;
    font-size: 12px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.control-btn.full-width {
    flex: none;
    width: 100%;
}

.control-btn.trash {
    background: #FFE8EA;
    color: #DC5F6F;
}

.control-btn.trash:hover {
    background: #FFD5D9;
}

.control-btn.trash.active {
    background: #ff5252;
    color: white;
}

.control-btn.add {
    background: var(--bg);
    color: var(--primary);
    border: 2px dashed var(--primary);
}

.control-btn.add:hover {
    background: var(--subtle);
}

/* ========== 팔레트 아이템 ========== */
.items-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 8px 0;
}

.palette-item {
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    color: white;
    cursor: move;
    transition: all 0.2s;
    text-align: center;
    position: relative;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.palette-item:hover {
    transform: translateX(-3px) scale(1.02);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.palette-item.dragging {
    opacity: 0.5;
    transform: rotate(-2deg);
}

/* 팔레트 항목 색상 */
.mock { background: #5B9BFF; }
.training { background: #9B59B6; }
.review-wrong { background: #FFB347; }
.review-weak { background: #77DD77; }
.review-make { background: #FF9FF3; }
.math-exam { background: #FF6B6B; }

/* 구버전 호환 (마이그레이션 과정에서 필요할 수 있음) */
.mock-mid, .mock-high { background: #5B9BFF; }
.train-mid, .train-high { background: #9B59B6; }

/* ========== 빌드업 전용 액션 버튼 ========== */
.action-btn.bethel {
    background: linear-gradient(135deg, #4ECDC4, var(--primary));
    color: white;
}

.action-btn.reset {
    background: #ffc107;
    color: var(--text);
}

/* ========== 시험 날짜 입력 ========== */
.exam-date-input {
    display: flex;
    align-items: center;
    gap: 8px;
}

.exam-date-input input {
    padding: 7px 12px;
    border: 2px solid var(--subtle);
    border-radius: 6px;
    font-size: 14px;
    color: var(--text);
    cursor: pointer;
}

/* ========== 캘린더 헤더 ========== */
.weekday-header {
    display: flex;
    gap: 12px;
    margin-bottom: 8px;
    padding: 0 8px;
}

.weekday-header-spacer {
    min-width: 140px;
}

.weekday-header-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    flex: 1;
}

.weekday-label {
    text-align: center;
    font-weight: bold;
    color: #333; /* 평일: 검정색 */
    font-size: 13px;
    padding: 4px;
}

.weekday-label.sunday { color: #dc3545; /* 일요일: 빨간색 */ }
.weekday-label.saturday { color: #0d6efd; /* 토요일: 파란색 */ }

/* ========== 주차 섹션 ========== */
.week-section {
    background: var(--bg);
    border-radius: 8px;
    padding: 8px;
    border: 1px solid var(--subtle);
    margin-bottom: 6px;
    display: flex;
    align-items: stretch;
    gap: 12px;
    min-height: 85px;
}

.week-header {
    min-width: 140px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    padding: 8px;
    background: var(--subtle);
    border-radius: 6px;
}

/* 시험주간 헤더 스타일 */
.week-header.exam-week {
    background: var(--primary);
    color: white;
}

.week-header.exam-week .week-number {
    background: rgba(255, 255, 255, 0.3);
    color: white;
}

.week-header.exam-week .week-theme {
    color: white;
}

.week-header.exam-week .week-description {
    color: rgba(255, 255, 255, 0.9);
}

.week-number {
    background: var(--primary);
    color: white;
    padding: 3px 8px;
    border-radius: 15px;
    font-weight: bold;
    font-size: 12px;
    text-align: center;
}

.week-theme {
    font-size: 15px;
    color: var(--primary);
    font-weight: 700;
    text-align: center;
}

.week-description {
    font-size: 10px;
    color: var(--text);
    text-align: center;
    margin-top: 2px;
}

.week-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    flex: 1;
}

/* ========== 날짜 카드 ========== */
.day-card {
    background: white;
    border-radius: 6px;
    padding: 5px;
    border: 2px solid var(--subtle);
    min-height: 75px;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    position: relative;
}

.day-card.today {
    background: var(--bg);
    border-color: var(--primary);
    box-shadow: 0 0 8px rgba(106, 59, 255, 0.3);
}

/* 시험 날짜 강조 스타일 */
.day-card.exam-day {
    background: var(--primary);
    border-color: var(--primary-dark);
    box-shadow: 0 0 12px var(--primary);
}

.day-card.exam-day .day-date {
    color: white !important;
    font-weight: 900;
    font-size: 14px;
}

.day-card.exam-day .day-header {
    border-bottom-color: rgba(255, 255, 255, 0.3);
}

.day-card.exam-day .event-item {
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.day-card.drag-over {
    background: var(--subtle);
    border-color: var(--primary);
    border-style: dashed;
}

.day-header {
    text-align: center;
    margin-bottom: 3px;
    padding-bottom: 2px;
    border-bottom: 1px solid var(--subtle);
}

.day-date {
    font-size: 13px;
    font-weight: bold;
    color: #333; /* 평일: 검정색 */
}

.day-date.sunday { color: #dc3545; /* 일요일: 빨간색 */ }
.day-date.saturday { color: #0d6efd; /* 토요일: 파란색 */ }

.day-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 2px;
}

.event-item {
    padding: 3px 5px;
    border-radius: 4px;
    font-size: 9px;
    font-weight: 600;
    text-align: center;
    cursor: move;
    transition: all 0.2s;
    color: white;
}

.event-item:hover {
    transform: scale(1.05);
}

.event-item.dragging {
    opacity: 0.5;
}

/* ========== 캘린더 요약 ========== */
.calendar-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 16px;
    padding: 12px;
    background: var(--bg);
    border-radius: 8px;
    border: 1px solid var(--subtle);
}

.summary-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.summary-dday {
    background: var(--primary);
    color: white;
    padding: 5px 10px;
    border-radius: 16px;
    font-size: 13px;
    font-weight: bold;
}

.summary-stats {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
}

.stat-badge {
    padding: 2px 6px;
    border-radius: 10px;
    color: white;
    font-weight: bold;
    font-size: 10px;
}

/* ========== 휴지통 드래그 오버 ========== */
.control-btn.trash {
    position: relative;
    transition: all 0.2s ease;
    cursor: pointer;
    pointer-events: auto !important;
    z-index: 10;
}

.control-btn.trash * {
    pointer-events: none !important;
}

.control-btn.trash.drag-over {
    background: #dc3545 !important;
    color: white !important;
    border: 2px dashed #fff !important;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.4);
    animation: pulse 0.6s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1.05);
    }
    50% {
        transform: scale(1.1);
    }
}

.control-btn.trash:not(.drag-over):hover {
    background: #f8d7da;
    border-color: #dc3545;
    color: #dc3545;
}

[draggable="true"] {
    cursor: grab;
}

[draggable="true"]:active {
    cursor: grabbing;
}

.event-item[style*="opacity: 0.5"] {
    border: 2px dashed var(--primary);
}

/* ========== 출력 최적화 ========== */
@media print {
    .sidebar,
    .items-section,
    .calendar-summary,
    .exam-date-input {
        display: none !important;
    }

    .main-content {
        padding: 0;
        display: block;
        margin: 0;
    }

    .calendar-section {
        box-shadow: none;
        border: none;
        padding: 0;
        margin: 0;
        border-radius: 0;
        background: white;
        width: 100%;
        height: 100%;
    }
    
    .week-section {
        min-height: 70px !important;
        margin-bottom: 4px !important;
        padding: 6px !important;
    }
    
    .week-header {
        min-width: 120px !important;
        padding: 6px !important;
    }
    
    .week-theme {
        font-size: 13px !important;
    }
    
    .week-description {
        font-size: 9px !important;
    }
    
    .day-card {
        min-height: 65px !important;
        padding: 4px !important;
    }
    
    .event-item {
        font-size: 8px !important;
        padding: 2px 4px !important;
    }
    
    .weekday-header {
        margin-bottom: 6px !important;
    }
    
    .header {
        margin-bottom: 12px !important;
        padding-bottom: 10px !important;
    }
    
    .school-title {
        font-size: 20px !important;
    }
}