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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    padding: 40px;
}

/* 헤더 */
.header {
    text-align: center;
    margin-bottom: 40px;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 20px;
}

.header h1 {
    color: #667eea;
    font-size: 28px;
    margin-bottom: 10px;
}

.timer {
    font-size: 18px;
    font-weight: bold;
    color: #e74c3c;
    margin-top: 10px;
}

.timer.warning {
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* 로딩 */
.loading {
    text-align: center;
    padding: 60px 20px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f0f0f0;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

/* 에러 */
.error-container {
    text-align: center;
    padding: 60px 20px;
}

.error-message {
    background: #fff5f5;
    border: 2px solid #e74c3c;
    border-radius: 8px;
    padding: 30px;
}

.error-message h2 {
    color: #e74c3c;
    margin-bottom: 15px;
}

.error-message p {
    color: #666;
    margin-bottom: 20px;
}

/* 설문 정보 */
.survey-info {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
}

.survey-info h2 {
    color: #333;
    font-size: 22px;
    margin-bottom: 10px;
}

.survey-info p {
    color: #666;
    line-height: 1.6;
    margin-bottom: 15px;
}

.survey-meta {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.survey-meta span {
    background: white;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 14px;
    color: #667eea;
    font-weight: 500;
}

/* 학생 정보 */
.student-info {
    margin-bottom: 30px;
}

.student-info h3 {
    margin-bottom: 20px;
    color: #333;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #555;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
}

.form-group input.error {
    border-color: #e74c3c;
}

/* 진행 상황 */
.progress-container {
    margin-bottom: 30px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #f0f0f0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transition: width 0.3s ease;
    width: 0%;
}

.progress-text {
    text-align: right;
    font-size: 14px;
    color: #666;
}

/* 문제 목록 */
.questions-container {
    margin-bottom: 30px;
}

.question-item {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    border: 2px solid transparent;
    transition: border-color 0.3s;
}

.question-item.answered {
    border-color: #667eea;
}

.question-number {
    font-weight: bold;
    color: #667eea;
    margin-bottom: 15px;
    font-size: 16px;
}

.choices {
    display: flex;
    flex-direction: row;
    gap: 12px;
    justify-content: flex-start;
}

.choice-item {
    display: flex;
    align-items: center;
    flex: 1;
    max-width: 25%;
}

.choice-item input[type="radio"] {
    margin-right: 8px;
    cursor: pointer;
    width: 18px;
    height: 18px;
}

.choice-item label {
    cursor: pointer;
    flex: 1;
    padding: 12px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    transition: all 0.2s;
    text-align: center;
    font-size: 15px;
}

.choice-item input[type="radio"]:checked + label {
    background: #667eea;
    color: white;
    font-weight: 500;
    border-color: #667eea;
}

.choice-item label:hover {
    background: #f5f5f5;
    border-color: #667eea;
}

.choice-item input[type="radio"]:checked + label:hover {
    background: #5568d3;
}

/* 이미지 업로드 */
.image-upload-section {
    margin-bottom: 30px;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
}

.image-upload-section h3 {
    margin-bottom: 10px;
    color: #333;
}

.help-text {
    font-size: 14px;
    color: #666;
    margin-bottom: 15px;
}

.upload-area {
    text-align: center;
}

.image-preview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.image-preview-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    background: white;
    border: 2px solid #e0e0e0;
}

.image-preview-item img {
    width: 100%;
    height: 150px;
    object-fit: cover;
}

.image-preview-item .remove-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    transition: background 0.2s;
}

.image-preview-item .remove-btn:hover {
    background: #c0392b;
}

/* 버튼 */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
}

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

.btn-secondary:hover {
    background: #667eea;
    color: white;
}

.btn-large {
    width: 100%;
    padding: 16px 24px;
    font-size: 18px;
}

/* 제출 섹션 */
.submit-section {
    text-align: center;
}

/* 성공 화면 */
.success-container {
    text-align: center;
    padding: 60px 20px;
}

.success-message {
    background: #f0fdf4;
    border: 2px solid #22c55e;
    border-radius: 8px;
    padding: 40px;
}

.success-icon {
    width: 80px;
    height: 80px;
    background: #22c55e;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    margin: 0 auto 20px;
}

.success-message h2 {
    color: #22c55e;
    margin-bottom: 15px;
}

.success-message p {
    color: #666;
    margin-bottom: 20px;
}

.submission-info {
    background: white;
    border-radius: 6px;
    padding: 20px;
    margin-top: 20px;
}

.submission-info p {
    margin: 10px 0;
    color: #333;
}

/* 반응형 */
@media (max-width: 600px) {
    .container {
        padding: 20px;
    }

    .header h1 {
        font-size: 22px;
    }

    .survey-meta {
        flex-direction: column;
        gap: 10px;
    }

    .choices {
        flex-wrap: wrap;
    }

    .choice-item {
        max-width: 48%;
        flex: 0 0 48%;
    }

    .choice-item label {
        padding: 10px;
        font-size: 14px;
    }

    .image-preview {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
}
