/* 🎨 모던 카드형 대학원 경쟁률 디자인 */

/* 페이지 타이틀 */
.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: 40px;
}

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

.search-filter-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

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

.search-box input[type="text"] {
    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);
    transition: all 0.3s ease;
}

.search-box input[type="text"]: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;
    font-size: 1em;
    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);
}

.filter-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-select {
    flex: 1;
    min-width: 200px;
    padding: 12px 15px;
    border: none;
    border-radius: 10px;
    font-size: 1em;
    background: white;
    cursor: pointer;
    outline: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.btn-filter {
    padding: 12px 25px;
    background: #10b981;
    color: white;
    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-filter:hover {
    background: #059669;
    transform: translateY(-2px);
}

.btn-reset {
    padding: 12px 25px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid white;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-block;
}

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

/* 결과 정보 */
.results-info {
    text-align: center;
    color: #6b7280;
    margin-bottom: 30px;
    font-size: 1.1em;
}

.results-info strong {
    color: #667eea;
    font-weight: 700;
}

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

/* 카드 기본 스타일 */
.card {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

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

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

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

/* 경쟁률에 따른 카드 색상 */
.card.high-competition {
    border-left: 4px solid #ef4444;
}

.card.medium-competition {
    border-left: 4px solid #f59e0b;
}

/* 카드 헤더 */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f3f4f6;
}

.school-name {
    font-size: 1.2em;
    font-weight: 700;
    color: #1f2937;
    margin: 0;
    flex: 1;
}

.location-badge {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 600;
    white-space: nowrap;
}

/* 카드 바디 */
.card-body {
    margin-bottom: 20px;
}

.department-name {
    font-size: 1.05em;
    font-weight: 600;
    color: #374151;
    margin: 0 0 8px 0;
}

.category-tag {
    display: inline-block;
    background: #f3f4f6;
    color: #6b7280;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.85em;
    margin-bottom: 20px;
}

/* 경쟁률 통계 */
.competition-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.stat-item {
    background: #f9fafb;
    padding: 12px;
    border-radius: 10px;
    border-left: 3px solid #667eea;
}

.stat-item.phd {
    border-left-color: #10b981;
}

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

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

.no-data {
    font-size: 0.9em;
    color: #9ca3af;
    font-weight: 400;
}

/* 카드 푸터 */
.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;
    font-size: 1em;
    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);
}

/* 검색 결과 없음 */
.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
}

.no-results p {
    font-size: 1.5em;
    color: #9ca3af;
    margin-bottom: 20px;
}

.btn-back {
    display: inline-block;
    padding: 12px 30px;
    background: #667eea;
    color: white;
    text-decoration: none;
    border-radius: 10px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-back:hover {
    background: #764ba2;
    transform: translateY(-2px);
}

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

.page-link {
    display: inline-block;
    padding: 10px 16px;
    background: white;
    color: #667eea;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 2px solid #e5e7eb;
}

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

.page-link.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: transparent;
}

/* 모달 */
.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: 900px;
    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: 1.1em;
    margin: 0;
    opacity: 0.9;
}

.modal-body {
    padding: 30px;
}

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

.summary-item {
    background: #f9fafb;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    border: 2px solid #e5e7eb;
}

.summary-label {
    font-size: 0.95em;
    color: #6b7280;
    margin-bottom: 10px;
    font-weight: 600;
}

.summary-value {
    font-size: 1.8em;
    font-weight: 700;
    color: #667eea;
}

.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;
    }
    
    .cards-grid {
        grid-template-columns: 1fr;
    }
    
    .filter-buttons {
        flex-direction: column;
    }
    
    .filter-select,
    .btn-filter,
    .btn-reset {
        width: 100%;
    }
    
    .modal-content {
        width: 95%;
        max-height: 90vh;
    }
    
    .competition-summary {
        grid-template-columns: 1fr;
    }
    
    .chart-container {
        height: 300px;
    }
}

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

@media (min-width: 1025px) {
    .cards-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1400px) {
    .cards-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}
