/* 기본 설정 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    overflow-x: hidden;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 화면 전환 */
.screen {
    display: none;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
    animation: fadeInUp 0.6s ease;
}

.screen.active {
    display: block;
}

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

/* 헤더 스타일 */
.header {
    text-align: center;
    margin-bottom: 40px;
}

.header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #4c63d2;
    margin-bottom: 10px;
}

.header h1 i {
    margin-right: 15px;
    color: #667eea;
}

.subtitle {
    font-size: 1.2rem;
    color: #666;
    font-weight: 300;
}

/* 메인 화면 스타일 */
.intro-content {
    text-align: center;
}

.emoji {
    font-size: 4rem;
    margin-bottom: 20px;
    animation: bounce 2s infinite;
}

.intro-image {    margin-bottom: 25px;    text-align: center; }
.intro-image img {    max-width: 100%;    height: auto;   border-radius: 12px; display: block;margin: 0 auto; }

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

.intro-content h2 {
    font-size: 1.8rem;
    color: #333;
    margin-bottom: 20px;
    font-weight: 600;
}

.intro-content p {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 30px;
    line-height: 1.8;
}

.test-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 30px 0;
    padding: 20px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 15px;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
    color: #4c63d2;
}

.info-item i {
    font-size: 1.2rem;
    color: #667eea;
}

.start-btn {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 18px 40px;
    font-size: 1.2rem;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
    margin-top: 20px;
}

.start-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.4);
}

.start-btn i {
    margin-right: 10px;
}

/* 진행률 바 */
.progress-container {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 30px;
    padding: 20px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 15px;
}

.progress-bar {
    flex: 1;
    height: 8px;
    background: #e0e6ed;
    border-radius: 10px;
    overflow: hidden;
}

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

.progress-text {
    font-weight: 600;
    color: #4c63d2;
    min-width: 50px;
    text-align: right;
}

/* 질문 컨테이너 */
.question-container {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.question-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 10px;
}

.question-text {
    font-size: 1.6rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 30px;
    text-align: center;
}

.scenario-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 40px;
}

.scenario {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 15px;
    border-left: 4px solid #667eea;
}

.scenario h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #4c63d2;
    margin-bottom: 15px;
}

.scenario p {
    font-size: 1rem;
    color: #555;
    margin-bottom: 20px;
    line-height: 1.6;
}

.options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.option-btn {
    background: white;
    border: 2px solid #e0e6ed;
    padding: 12px 15px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.95rem;
    font-weight: 500;
    text-align: left;
}

.option-btn:hover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.05);
}

.option-btn.selected {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    border-color: #667eea;
    transform: scale(1.02);
}

.next-btn {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 0 auto;
    display: block;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

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

.next-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.next-btn i {
    margin-left: 8px;
}

/* 결과 화면 */
.result-container {
    text-align: center;
}

.result-header {
    margin-bottom: 40px;
}

.result-emoji {
    font-size: 5rem;
    margin-bottom: 20px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

.result-title {
    font-size: 2.2rem;
    font-weight: 700;
    color: #4c63d2;
    margin-bottom: 15px;
}

.result-score {
    font-size: 1.4rem;
    font-weight: 600;
    color: #667eea;
    margin-bottom: 20px;
}

.result-description {
    font-size: 1.1rem;
    color: #555;
    line-height: 1.8;
    margin-bottom: 40px;
    padding: 20px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 15px;
}

.result-details {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 15px;
    margin-bottom: 30px;
    text-align: left;
}

.result-details h3 {
    font-size: 1.3rem;
    font-weight: 600;
    color: #4c63d2;
    margin-bottom: 20px;
    text-align: center;
}

.result-details h3 i {
    margin-right: 10px;
}

.detail-item {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.detail-item span:first-child {
    font-weight: 500;
    color: #555;
    min-width: 120px;
}

.detail-item span:last-child {
    font-weight: 600;
    color: #4c63d2;
    min-width: 40px;
}

.bar {
    flex: 1;
    height: 20px;
    background: #e0e6ed;
    border-radius: 10px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    background: #48dbfb;
    border-radius: 10px;
    transition: width 1s ease, background-color 0.5s ease;
    width: 0%;
}

.action-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.retry-btn, .share-btn {
    background: white;
    color: #4c63d2;
    border: 2px solid #667eea;
    padding: 12px 25px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

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

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

    .screen {
        padding: 25px;
        border-radius: 15px;
    }

    .header h1 {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .emoji {
        font-size: 3rem;
    }

    .intro-content h2 {
        font-size: 1.5rem;
    }

    .intro-content p {
        font-size: 1rem;
    }

    .test-info {
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 15px;
    }

    .start-btn {
        padding: 15px 30px;
        font-size: 1.1rem;
    }

    .scenario-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .scenario {
        padding: 20px;
    }

    .question-text {
        font-size: 1.3rem;
    }

    .result-emoji {
        font-size: 4rem;
    }

    .result-title {
        font-size: 1.8rem;
    }

    .result-score {
        font-size: 1.2rem;
    }

    .result-description {
        font-size: 1rem;
        padding: 15px;
    }

    .detail-item {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .detail-item span:first-child {
        min-width: auto;
    }

    .action-buttons {
        flex-direction: column;
        align-items: center;
    }

    .retry-btn, .share-btn {
        width: 200px;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.7rem;
    }

    .header h1 i {
        margin-right: 8px;
    }

    .screen {
        padding: 20px;
    }

    .question-text {
        font-size: 1.2rem;
    }

    .result-title {
        font-size: 1.6rem;
    }
}

/* 다크모드 지원 (선택사항) */
@media (prefers-color-scheme: dark) {
    body {
        background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    }
    
    .screen {
        background: rgba(45, 52, 54, 0.95);
        color: #ecf0f1;
    }
    
    .header h1, .question-text, .result-title {
        color: #74b9ff;
    }
    
    .subtitle, .intro-content p, .result-description {
        color: #b2bec3;
    }
    
    .scenario {
        background: rgba(45, 52, 54, 0.8);
        border-left-color: #74b9ff;
    }
    
    .scenario p {
        color: #ddd;
    }
    
    .option-btn {
        background: rgba(45, 52, 54, 0.9);
        border-color: #636e72;
        color: #ddd;
    }
    
    .option-btn:hover {
        border-color: #74b9ff;
        background: rgba(116, 185, 255, 0.1);
    }
}

/* 접근성 향상 */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Modal Styles */
.modal-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-container.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 20px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.modal-container.active .modal-content {
    transform: translateY(0);
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 2rem;
    cursor: pointer;
    color: #888;
    transition: color 0.2s ease;
}

.modal-close:hover {
    color: #333;
}

.modal-content h2 {
    font-size: 1.8rem;
    color: #4c63d2;
    margin-bottom: 25px;
    text-align: center;
}

.modal-content h2 i {
    margin-right: 10px;
}

.type-item {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 20px;
    border-left: 5px solid #667eea;
}

.type-item:last-child {
    margin-bottom: 0;
}

.type-item h3 {
    font-size: 1.4rem;
    color: #333;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
}

.type-item h3 .emoji {
    font-size: 2rem;
    margin-right: 10px;
    animation: none; /* Disable bounce for modal emojis */
}

.type-item p {
    font-size: 1rem;
    color: #555;
    line-height: 1.6;
}

/* Dark mode for modal */
@media (prefers-color-scheme: dark) {
    .modal-content {
        background: #2d3436;
        color: #ecf0f1;
    }

    .modal-close {
        color: #b2bec3;
    }

    .modal-close:hover {
        color: #ecf0f1;
    }

    .modal-content h2 {
        color: #74b9ff;
    }

    .type-item {
        background: rgba(45, 52, 54, 0.8);
        border-left-color: #74b9ff;
    }

    .type-item h3 {
        color: #ecf0f1;
    }

    .type-item p {
        color: #ddd;
    }
}

@media (max-width: 768px) {
    .modal-content {
        padding: 20px;
    }

    .modal-content h2 {
        font-size: 1.5rem;
    }

    .type-item h3 {
        font-size: 1.2rem;
    }

    .type-item h3 .emoji {
        font-size: 1.8rem;
    }

    .type-item p {
        font-size: 0.9rem;
    }
}
