/* 전역 설정 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans KR', sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: #fff;
    min-height: 100vh;
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
}

/* 헤더 스타일 */
.header {
    background: url('../images/header-bg.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    color: white;
    padding: 3rem 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.1);
    z-index: 0;
}

.header::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.03) 50%, transparent 70%);
    animation: shimmer 4s ease-in-out infinite;
    z-index: 0;
}

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

.header-content {
    position: relative;
    z-index: 2;
}

.subject-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.subject-title i {
    font-size: 2rem;
}

.subject-subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    font-weight: 300;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

/* 메인 콘텐츠 */
.main-content {
    padding: 2rem;
}

/* 교과 소개 섹션 */
.intro-section {
    margin-bottom: 3rem;
    text-align: center;
}

.intro-content h2 {
    font-size: 2rem;
    color: #2c3e50;
    margin-bottom: 1rem;
    font-weight: 600;
}

.intro-content p {
    font-size: 1.1rem;
    color: #555;
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.8;
}

/* 학습자료 섹션 */
.materials-section h2 {
    font-size: 2rem;
    color: #2c3e50;
    margin-bottom: 2rem;
    text-align: center;
    font-weight: 600;
}

.materials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
    align-items: stretch;
}

/* 학습자료 카드 */
.material-card {
    background: #fff;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid #f0f0f0;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.material-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.15);
}

.card-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.5rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.card-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 각 카드별 고유 색상 */
.material-card:nth-child(1) .card-header {
    background: linear-gradient(135deg, #4285f4, #34a853);
}

.material-card:nth-child(2) .card-header {
    background: linear-gradient(135deg, #ff6b6b, #ee5a52);
}

.material-card:nth-child(3) .card-header {
    background: linear-gradient(135deg, #a855f7, #7c3aed);
}

.material-card:nth-child(4) .card-header {
    background: linear-gradient(135deg, #f59e0b, #ef4444);
}

.card-header i {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    display: block;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
    animation: iconFloat 2s ease-in-out infinite;
}

@keyframes iconFloat {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-5px); }
}

.card-header h3 {
    font-size: 1.3rem;
    font-weight: 600;
}

.card-content {
    padding: 1.2rem 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.card-content p {
    color: #555;
    line-height: 1.5;
    margin-bottom: 0.8rem;
}

.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

/* 아이콘 그리드 레이아웃 */
.icon-grid {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 0.8rem;
    flex-wrap: nowrap;
}

.icon-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.4rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    background: transparent;
    flex: 0 0 auto;
    min-width: 65px;
    max-width: 85px;
}

.icon-item:hover {
    transform: translateY(-3px);
    background: #f8f9fa;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.service-icon {
    height: 35px;
    width: auto;
    max-width: 35px;
    margin-bottom: 0.4rem;
    transition: all 0.3s ease;
    object-fit: contain;
    background: white;
    border-radius: 6px;
    padding: 2px;
}

.service-icon:hover {
    transform: scale(1.1);
}

.icon-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: #333;
    text-align: center;
    line-height: 1.2;
}

/* Font Awesome 아이콘 래퍼 */
.fa-icon-wrapper {
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    margin-bottom: 0.4rem;
    transition: all 0.3s ease;
}

.fa-icon-wrapper i {
    font-size: 18px;
    color: white;
}

.fa-icon-wrapper:hover {
    transform: scale(1.1);
}

.tag {
    background: #f8f9fa;
    color: #333;
    padding: 0.4rem 1rem;
    border-radius: 25px;
    font-size: 0.85rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.tag:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}





.card-footer {
    padding: 1rem 1.5rem;
    background: #f8f9fa;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 0.8rem 2rem;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #5a67d8, #667eea);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

/* Coming Soon 버튼 */
.btn-secondary {
    background: linear-gradient(135deg, #94a3b8, #64748b);
    color: white;
    border: none;
    padding: 0.8rem 2rem;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: not-allowed;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 15px rgba(148, 163, 184, 0.3);
    position: relative;
    overflow: hidden;
    opacity: 0.8;
}

.btn-secondary:disabled {
    background: linear-gradient(135deg, #94a3b8, #64748b);
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 2px 8px rgba(148, 163, 184, 0.2);
}

/* 교과 소개 섹션 개선 */
.intro-content-wrapper {
    display: flex;
    align-items: center;
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.intro-content {
    flex: 1;
}

.intro-qr {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
}

.intro-qr-image {
    width: 120px;
    height: 120px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.intro-qr-image:hover {
    transform: scale(1.05);
}

.qr-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.75rem;
    color: #666;
    background: #f8f9fa;
    padding: 0.3rem 0.8rem;
    border-radius: 12px;
    border: 1px solid #e9ecef;
}

.qr-label i {
    font-size: 0.8rem;
    color: #667eea;
}

.qr-label span {
    font-weight: 500;
}

.qr-info i {
    font-size: 1.2rem;
}

.qr-info span {
    font-weight: 500;
}

/* 푸터 */
.footer {
    background: #2c3e50;
    color: white;
    padding: 2rem;
    text-align: center;
    margin-top: auto;
}

.footer-content p {
    margin: 0.5rem 0;
}

.footer-content p:first-child {
    font-weight: 500;
}

.footer-content p:last-child {
    font-size: 0.9rem;
    opacity: 0.8;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .container {
        margin: 0;
        border-radius: 0;
    }
    
    .header {
        padding: 2rem 1rem;
    }
    
    .subject-title {
        font-size: 2rem;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .main-content {
        padding: 1rem;
    }
    
    .materials-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .intro-content-wrapper {
        flex-direction: column;
        gap: 1.5rem;
        text-align: center;
    }
    
    .intro-qr-image {
        width: 100px;
        height: 100px;
    }
    
    .qr-label {
        font-size: 0.7rem;
        padding: 0.25rem 0.6rem;
    }
    
    .icon-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 0.3rem;
    }
    
    .icon-item {
        padding: 0.3rem;
    }
    
    .service-icon {
        height: 30px;
        max-width: 30px;
    }
    
    .icon-label {
        font-size: 0.7rem;
    }
    
    .intro-content h2,
    .materials-section h2 {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 1.5rem 1rem;
    }
    
    .subject-title {
        font-size: 1.5rem;
    }
    
    .subject-subtitle {
        font-size: 1rem;
    }
    
    .card-content,
    .card-footer {
        padding: 1rem;
    }
    
    .btn-primary {
        padding: 0.7rem 1.5rem;
        font-size: 0.9rem;
    }
    
    .btn-secondary {
        padding: 0.7rem 1.5rem;
        font-size: 0.9rem;
    }
}