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

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

.container {
    max-width: 900px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

/* 헤더 스타일 */
header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px 30px;
    text-align: center;
}

header h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 10px;
}

.header-subtitle {
    font-size: 16px;
    font-weight: 400;
    opacity: 0.95;
}

/* 소개 박스 */
.intro-box {
    background: #f8f9fa;
    border-left: 4px solid #667eea;
    padding: 25px;
    margin: 30px;
    border-radius: 10px;
    line-height: 1.8;
}

.intro-box p {
    margin-bottom: 12px;
    color: #333;
}

.intro-box p:last-child {
    margin-bottom: 0;
}

/* 설문 섹션 */
.survey-section {
    padding: 30px;
    border-bottom: 1px solid #e9ecef;
}

.survey-section:last-of-type {
    border-bottom: none;
}

.survey-section h2 {
    color: #667eea;
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 25px;
    padding-bottom: 10px;
    border-bottom: 2px solid #667eea;
}

/* 질문 스타일 */
.question {
    margin-bottom: 30px;
}

.question-label {
    display: block;
    font-size: 16px;
    font-weight: 500;
    color: #333;
    margin-bottom: 15px;
    line-height: 1.6;
}

.required {
    color: #e74c3c;
    font-weight: 700;
}

.help-text {
    font-size: 14px;
    color: #6c757d;
    margin-bottom: 12px;
    font-style: italic;
}

/* 라디오 버튼 그룹 */
.radio-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.radio-label {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.radio-label:hover {
    background: #e9ecef;
    border-color: #667eea;
}

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

.radio-label input[type="radio"]:checked + span {
    font-weight: 600;
    color: #667eea;
}

.radio-label:has(input:checked) {
    background: #e7eaff;
    border-color: #667eea;
}

/* 입력 필드 */
.input-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.input-group input[type="number"],
.conditional-input input[type="text"] {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 16px;
    font-family: 'Noto Sans KR', sans-serif;
    transition: border-color 0.3s ease;
}

.input-group input[type="number"]:focus,
.conditional-input input[type="text"]:focus {
    outline: none;
    border-color: #667eea;
}

.input-suffix {
    font-weight: 500;
    color: #6c757d;
}

/* 조건부 입력 */
.conditional-input {
    margin-top: 15px;
    padding-left: 20px;
}

/* 조건부 질문 */
.conditional-question {
    margin-left: 30px;
    padding-left: 20px;
    border-left: 3px solid #667eea;
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-top: 15px;
}

/* Textarea 그룹 */
.textarea-group {
    margin-top: 10px;
}

.textarea-group textarea {
    width: 100%;
    padding: 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 16px;
    font-family: 'Noto Sans KR', sans-serif;
    resize: vertical;
    transition: border-color 0.3s ease;
    line-height: 1.6;
}

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

.textarea-group textarea::placeholder {
    color: #adb5bd;
}

/* 감사 메시지 */
.thank-you-message {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
    padding: 25px;
    margin: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.thank-you-message p {
    font-size: 18px;
    margin: 0;
}

.thank-you-message strong {
    font-weight: 700;
}

/* 질문 그룹 헤더 */
.question-group-header {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 5px;
    font-size: 15px;
}

/* 제출 섹션 */
.submit-section {
    padding: 30px;
    display: flex;
    gap: 15px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.submit-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 18px;
    font-weight: 600;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    font-family: 'Noto Sans KR', sans-serif;
}

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

.submit-btn:active {
    transform: translateY(0);
}

.stats-link {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    padding: 15px 30px;
    border: 2px solid #667eea;
    border-radius: 10px;
    transition: all 0.3s ease;
    display: inline-block;
}

.stats-link:hover {
    background: #667eea;
    color: white;
}

/* 성공 메시지 */
.success-message {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.success-content {
    background: white;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    max-width: 500px;
    animation: slideIn 0.4s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.success-content h3 {
    color: #333;
    font-size: 24px;
    margin-bottom: 10px;
}

.success-content p {
    color: #6c757d;
    margin-bottom: 25px;
}

.success-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

/* 버튼 스타일 */
.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 25px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s ease;
    text-decoration: none;
    display: inline-block;
    font-family: 'Noto Sans KR', sans-serif;
}

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

.btn-secondary {
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
    padding: 12px 25px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
    font-family: 'Noto Sans KR', sans-serif;
}

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

/* 통계 페이지 스타일 */
.stats-nav {
    padding: 20px 30px;
    display: flex;
    gap: 10px;
    justify-content: center;
    border-bottom: 1px solid #e9ecef;
}

/* QR코드 섹션 */
.qr-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 30px;
    margin: 0;
}

.qr-container {
    max-width: 1000px;
    margin: 0 auto;
    background: white;
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.qr-container h2 {
    color: #667eea;
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 10px;
    text-align: center;
}

.qr-description {
    text-align: center;
    color: #6c757d;
    margin-bottom: 30px;
    font-size: 16px;
}

.qr-display {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 40px;
    align-items: start;
}

.qr-code-box {
    background: white;
    padding: 20px;
    border-radius: 12px;
    border: 3px solid #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.qr-code-box #qrcode {
    display: flex;
    align-items: center;
    justify-content: center;
}

.qr-code-box canvas,
.qr-code-box img {
    display: block;
    max-width: 300px;
    max-height: 300px;
}

.qr-info {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.qr-url-box {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    border: 2px solid #e9ecef;
}

.qr-url-box label {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
    font-size: 14px;
}

.qr-url-box input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Courier New', monospace;
    color: #667eea;
    background: white;
    margin-bottom: 10px;
}

.qr-url-box input:focus {
    outline: none;
    border-color: #667eea;
}

.btn-copy {
    background: #667eea;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease;
    font-family: 'Noto Sans KR', sans-serif;
}

.btn-copy:hover {
    background: #5568d3;
    transform: translateY(-2px);
}

.qr-actions {
    display: flex;
    gap: 10px;
}

.btn-download,
.btn-print {
    flex: 1;
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
    padding: 15px 20px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.2s ease;
    font-family: 'Noto Sans KR', sans-serif;
}

.btn-download:hover,
.btn-print:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.qr-tips {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 20px;
    border-radius: 8px;
}

.qr-tips strong {
    display: block;
    color: #856404;
    margin-bottom: 10px;
    font-size: 15px;
}

.qr-tips ul {
    margin: 0;
    padding-left: 20px;
    color: #856404;
}

.qr-tips li {
    margin-bottom: 8px;
    line-height: 1.6;
}

.stats-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.stat-value {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 8px;
}

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

.stats-section {
    padding: 30px;
}

.stats-section h2 {
    color: #667eea;
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 25px;
    padding-bottom: 10px;
    border-bottom: 2px solid #667eea;
}

.chart-container {
    margin-bottom: 40px;
}

.chart-container h3 {
    color: #333;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
}

.chart-wrapper {
    position: relative;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
}

/* 테이블 스타일 */
.table-controls {
    margin-bottom: 15px;
    display: flex;
    justify-content: flex-end;
}

.table-container {
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid #e9ecef;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

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

th, td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}

th {
    font-weight: 600;
    font-size: 14px;
}

td {
    font-size: 14px;
    color: #333;
}

tbody tr:hover {
    background: #f8f9fa;
}

tbody tr:last-child td {
    border-bottom: none;
}

/* 로딩 메시지 */
.loading-message {
    padding: 60px 30px;
    text-align: center;
}

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

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

.loading-message p {
    color: #6c757d;
    font-size: 16px;
}

/* 데이터 없음 메시지 */
.no-data-message {
    padding: 80px 30px;
    text-align: center;
}

.no-data-content {
    max-width: 400px;
    margin: 0 auto;
}

.no-data-icon {
    font-size: 80px;
    margin-bottom: 20px;
}

.no-data-content h3 {
    color: #333;
    font-size: 24px;
    margin-bottom: 10px;
}

.no-data-content p {
    color: #6c757d;
    margin-bottom: 25px;
}

/* 개선 사항 섹션 */
.improvement-stats {
    padding: 20px;
}

.improvement-count {
    text-align: center;
    margin-bottom: 30px;
    padding: 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px;
}

.count-value {
    font-size: 48px;
    font-weight: 700;
    margin-bottom: 10px;
}

.count-label {
    font-size: 16px;
    opacity: 0.95;
}

.improvement-list {
    max-height: 600px;
    overflow-y: auto;
}

.improvement-item {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    transition: all 0.3s ease;
}

.improvement-item:hover {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.improvement-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e9ecef;
}

.improvement-number {
    font-weight: 600;
    color: #667eea;
    font-size: 14px;
}

.improvement-date {
    color: #6c757d;
    font-size: 13px;
}

.improvement-text {
    color: #333;
    line-height: 1.6;
    font-size: 15px;
}

.no-improvements {
    text-align: center;
    color: #6c757d;
    padding: 40px;
    font-style: italic;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    header h1 {
        font-size: 22px;
    }

    .header-subtitle {
        font-size: 14px;
    }

    .survey-section {
        padding: 20px;
    }

    .intro-box {
        margin: 20px;
        padding: 20px;
    }

    .question-label {
        font-size: 15px;
    }

    .radio-label {
        padding: 10px;
    }

    .submit-section {
        padding: 20px;
        flex-direction: column;
    }

    .submit-btn,
    .stats-link {
        width: 100%;
        text-align: center;
    }

    .stats-summary {
        grid-template-columns: 1fr;
    }

    .stat-value {
        font-size: 28px;
    }

    .success-content {
        padding: 30px 20px;
    }

    .success-icon {
        width: 60px;
        height: 60px;
        font-size: 40px;
    }

    .success-actions {
        flex-direction: column;
        width: 100%;
    }

    .btn-primary,
    .btn-secondary {
        width: 100%;
    }

    table {
        font-size: 12px;
    }

    th, td {
        padding: 8px 6px;
    }

    .thank-you-message {
        margin: 20px;
        padding: 20px;
    }

    .thank-you-message p {
        font-size: 16px;
    }

    .qr-display {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .qr-code-box {
        margin: 0 auto;
    }

    .qr-actions {
        flex-direction: column;
    }

    .btn-download,
    .btn-print {
        width: 100%;
    }
}

@media (max-width: 480px) {
    header {
        padding: 30px 20px;
    }

    header h1 {
        font-size: 20px;
    }

    .survey-section h2 {
        font-size: 18px;
    }

    .chart-wrapper {
        padding: 10px;
    }
}
