/* static\css\style.css =========================================
   HARA 진로 교육 플랫폼 - 전역 스타일
   헤더 스타일은 header.css 참조
========================================= */

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

html,
body {
    min-height: 100%;
    /* ✅ height: 100% → min-height: 100% 변경 */
    overflow-x: hidden;
    overflow-y: auto;
    /* ✅ 세로 스크롤 허용 */
}

body {
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #2d3748;
    background-color: #ffffff;
}

/* =========================================
   메인 콘텐츠 영역
========================================= */
.main-content {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: #ffffff;
}

/* =========================================
   Flash 메시지
========================================= */
.flash-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    max-width: 400px;
}

.flash {
    padding: 16px 20px;
    margin-bottom: 12px;
    border-radius: 12px;
    animation: slideInRight 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
}

.flash::before {
    content: '';
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.flash-success {
    background: #d1fae5;
    color: #065f46;
    border-left: 4px solid #10b981;
}

.flash-success::before {
    content: '✓';
    background: #10b981;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.flash-error {
    background: #fee2e2;
    color: #991b1b;
    border-left: 4px solid #ef4444;
}

.flash-error::before {
    content: '✕';
    background: #ef4444;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.flash-warning {
    background: #fef3c7;
    color: #92400e;
    border-left: 4px solid #f59e0b;
}

.flash-warning::before {
    content: '!';
    background: #f59e0b;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.flash-info {
    background: #dbeafe;
    color: #1e40af;
    border-left: 4px solid #3b82f6;
}

.flash-info::before {
    content: 'ℹ';
    background: #3b82f6;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}



/* =========================================
   페이지 콘텐츠 영역
========================================= */
.page-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding-top: 0;
    /* ✅ 상단 여백은 .main-content에서 통합 관리 */
}

.content {
    padding: 50px 40px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    flex: 1;
    background: white;
}

.section-title {
    font-size: 32px;
    font-weight: 700;
    color: #1a202c;
    margin-bottom: 35px;
    text-align: center;
    position: relative;
    padding-bottom: 15px;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 2px;
}

.section-subtitle {
    font-size: 16px;
    color: #718096;
    margin-top: -25px;
    margin-bottom: 40px;
    text-align: center;
}

/* =========================================
   카드 그리드
========================================= */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 350px), 1fr));
    gap: 30px;
    margin-bottom: 60px;
}

.card {
    background: white;
    border-radius: 16px;
    padding: 35px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid #e8eaf0;
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.card:hover::before {
    transform: scaleX(1);
}

.card:hover {
    transform: translateY(-6px);
    background: linear-gradient(135deg, #f0f4ff 0%, #fce7f3 100%);
    border-color: #c7d2fe;
}

.card-icon {
    font-size: 42px;
    margin-bottom: 20px;
    display: block;
    transition: transform 0.3s ease;
}

.card:hover .card-icon {
    transform: scale(1.1) rotate(5deg);
}

.card-title {
    font-size: 22px;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 12px;
    transition: color 0.3s ease;
}

.card:hover .card-title {
    color: #764ba2;
}

.card-description {
    color: #64748b;
    font-size: 15px;
    line-height: 1.7;
}

/* =========================================
   버튼 스타일 (공통)
========================================= */
.btn {
    padding: 10px 24px;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* 모든 버튼 상태에서 밑줄 제거 */
.btn:link,
.btn:visited,
.btn:hover,
.btn:active {
    text-decoration: none !important;
}

.btn-secondary {
    background: #e0e7ff;
    color: #667eea;
    border: 2px solid transparent;
}

.btn-secondary:hover {
    background: #c7d2fe;
    border-color: #667eea;
    transform: translateY(-2px);
}

.btn-outline {
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
}

.btn-outline:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
}

.btn-danger {
    background: #fee2e2;
    color: #dc2626;
    border: 2px solid transparent;
}

.btn-danger:hover {
    background: #fecaca;
    border-color: #dc2626;
    transform: translateY(-2px);
}

.btn-success {
    background: #d1fae5;
    color: #059669;
    border: 2px solid transparent;
}

.btn-success:hover {
    background: #a7f3d0;
    border-color: #059669;
    transform: translateY(-2px);
}

/* =========================================
   유틸리티 클래스
========================================= */
.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

.mt-1 {
    margin-top: 10px;
}

.mt-2 {
    margin-top: 20px;
}

.mt-3 {
    margin-top: 30px;
}

.mt-4 {
    margin-top: 40px;
}

.mt-5 {
    margin-top: 50px;
}

.mb-1 {
    margin-bottom: 10px;
}

.mb-2 {
    margin-bottom: 20px;
}

.mb-3 {
    margin-bottom: 30px;
}

.mb-4 {
    margin-bottom: 40px;
}

.mb-5 {
    margin-bottom: 50px;
}

.pt-1 {
    padding-top: 10px;
}

.pt-2 {
    padding-top: 20px;
}

.pt-3 {
    padding-top: 30px;
}

.pt-4 {
    padding-top: 40px;
}

.pt-5 {
    padding-top: 50px;
}

.pb-1 {
    padding-bottom: 10px;
}

.pb-2 {
    padding-bottom: 20px;
}

.pb-3 {
    padding-bottom: 30px;
}

.pb-4 {
    padding-bottom: 40px;
}

.pb-5 {
    padding-bottom: 50px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.container-sm {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.container-xs {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
}

/* =========================================
   반응형 디자인
========================================= */

/* 태블릿 */
@media (max-width: 1024px) {
    .main-content {
        padding-top: 0;
    }



    .content {
        padding: 40px 30px;
    }

    .card-grid {
        grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
        gap: 25px;
    }

    .flash-container {
        top: 80px;
    }
}

/* 모바일 */
@media (max-width: 768px) {
    .main-content {
        margin-left: 0 !important;
        padding-top: 0;
    }

    .content {
        padding: 20px 12px;
    }

    .card-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .section-title {
        font-size: 24px;
        margin-bottom: 24px;
    }

    .section-subtitle {
        font-size: 14px;
        margin-top: -16px;
        margin-bottom: 24px;
    }

    .card {
        padding: 20px;
    }

    .card-icon {
        font-size: 36px;
        margin-bottom: 16px;
    }

    .card-title {
        font-size: 18px;
    }

    .card-description {
        font-size: 14px;
    }

    .flash-container {
        top: 70px;
        right: 8px;
        left: 8px;
        max-width: none;
    }

    .flash {
        padding: 12px 16px;
        font-size: 14px;
    }

    .btn {
        padding: 10px 20px;
        font-size: 14px;
    }

    .container,
    .container-sm,
    .container-xs {
        max-width: 100%;
        width: 100%;
        box-sizing: border-box;
    }

    .content {
        max-width: 100%;
        width: 100%;
    }
}

/* 초소형 모바일 */
@media (max-width: 480px) {
    .main-content {
        padding-top: 0;
    }

    .content {
        padding: 16px 10px;
    }

    .section-title {
        font-size: 20px;
        padding-bottom: 12px;
    }

    .section-title::after {
        width: 40px;
        height: 3px;
    }

    .card {
        padding: 16px;
        border-radius: 12px;
    }

    .card-icon {
        font-size: 32px;
        margin-bottom: 12px;
    }

    .card-title {
        font-size: 16px;
        margin-bottom: 8px;
    }

    .card-description {
        font-size: 13px;
        line-height: 1.6;
    }

    .flash-container {
        top: 60px;
        right: 6px;
        left: 6px;
    }

    .flash {
        padding: 10px 12px;
        border-radius: 8px;
        font-size: 13px;
    }

    .container,
    .container-sm,
    .container-xs {
        padding: 0 10px;
        max-width: 100%;
        width: 100%;
        box-sizing: border-box;
    }
}

/* 가로 모드(Landscape) 최적화 */
@media (max-height: 500px) and (orientation: landscape) {
    .main-content {
        padding-top: 0;
    }

    .content {
        padding: 12px 16px;
    }

    .card {
        padding: 12px;
    }

    .flash-container {
        top: 50px;
        right: 10px;
        left: auto;
        max-width: 300px;
    }
}

/* =========================================
   접근성 개선
========================================= */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* 포커스 표시 */
a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 3px solid rgba(102, 126, 234, 0.5);
    outline-offset: 2px;
}

/* =========================================
   프린트 최적화
========================================= */
@media print {

    .sidebar,
    .header,
    .flash-container,
    .btn {
        display: none;
    }

    .main-content {
        margin-left: 0;
        padding-top: 0;
    }

    .content {
        padding: 0;
    }

    .card {
        break-inside: avoid;
        page-break-inside: avoid;
    }
}

/* =========================================
   로딩 애니메이션
========================================= */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(102, 126, 234, 0.3);
    border-radius: 50%;
    border-top-color: #667eea;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* =========================================
   다크모드 대응 (추후 확장용)
========================================= */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #1a202c;
        color: #e2e8f0;
    }

    .main-content {
        background: #2d3748;
    }

    .content {
        background: #2d3748;
    }

    .card {
        background: #374151;
        border-color: #4b5563;
    }

    .section-title {
        color: #f7fafc;
    }

    .card-description {
        color: #cbd5e0;
    }
}