/* 기본 설정 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Malgun Gothic', '맑은 고딕', 'Apple SD Gothic Neo', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 600px;
    margin: 0 auto;
}

/* 로그인 화면 */
.login-box {
    background: white;
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    margin-top: 80px;
}

.login-box h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    color: #333;
}

.login-box h2 {
    font-size: 1.5em;
    color: #555;
    margin-bottom: 10px;
    font-weight: normal;
}

.course-info {
    color: #888;
    margin-bottom: 40px;
}

.input-group {
    margin: 30px 0;
}

.input-group label {
    display: block;
    margin-bottom: 10px;
    color: #666;
    font-weight: 500;
}

.input-group input {
    width: 100%;
    padding: 15px;
    font-size: 1.1em;
    border: 2px solid #ddd;
    border-radius: 10px;
    transition: border-color 0.3s;
    text-align: center;
}

.input-group input:focus {
    outline: none;
    border-color: #667eea;
}

.primary-btn {
    width: 100%;
    padding: 15px;
    font-size: 1.1em;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    font-weight: 600;
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.primary-btn:active {
    transform: translateY(0);
}

.notice {
    margin-top: 20px;
    color: #888;
    font-size: 0.9em;
}

.error-msg {
    color: #e74c3c;
    margin-top: 10px;
    font-size: 0.9em;
    min-height: 20px;
}

/* 메인 화면 */
.main-header {
    background: white;
    padding: 30px;
    border-radius: 20px;
    text-align: center;
    margin-bottom: 20px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.main-header h1 {
    font-size: 2em;
    color: #333;
    margin-bottom: 10px;
}

.semester-info {
    color: #666;
    font-size: 0.95em;
}

/* 주차 카드 */
.week-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.week-card {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s;
}

.week-card.clickable {
    cursor: pointer;
}

.week-card.clickable:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.15);
}

.week-card.locked {
    opacity: 0.6;
}

.week-card.open {
    border: 2px solid #667eea;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9ff 100%);
}

.week-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.week-number {
    font-weight: 600;
    color: #667eea;
    font-size: 0.9em;
}

.status-badge {
    font-size: 0.85em;
    color: #666;
    background: #f0f0f0;
    padding: 5px 12px;
    border-radius: 20px;
}

.week-card.open .status-badge {
    background: #e8f0ff;
    color: #667eea;
    font-weight: 600;
}

.week-card h3 {
    font-size: 1.3em;
    color: #333;
    margin-bottom: 5px;
}

.author {
    color: #888;
    font-size: 0.95em;
}

/* 푸터 */
.main-footer {
    text-align: center;
    color: rgba(255, 255, 255, 0.8);
    margin-top: 30px;
    font-size: 0.9em;
}

.main-footer p {
    margin: 5px 0;
}

.copyright {
    font-size: 0.85em;
    opacity: 0.7;
}

/* 리더 화면 */
.reader-body {
    background: #f5f5f5;
}

.reader-container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    min-height: calc(100vh - 40px);
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.1);
}

.reader-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    background: #667eea;
    color: white;
    position: sticky;
    top: 0;
    z-index: 100;
}

.back-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    transition: background 0.3s;
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.timer-display {
    font-weight: 600;
    font-size: 0.95em;
}

/* 읽기 콘텐츠 */
.reading-content {
    padding: 40px 50px;
    max-width: 700px;
    margin: 0 auto;
}

.reading-content h1 {
    font-size: 2em;
    color: #333;
    margin-bottom: 10px;
    text-align: center;
}

.story-author {
    text-align: center;
    color: #888;
    font-size: 1.1em;
    margin-bottom: 30px;
}

.reading-content hr {
    border: none;
    border-top: 1px solid #e0e0e0;
    margin: 30px 0;
}

.story-text {
    line-height: 2;
    font-size: 18px;
    color: #333;
    white-space: pre-line;
    user-select: text; /* 읽기 위한 선택은 허용 */
}

/* 글자 크기 조절 버튼 */
.font-controls {
    position: fixed;
    bottom: 30px;
    right: 30px;
    display: flex;
    gap: 10px;
    background: white;
    padding: 10px;
    border-radius: 30px;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.2);
}

.font-controls button {
    width: 40px;
    height: 40px;
    border: none;
    background: #f5f5f5;
    border-radius: 50%;
    cursor: pointer;
    font-weight: 600;
    color: #666;
    transition: all 0.3s;
}

.font-controls button:hover {
    background: #667eea;
    color: white;
    transform: scale(1.1);
}

/* 리더 푸터 */
.reader-footer {
    text-align: center;
    padding: 30px;
    background: #f9f9f9;
    border-top: 1px solid #e0e0e0;
    margin-top: 50px;
}

.watermark {
    color: #999;
    font-size: 0.85em;
    margin: 5px 0;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .login-box {
        padding: 30px 20px;
        margin-top: 40px;
    }

    .login-box h1 {
        font-size: 2em;
    }

    .login-box h2 {
        font-size: 1.2em;
    }

    .main-header {
        padding: 20px;
    }

    .main-header h1 {
        font-size: 1.5em;
    }

    .week-card h3 {
        font-size: 1.1em;
    }

    .reading-content {
        padding: 30px 20px;
    }

    .reading-content h1 {
        font-size: 1.6em;
    }

    .story-text {
        font-size: 16px;
        line-height: 1.8;
    }

    .reader-header {
        padding: 15px 20px;
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }

    .timer-display {
        font-size: 0.85em;
    }

    .font-controls {
        bottom: 20px;
        right: 20px;
        gap: 8px;
    }

    .font-controls button {
        width: 36px;
        height: 36px;
        font-size: 0.9em;
    }
}

@media (max-width: 480px) {
    .login-box h1 {
        font-size: 1.8em;
    }

    .reading-content {
        padding: 20px 15px;
    }

    .reading-content h1 {
        font-size: 1.4em;
    }

    .story-text {
        font-size: 15px;
    }
}

/* 인쇄 방지 */
@media print {
    body {
        display: none;
    }
}
/* 스토리 탭 */
.story-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 10px;
}

.story-tab {
    padding: 10px 20px;
    background: #f5f5f5;
    border: none;
    border-radius: 8px 8px 0 0;
    cursor: pointer;
    font-size: 1em;
    color: #666;
    transition: all 0.3s;
}

.story-tab:hover {
    background: #e8e8e8;
    color: #333;
}

.story-tab.active {
    background: #667eea;
    color: white;
    font-weight: 600;
}

/* 모바일용 탭 */
@media (max-width: 480px) {
    .story-tabs {
        gap: 5px;
    }
    
    .story-tab {
        padding: 8px 15px;
        font-size: 0.9em;
    }
}