/* 🎨 학교 학생수 추이 - 모던 카드형 디자인 */

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

/* 페이지 타이틀 */
.page-title {
    font-size: 2.5em;
    font-weight: 700;
    text-align: center;
    margin-bottom: 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.page-subtitle {
    text-align: center;
    color: #6b7280;
    font-size: 1.1em;
    margin-bottom: 30px;
}

/* 필터 섹션 */
.filter-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 25px;
    border-radius: 15px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

.filter-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filter-tab {
    flex: 1;
    min-width: 120px;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid transparent;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

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

.filter-tab.active {
    background: white;
    color: #667eea;
    border-color: white;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.search-box {
    display: flex;
    gap: 10px;
}

.search-input {
    flex: 1;
    padding: 15px 20px;
    border: none;
    border-radius: 10px;
    font-size: 1em;
    outline: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.search-input:focus {
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.btn-search {
    padding: 15px 30px;
    background: white;
    color: #667eea;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

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

/* 지도 컨테이너 */
.map-container {
    margin-bottom: 30px;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    height: 500px;
}

#map {
    width: 100%;
    height: 100%;
}

/* 통계 요약 */
.stats-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
    display: flex;
    align-items: center;
    gap: 15px;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5em;
}

.stat-info {
    flex: 1;
}

.stat-label {
    color: #6b7280;
    font-size: 0.9em;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 1.8em;
    font-weight: 700;
    color: #1f2937;
}

/* 카드 그리드 */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
    min-height: 400px;
}

/* 학교 카드 */
.school-card {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px solid transparent;
}

.school-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
    border-color: #667eea;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f3f4f6;
}

.school-type-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 600;
    color: white;
}

.type-elementary {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.type-middle {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.type-high {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

.type-default {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.trend-badge {
    font-size: 1.2em;
    padding: 5px 10px;
    border-radius: 8px;
}

.trend-up {
    background: #d1fae5;
    color: #065f46;
}

.trend-down {
    background: #fee2e2;
    color: #991b1b;
}

.trend-neutral {
    background: #f3f4f6;
    color: #6b7280;
}

.card-body {
    margin-bottom: 15px;
}

.school-name {
    font-size: 1.2em;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 10px;
}

.school-address {
    color: #6b7280;
    font-size: 0.9em;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.student-info {
    background: #f9fafb;
    padding: 15px;
    border-radius: 10px;
    margin-top: 15px;
}

.student-count {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.student-count .label {
    color: #6b7280;
    font-size: 0.9em;
    font-weight: 600;
}

.student-count .value {
    font-size: 1.5em;
    font-weight: 700;
    color: #667eea;
}

.card-footer {
    text-align: center;
    padding-top: 15px;
    border-top: 2px solid #f3f4f6;
}

.btn-detail {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-detail:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 12px rgba(102, 126, 234, 0.3);
}

/* 로딩 스피너 */
.loader {
    grid-column: 1 / -1;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 40px auto;
}

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

/* 결과 없음 */
.no-results,
.error-message {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #9ca3af;
    font-size: 1.2em;
}

.no-results i,
.error-message i {
    font-size: 3em;
    margin-bottom: 15px;
    display: block;
}

/* 페이징 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin: 40px 0;
}

.page-btn {
    padding: 12px 20px;
    background: white;
    color: #667eea;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-info {
    font-weight: 600;
    color: #374151;
    font-size: 1.1em;
}

/* 모달 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
}

.modal.show {
    display: flex !important;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
}

.modal-content {
    position: relative;
    background: white;
    border-radius: 20px;
    width: 90%;
    max-width: 800px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
    z-index: 1001;
}

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

.close-button {
    position: absolute;
    top: 20px;
    right: 20px;
    background: #f3f4f6;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    z-index: 1002;
}

.close-button:hover {
    background: #ef4444;
    color: white;
    transform: rotate(90deg);
}

.modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px 30px 30px;
    border-radius: 20px 20px 0 0;
}

.modal-header h2 {
    font-size: 1.8em;
    margin: 0 0 10px 0;
    font-weight: 700;
}

.modal-header p {
    font-size: 1em;
    margin: 0;
    opacity: 0.9;
}

.modal-body {
    padding: 30px;
}

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

.info-item {
    background: #f9fafb;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
}

.info-item i {
    font-size: 2em;
    color: #667eea;
    margin-bottom: 10px;
}

.info-label {
    display: block;
    font-size: 0.9em;
    color: #6b7280;
    margin-bottom: 5px;
}

.info-value {
    display: block;
    font-size: 1.2em;
    font-weight: 700;
    color: #1f2937;
}

.chart-container {
    background: #f9fafb;
    padding: 20px;
    border-radius: 12px;
    height: 400px;
}

canvas {
    max-width: 100%;
    height: 100% !important;
}

/* 반응형 */
@media (max-width: 768px) {
    .page-title {
        font-size: 1.8em;
    }
    
    .filter-tabs {
        flex-direction: column;
    }
    
    .filter-tab {
        width: 100%;
    }
    
    .stats-summary {
        grid-template-columns: 1fr;
    }
    
    .cards-grid {
        grid-template-columns: 1fr;
    }
    
    .school-info-grid {
        grid-template-columns: 1fr;
    }
    
    .map-container {
        height: 300px;
    }
    
    .chart-container {
        height: 300px;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
