/* Teacher Setup Page CSS - Complete Setup Styles */
/* 모든 Setup 페이지 관련 스타일 통합 */

/* Session Setup Layout */
.apple-session-setup {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #f5f5f5 !important;
}

/* Main Content */
.main-content {
    padding: 36px 128px 16px !important;
    max-width: none;
    width: 100%;
    box-sizing: border-box;
}

/* Blue Header Card */
.session-header-card {
    background: #3574d9;
    border-radius: 24px;
    padding: 32px 32px 32px 32px;
    margin-bottom: 24px;
    text-align: left;
    height: 120px;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    box-shadow:
        0 8px 32px rgba(53, 116, 217, 0.25),
        0 2px 8px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
    box-sizing: border-box;
}

.header-left {
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex: 1;
}

.header-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-shrink: 0;
    margin-left: 24px;
}

.session-header-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -50%;
    width: 200%;
    height: 100%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.05), transparent);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.session-header-title {
    font-family: 'Pretendard', 'NanumSquareNeo', 'Nanum Square Neo', sans-serif;
    font-size: 28px;
    font-weight: 800;
    color: #ffffff;
    margin: 0 0 6px 0;
    letter-spacing: -0.02em;
    position: relative;
    z-index: 1;
    padding-left: 0;
    text-rendering: optimizeLegibility;
    font-variation-settings: 'wght' 800;
    line-height: 1.2;
}

.session-header-subtitle {
    font-family: 'Pretendard', sans-serif;
    font-size: 16px;
    font-weight: 600;
    color: #a8c5ff;
    margin: 0;
    letter-spacing: -0.01em;
    position: relative;
    z-index: 1;
    padding-left: 0;
    line-height: 1.4;
}

/* Two Column Layout */
.main-layout-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 16px;
    align-items: start; /* stretch 대신 start로 변경 */
}

.session-info-section {
    background: #FFFFFF;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0px 1.6px 3.6px rgba(0, 0, 0, 0.11), 0px 0.3px 0.9px rgba(0, 0, 0, 0.07);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 20px;
    justify-content: flex-start !important; /* 내용을 위쪽으로 정렬 */
}

/* 오른쪽 컬럼 전체 래퍼 */
.right-column-wrapper {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* 설정 카드들만 묶는 컨테이너 */
.config-options-section {
    display: flex !important;
    flex-direction: column !important;
    gap: 24px !important;
    justify-content: flex-start !important; /* space-between 대신 flex-start */
}

.config-section {
    background: #FFFFFF;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0px 1.6px 3.6px rgba(0, 0, 0, 0.11), 0px 0.3px 0.9px rgba(0, 0, 0, 0.07);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
}

.session-info-section:hover,
.config-section:hover {
    box-shadow:
        0 20px 40px rgba(53, 116, 217, 0.08),
        0 4px 16px rgba(0, 0, 0, 0.04);
    border-color: rgba(53, 116, 217, 0.12);
}

.section-title {
    font-family: 'Pretendard', 'NanumSquareNeo', 'Nanum Square Neo', sans-serif;
    font-size: 24px;
    font-weight: 800;
    color: #1a202c;
    margin: 0;
    line-height: 1.3;
    letter-spacing: -0.02em;
    text-rendering: optimizeLegibility;
    font-variation-settings: 'wght' 800;
}

.section-description {
    font-size: 16px;
    color: #64748b;
    margin: 0;
    line-height: 1.5;
}

/* Form Styles - Enhanced */
.apple-form {
    width: 100%;
}

.apple-form-group {
    margin-bottom: 20px;
}

.apple-form-group:last-child {
    margin-bottom: 0; /* 하단 여백 제거 */
    flex: 1; /* 마지막 요소가 남은 공간을 차지하도록 */
}

.apple-label {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 12px;
    letter-spacing: -0.01em;
}

/* Teacher Setup Page specific: Radio group for difficulty should be horizontal (3 columns) */
.config-section .apple-radio-group {
    grid-template-columns: repeat(3, 1fr);
    flex: 1;
}

.config-section .apple-toggle-group {
    flex: 1;
}

.apple-radio-group input[type="radio"],
.apple-toggle-group input[type="radio"] {
    display: none;
}

.apple-radio-card, .apple-toggle-card {
    display: block;
    padding: 20px;
    border: 2px solid #f1f5f9;
    border-radius: 16px;
    background: #ffffff;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    text-align: center;
}

.apple-radio-card:hover, .apple-toggle-card:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

/* Override default checked state for non-difficulty cards */
.apple-toggle-group input[type="radio"]:checked + .apple-toggle-card {
    border-color: #3574d9;
    background: rgba(53, 116, 217, 0.05);
    box-shadow: 0 8px 25px rgba(53, 116, 217, 0.2);
}

.apple-radio-group input[type="radio"]:checked + .apple-radio-card::after,
.apple-toggle-group input[type="radio"]:checked + .apple-toggle-card::after {
    content: '✓';
    position: absolute;
    top: 12px;
    right: 12px;
    width: 24px;
    height: 24px;
    background: #3574d9;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    animation: checkmarkBounce 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes checkmarkBounce {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.radio-content, .toggle-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.radio-icon, .toggle-icon {
    font-size: 28px;
    margin-bottom: 4px;
}

.radio-title, .toggle-title {
    font-size: 16px;
    font-weight: 700;
    color: #1a202c;
    margin: 0;
    line-height: 1.2;
}

.radio-subtitle, .toggle-subtitle {
    font-size: 13px;
    color: #64748b;
    margin: 0;
    line-height: 1.3;
}

/* Difficulty Level Card Styles */
/* Easy difficulty card */
input[value="easy"] + .apple-radio-card {
    background: #F4FAE8;
    border: 1px solid #6A9415;
}

input[value="easy"] + .apple-radio-card:hover {
    border: 2px solid #6A9415 !important;
}

input[value="easy"]:checked + .apple-radio-card {
    background: #E8F5D8 !important;
    border: 2px solid #527A0E !important;
    box-shadow: 0 8px 25px rgba(82, 122, 14, 0.3) !important;
}

/* Normal difficulty card */
input[value="normal"] + .apple-radio-card {
    background: #FFFAE6;
    border: 1px solid #B58F04;
}

input[value="normal"] + .apple-radio-card:hover {
    border: 2px solid #B58F04 !important;
}

input[value="normal"]:checked + .apple-radio-card {
    background: #FFF6CC !important;
    border: 2px solid #9A7503 !important;
    box-shadow: 0 8px 25px rgba(154, 117, 3, 0.3) !important;
}

/* Hard difficulty card */
input[value="hard"] + .apple-radio-card {
    background: #FFEDEA;
    border: 1px solid #B53720;
}

input[value="hard"] + .apple-radio-card:hover {
    border: 2px solid #B53720 !important;
}

input[value="hard"]:checked + .apple-radio-card {
    background: #FFE0DB !important;
    border: 2px solid #9A2D18 !important;
    box-shadow: 0 8px 25px rgba(154, 45, 24, 0.3) !important;
}

/* Remove blue top line animation for all cards */
.apple-radio-card::before, .apple-toggle-card::before {
    display: none !important;
}

.apple-radio-card:hover::before, .apple-toggle-card:hover::before {
    display: none !important;
}

/* Action Section */
.apple-action-section-right {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 16px;
    margin-top: 24px;
}

/* Loading overlay specific to Setup */
.loading-overlay {
    background: rgba(245, 245, 245, 0.95);
    backdrop-filter: blur(8px);
}

/* Animations */
.apple-session-setup {
    animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(32px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design */
@media (min-width: 1024px) {
    .config-options-section {
        display: flex !important;
        flex-direction: column;
        gap: 24px;
        flex: 1;
        height: 100%;
        min-height: 100%;
        justify-content: space-between;
    }

    .session-info-section,
    .config-section:nth-child(1),
    .config-section:nth-child(2),
    .apple-action-section-right {
        order: unset !important;
    }

    .apple-action-section-right {
        justify-content: flex-end !important;
        margin-top: 24px !important;
        margin-bottom: 0 !important;
        width: auto !important;
    }
}

@media (max-width: 1023px) {
    .main-content {
        padding: 24px 64px 16px !important;
    }
}

@media (max-width: 768px) {
    .main-content {
        padding: 20px 32px 16px !important;
    }

    /* Stack cards vertically */
    .main-layout-grid {
        display: flex;
        flex-direction: column;
        gap: 24px;
    }

    /* Session info section - 첫 번째 */
    .session-info-section {
        order: 1;
    }

    /* Right column wrapper - 모바일에서만 개별 요소로 분리 */
    .right-column-wrapper {
        display: contents; /* 래퍼를 무시하고 직접 자식들을 배치 */
    }

    /* Config options section을 개별 요소로 분리 */
    .config-options-section {
        display: contents; /* 이 래퍼도 무시 */
    }

    /* 학습 난이도 - 두 번째 */
    .config-section:nth-child(1) {
        order: 2;
    }

    /* 학습 진행도 - 세 번째 */
    .config-section:nth-child(2) {
        order: 3;
    }

    /* 세션 시작 버튼 - 네 번째 */
    .apple-action-section-right {
        order: 4;
        justify-content: center; /* 모바일에서는 버튼을 중앙 정렬 */
        margin-top: 24px;
        margin-bottom: 0; /* 메인 영역 패딩으로 간격 확보 */
        width: 100%; /* 전체 너비 차지 */
    }

    /* Radio/Toggle groups responsive */
    .config-section .apple-radio-group {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .config-section .apple-toggle-group {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}

@media (max-width: 480px) {
    .main-content {
        padding: 16px 20px 16px !important;
    }

    /* Header card responsive */
    .session-header-card {
        padding: 24px;
        height: auto;
        min-height: 100px;
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .header-right {
        margin-left: 0;
        width: 100%;
        justify-content: center;
    }

    .session-header-title {
        font-size: 24px;
        margin: 0 0 4px 0;
    }

    .session-header-subtitle {
        font-size: 14px;
    }

    .config-section {
        padding: 16px;
    }

    .session-info-section {
        padding: 16px;
    }
}