/* 관리자 대시보드 스타일 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --success-color: #48bb78;
    --warning-color: #f6ad55;
    --error-color: #f56565;
    --text-dark: #2d3748;
    --text-light: #718096;
    --bg-light: #f7fafc;
    --bg-dark: #edf2f7;
    --border-color: #e2e8f0;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.15);
}

body {
    font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background: var(--bg-light);
}

/* 로그인 화면 */
.login-screen {
    display: none;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-screen.active {
    display: flex;
}

.login-container {
    background: white;
    border-radius: 16px;
    padding: 40px;
    width: 100%;
    max-width: 450px;
    box-shadow: var(--shadow-lg);
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h1 {
    font-size: 28px;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.login-header p {
    font-size: 14px;
    color: var(--text-light);
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
}

.form-group input {
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.btn-block {
    width: 100%;
}

.error-message {
    padding: 12px;
    background: rgba(245, 101, 101, 0.1);
    border: 1px solid var(--error-color);
    border-radius: 8px;
    color: var(--error-color);
    font-size: 14px;
    text-align: center;
}

.login-info {
    margin-top: 20px;
    padding: 16px;
    background: var(--bg-light);
    border-radius: 8px;
    font-size: 13px;
    color: var(--text-light);
}

.login-info p {
    margin-bottom: 8px;
}

.login-info code {
    display: block;
    padding: 8px 12px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: var(--text-dark);
    margin: 8px 0;
}

/* 관리자 컨테이너 */
.admin-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* 헤더 */
.admin-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px 40px;
    border-radius: 16px;
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-lg);
}

.header-content h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
}

.subtitle {
    font-size: 14px;
    opacity: 0.9;
}

.header-actions {
    display: flex;
    gap: 12px;
}

/* 버튼 */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: white;
    color: var(--primary-color);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid white;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.3);
}

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

.btn-danger:hover {
    background: #e53e3e;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-link {
    background: none;
    color: var(--primary-color);
    padding: 8px 16px;
    text-decoration: underline;
}

.btn-detail {
    padding: 6px 12px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-detail:hover {
    background: var(--secondary-color);
}

.icon {
    font-size: 16px;
}

/* 알림 박스 */
.notice-box {
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.notice-box.warning {
    border-color: var(--warning-color);
    background: #fffaf0;
}

.notice-icon {
    font-size: 32px;
    flex-shrink: 0;
}

.notice-content {
    flex: 1;
}

.notice-content h3 {
    font-size: 18px;
    margin-bottom: 8px;
    color: var(--text-dark);
}

.notice-content p {
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 12px;
}

.notice-actions {
    display: flex;
    gap: 12px;
}

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

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    display: flex;
    gap: 16px;
    align-items: center;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.stat-icon {
    font-size: 40px;
    flex-shrink: 0;
}

.stat-content {
    flex: 1;
}

.stat-label {
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: 4px;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-dark);
}

/* 툴바 */
.toolbar {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    display: flex;
    gap: 16px;
    align-items: center;
    box-shadow: var(--shadow);
}

.search-box {
    flex: 1;
    position: relative;
}

.search-box input {
    width: 100%;
    padding: 12px 40px 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.search-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    color: var(--text-light);
}

.filter-select {
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    background: white;
}

/* 응답 섹션 */
.responses-section {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: var(--shadow);
}

.responses-section h2 {
    font-size: 22px;
    margin-bottom: 20px;
    color: var(--text-dark);
}

/* 빈 상태 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.empty-state h3 {
    font-size: 20px;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 14px;
    color: var(--text-light);
}

/* 로딩 스피너 */
.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--bg-dark);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    margin: 0 auto 16px;
    animation: spin 0.8s linear infinite;
}

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

/* 데이터 테이블 */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.data-table thead {
    background: var(--bg-light);
}

.data-table th {
    padding: 12px 16px;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dark);
    border-bottom: 2px solid var(--border-color);
}

.data-table td {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
}

.data-table tbody tr:hover {
    background: var(--bg-light);
}

.score-high {
    color: var(--success-color);
}

.score-medium {
    color: var(--warning-color);
}

.score-low {
    color: var(--error-color);
}

/* 모달 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 30px;
    border-bottom: 2px solid var(--border-color);
}

.modal-header h2 {
    font-size: 22px;
    color: var(--text-dark);
}

.modal-close {
    font-size: 32px;
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    padding: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: var(--bg-light);
    color: var(--text-dark);
}

.modal-body {
    padding: 30px;
}

/* 상세 정보 */
.detail-section {
    margin-bottom: 30px;
}

.detail-section h3 {
    font-size: 18px;
    margin-bottom: 16px;
    color: var(--text-dark);
}

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

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.detail-item label {
    font-size: 12px;
    color: var(--text-light);
    font-weight: 600;
}

.detail-item span {
    font-size: 14px;
    color: var(--text-dark);
}

.score-highlight {
    font-size: 18px !important;
    font-weight: 700 !important;
    color: var(--primary-color) !important;
}

/* 답안 테이블 */
.answer-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 12px;
}

.answer-table th {
    padding: 10px;
    background: var(--bg-light);
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    border-bottom: 2px solid var(--border-color);
}

.answer-table td {
    padding: 10px;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
}

.correct-answer {
    background: rgba(72, 187, 120, 0.1);
}

.incorrect-answer {
    background: rgba(245, 101, 101, 0.1);
}

/* 설정 스텝 */
.setup-steps {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.setup-steps h3 {
    font-size: 16px;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.setup-steps p {
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 12px;
}

.input-field {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.input-field:focus {
    outline: none;
    border-color: var(--primary-color);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.button-group {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.button-group .btn {
    flex: 1;
}

.info-box {
    background: var(--bg-light);
    padding: 16px;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

.info-box strong {
    display: block;
    margin-bottom: 8px;
    color: var(--text-dark);
}

.info-box p {
    font-size: 14px;
    color: var(--text-light);
    margin: 0;
}

.info-box a {
    color: var(--primary-color);
    text-decoration: underline;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .admin-header {
        flex-direction: column;
        gap: 20px;
        align-items: flex-start;
    }
    
    .header-actions {
        width: 100%;
        flex-direction: column;
    }
    
    .header-actions .btn {
        width: 100%;
        justify-content: center;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .toolbar {
        flex-direction: column;
    }
    
    .data-table {
        font-size: 12px;
    }
    
    .data-table th,
    .data-table td {
        padding: 8px;
    }
    
    .modal-content {
        width: 95%;
        max-height: 95vh;
    }
    
    .detail-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .admin-container {
        padding: 10px;
    }
    
    .admin-header {
        padding: 20px;
    }
    
    .header-content h1 {
        font-size: 22px;
    }
    
    .responses-section {
        padding: 20px;
    }
}
