/* 전역 스타일 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --danger-color: #e74c3c;
    --light-bg: #ecf0f1;
    --white: #ffffff;
    --text-dark: #2c3e50;
    --text-light: #7f8c8d;
    --border-color: #bdc3c7;
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
    --shadow-hover: 0 4px 20px rgba(0,0,0,0.15);
}

html {
    overflow-x: hidden;
    max-width: 100vw;
}

body {
    font-family: 'Noto Sans KR', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--text-dark);
    line-height: 1.6;
    min-height: 100vh;
    padding: 20px;
    overflow-x: hidden;
    max-width: 100vw;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: var(--white);
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    overflow: hidden;
    width: 100%;
}

/* 헤더 */
header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--white);
    padding: 30px 40px;
    text-align: center;
}

header h1 {
    font-size: 2em;
    font-weight: 700;
    margin-bottom: 10px;
}

header h1 i {
    margin-right: 10px;
}

header h2 {
    font-size: 1.2em;
    font-weight: 400;
    opacity: 0.95;
    margin-bottom: 20px;
}

.header-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.header-actions button {
    padding: 10px 20px;
    border: 2px solid var(--white);
    background: transparent;
    color: var(--white);
    border-radius: 25px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 500;
    transition: all 0.3s;
}

.header-actions button:hover {
    background: var(--white);
    color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.header-actions button i {
    margin-right: 5px;
}

/* 진행도 요약 */
.progress-summary {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    padding: 30px 40px;
    color: var(--white);
}

.progress-summary h3 {
    font-size: 1.5em;
    margin-bottom: 20px;
    text-align: center;
}

.progress-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.progress-item {
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(10px);
    padding: 15px;
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s;
}

.progress-item:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-2px);
}

.progress-label {
    font-weight: 600;
    font-size: 0.95em;
}

.progress-value {
    font-weight: 700;
    font-size: 1.1em;
    background: rgba(255,255,255,0.3);
    padding: 5px 15px;
    border-radius: 20px;
}

/* 섹션 */
.section {
    padding: 30px 40px;
    border-bottom: 1px solid var(--light-bg);
    overflow-x: hidden;
    max-width: 100%;
}

.section:last-of-type {
    border-bottom: none;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 3px solid var(--secondary-color);
}

.section-header h3 {
    font-size: 1.4em;
    color: var(--primary-color);
    font-weight: 600;
}

.section-header h3 i {
    margin-right: 10px;
    color: var(--secondary-color);
}

.section-credits {
    font-size: 1.2em;
    font-weight: 700;
    color: var(--success-color);
    background: rgba(39, 174, 96, 0.1);
    padding: 8px 20px;
    border-radius: 20px;
}

/* 서브섹션 */
.subsection {
    margin-bottom: 25px;
    padding-left: 20px;
    border-left: 3px solid var(--light-bg);
}

.subsection h4 {
    font-size: 1.1em;
    color: var(--text-dark);
    margin-bottom: 15px;
    font-weight: 600;
}

/* 과목 리스트 */
.course-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.course-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: var(--light-bg);
    border-radius: 10px;
    transition: all 0.3s;
    flex-wrap: wrap;
}

.course-item:hover {
    background: #e0e6e8;
    transform: translateX(5px);
    box-shadow: var(--shadow);
}

.course-item input[type="checkbox"] {
    width: 22px;
    height: 22px;
    cursor: pointer;
    accent-color: var(--success-color);
}

.course-item label {
    flex: 1;
    font-size: 1em;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 200px;
    max-width: 100%;
    word-wrap: break-word;
}

.course-item input[type="checkbox"]:checked + label {
    color: var(--success-color);
    text-decoration: line-through;
}

/* 커스텀 입력 */
.custom-course label {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.custom-input {
    flex: 1;
    padding: 8px 12px;
    border: 2px solid var(--border-color);
    border-radius: 5px;
    font-size: 0.95em;
    font-family: 'Noto Sans KR', sans-serif;
    transition: all 0.3s;
    min-width: 120px;
    max-width: 100%;
}

.custom-input:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.credits-input {
    width: 80px;
    padding: 8px 12px;
    border: 2px solid var(--border-color);
    border-radius: 5px;
    font-size: 0.95em;
    font-family: 'Noto Sans KR', sans-serif;
    text-align: center;
    transition: all 0.3s;
}

.credits-input:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.note-input {
    width: 200px;
    max-width: 100%;
    padding: 8px 12px;
    border: 2px solid var(--border-color);
    border-radius: 5px;
    font-size: 0.9em;
    font-family: 'Noto Sans KR', sans-serif;
    transition: all 0.3s;
}

.note-input:focus {
    outline: none;
    border-color: var(--warning-color);
    box-shadow: 0 0 0 3px rgba(243, 156, 18, 0.1);
}

/* 과목 추가 버튼 */
.add-course-btn {
    margin-top: 15px;
    padding: 12px 25px;
    background: var(--secondary-color);
    color: var(--white);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95em;
    font-weight: 500;
    transition: all 0.3s;
}

.add-course-btn:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.add-course-btn i {
    margin-right: 8px;
}

/* 메모 영역 */
.memo-textarea {
    width: 100%;
    min-height: 150px;
    padding: 15px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 1em;
    font-family: 'Noto Sans KR', sans-serif;
    resize: vertical;
    transition: all 0.3s;
}

.memo-textarea:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* 푸터 */
footer {
    background: var(--primary-color);
    color: var(--white);
    padding: 30px 40px;
    text-align: center;
}

footer p {
    margin: 5px 0;
}

footer small {
    opacity: 0.8;
}

/* 반응형 디자인 */
@media (max-width: 1024px) {
    .additional-grid {
        grid-template-columns: 1fr;
    }
    
    .section {
        padding: 20px 30px;
    }
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .container {
        border-radius: 10px;
    }

    header {
        padding: 20px;
    }

    header h1 {
        font-size: 1.5em;
    }

    header h2 {
        font-size: 1em;
    }

    .progress-summary {
        padding: 20px;
    }

    .progress-grid {
        grid-template-columns: 1fr;
    }

    .section {
        padding: 20px;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .section-header h3 {
        font-size: 1.2em;
    }

    .course-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .course-item label {
        width: 100%;
        max-width: 100%;
    }

    .custom-course label {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
    }

    .custom-input {
        width: 100%;
        min-width: unset;
    }

    .note-input {
        width: 100%;
    }

    .credits-input {
        width: 100%;
    }

    /* 심화전공 그리드 모바일 대응 */
    .additional-grid {
        grid-template-columns: 1fr;
    }

    .additional-card {
        padding: 15px;
    }

    .additional-card-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .additional-card-header h4 {
        font-size: 0.95em;
        width: 100%;
    }

    .additional-credits {
        font-size: 0.8em;
    }

    .total-credits-grid {
        grid-template-columns: 1fr;
    }

    footer {
        padding: 20px;
    }
}

/* 프린트 스타일 */
@media print {
    body {
        background: white;
        padding: 0;
    }

    .container {
        box-shadow: none;
    }

    .header-actions {
        display: none;
    }

    .add-course-btn {
        display: none;
    }

    .course-item {
        break-inside: avoid;
    }

    .section {
        break-inside: avoid;
    }
}

/* 애니메이션 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section {
    animation: fadeIn 0.5s ease-out;
}

/* 스크롤바 스타일 */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--light-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--secondary-color);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #2980b9;
}

/* 체크된 과목 강조 */
.course-item.completed {
    background: rgba(39, 174, 96, 0.1);
    border-left: 4px solid var(--success-color);
}

/* 버튼 호버 효과 */
button {
    position: relative;
    overflow: hidden;
}

button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255,255,255,0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

button:hover::before {
    width: 300px;
    height: 300px;
}

/* 심볼 */
.symbol-delta {
    color: var(--warning-color);
    font-weight: bold;
    font-size: 1.1em;
}

.note-badge {
    background: var(--warning-color);
    color: var(--white);
    padding: 2px 8px;
    border-radius: 5px;
    font-size: 0.85em;
    margin-left: 5px;
}

/* 유의사항 섹션 */
.notice-section {
    background: #fff3cd;
}

.notice-box {
    background: white;
    padding: 20px;
    border-radius: 10px;
    border-left: 4px solid var(--warning-color);
}

.notice-box ul {
    list-style: none;
    padding: 0;
}

.notice-box li {
    padding: 10px 0;
    padding-left: 25px;
    position: relative;
}

.notice-box li:before {
    content: '⚠️';
    position: absolute;
    left: 0;
}

.notice-box strong {
    color: var(--danger-color);
}

/* 심화전공/부전공/복수전공/일반선택 섹션 */
.additional-section {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    overflow-x: hidden;
}

.additional-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 30px;
    max-width: 100%;
}

.additional-card {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: var(--shadow);
    transition: all 0.3s;
    min-height: 300px;
    display: flex;
    flex-direction: column;
    max-width: 100%;
    overflow: hidden;
}

.additional-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-5px);
}

.additional-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--secondary-color);
    flex-wrap: wrap;
    gap: 10px;
}

.additional-card-header h4 {
    font-size: 0.95em;
    color: var(--primary-color);
    margin: 0;
    flex: 1;
    min-width: 120px;
    word-wrap: break-word;
}

.additional-credits {
    font-size: 0.85em;
    font-weight: 700;
    color: var(--success-color);
    background: rgba(39, 174, 96, 0.1);
    padding: 5px 10px;
    border-radius: 15px;
    white-space: nowrap;
}

.additional-note {
    margin-bottom: 15px;
    padding: 10px;
    background: #fff3cd;
    border-radius: 5px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.additional-note small {
    display: block;
    line-height: 1.6;
    font-size: 0.85em;
}

/* 총 학점 계산 */
.total-credits-summary {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: var(--shadow);
    margin-top: 20px;
}

.total-credits-summary h4 {
    font-size: 1.3em;
    color: var(--primary-color);
    margin-bottom: 20px;
    text-align: center;
}

.total-credits-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.total-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: var(--light-bg);
    border-radius: 8px;
    transition: all 0.3s;
}

.total-item:hover {
    background: #e0e6e8;
    transform: scale(1.02);
}

.total-item span:first-child {
    font-weight: 500;
    color: var(--text-dark);
    font-size: 0.95em;
}

.total-item span:last-child {
    font-weight: 700;
    font-size: 1.1em;
    color: var(--secondary-color);
}

.total-final {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.total-final span {
    color: white;
}

.total-final span:last-child {
    font-size: 1.3em;
}

/* 작은 버튼 */
.add-course-btn-small {
    margin-top: 10px;
    padding: 8px 15px;
    background: var(--secondary-color);
    color: var(--white);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85em;
    font-weight: 500;
    transition: all 0.3s;
    width: 100%;
}

.add-course-btn-small:hover {
    background: #2980b9;
    transform: translateY(-1px);
}

/* 교직 및 졸업요건 충족 여부 확인 */
.final-check-section {
    background: linear-gradient(135deg, #ffeaa7 0%, #fdcb6e 100%);
}

.final-check-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.check-card {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: var(--shadow);
    transition: all 0.3s;
}

.check-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-3px);
}

.check-header {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--warning-color);
    flex-wrap: wrap;
}

.check-header input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--success-color);
    flex-shrink: 0;
}

.check-header label {
    flex: 1;
    font-size: 1em;
    cursor: pointer;
    color: var(--primary-color);
    min-width: 150px;
}

.check-header small {
    display: block;
    color: var(--text-light);
    font-size: 0.85em;
    margin-top: 5px;
}

.check-detail {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.check-item {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.check-item span {
    font-weight: 500;
    color: var(--text-dark);
    min-width: 80px;
    font-size: 0.9em;
}

.detail-input {
    flex: 1;
    padding: 8px 12px;
    border: 2px solid var(--border-color);
    border-radius: 5px;
    font-size: 0.9em;
    font-family: 'Noto Sans KR', sans-serif;
    transition: all 0.3s;
    min-width: 120px;
}

.detail-input:focus {
    outline: none;
    border-color: var(--warning-color);
    box-shadow: 0 0 0 3px rgba(243, 156, 18, 0.1);
}

.check-note {
    background: #fff3cd;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 10px;
}

.check-note small {
    line-height: 1.8;
}

/* 최종 확인 요약 */
.final-summary {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: var(--shadow);
    margin-top: 20px;
}

.final-summary h4 {
    font-size: 1.3em;
    color: var(--primary-color);
    margin-bottom: 20px;
    text-align: center;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.summary-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    background: var(--light-bg);
    border-radius: 8px;
    transition: all 0.3s;
}

.summary-item:hover {
    background: #e0e6e8;
    transform: translateX(5px);
}

.summary-item i {
    font-size: 1.2em;
    color: var(--text-light);
}

.summary-item.checked i {
    color: var(--success-color);
}

.summary-item span {
    font-weight: 500;
    color: var(--text-dark);
}

.summary-item.checked span {
    color: var(--success-color);
    text-decoration: line-through;
}

/* 토스트 알림 */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--primary-color);
    color: var(--white);
    padding: 15px 25px;
    border-radius: 10px;
    box-shadow: var(--shadow-hover);
    z-index: 1000;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast.success {
    background: var(--success-color);
}

.toast.warning {
    background: var(--warning-color);
}

.toast.error {
    background: var(--danger-color);
}