/* MBTI 테스트 스타일시트 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    height: 100%;
    margin: 0;
    padding: 0;
    width: 100%;
    overflow-x: hidden;
}

body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
}

.main-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
}

.card {
    border: none;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
    background: rgba(255,255,255,0.95);
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
}

.btn-primary {
    background: linear-gradient(45deg, #667eea, #764ba2);
    border: none;
    border-radius: 50px;
    padding: 15px 40px;
    font-weight: 600;
    transition: all 0.3s ease;
}

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

.btn-answer {
    background: #5f72c9;
    border: none;
    border-radius: 15px;
    padding: 15px 20px;
    margin: 8px 0;
    color: white;
    font-weight: 500;
    transition: all 0.3s ease;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    word-wrap: break-word;
    white-space: normal;
    line-height: 1.4;
}

.btn-answer:hover {
    transform: translateY(-2px);
    background: #3f4e91;
    color: white !important;
}

.progress {
    height: 10px;
    border-radius: 10px;
    background: rgba(102, 126, 234, 0.2);
}

.progress-bar {
    background: linear-gradient(45deg, #667eea, #764ba2);
    border-radius: 10px;
    transition: width 0.3s ease;
}

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

.question-text {
    font-size: 1.3rem;
    color: #333;
    margin-bottom: 30px;
    line-height: 1.6;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(102, 126, 234, 0.2);
    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); }
}

.result-type {
    font-size: 4rem;
    font-weight: bold;
    color: #667eea;
    margin: 20px 0;
}

.result-description {
    background: rgba(102, 126, 234, 0.1);
    border-radius: 15px;
    padding: 30px;
    margin: 20px 0;
}

.trait-list {
    list-style: none;
    padding: 0;
}

.trait-list li {
    padding: 8px 0;
    border-bottom: 1px solid rgba(102, 126, 234, 0.1);
}

.trait-list li:before {
    content: "✓";
    color: #667eea;
    font-weight: bold;
    margin-right: 10px;
}

.hidden {
    display: none !important;
}

.fade-in {
    animation: fadeIn 0.5s ease-in;
}

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

.hashtags {
    color: #667eea;
    font-size: 1.1rem;
    margin: 20px 0;
}

.back-btn {
    background: rgba(102, 126, 234, 0.1);
    border: 2px solid #667eea;
    color: #667eea;
    border-radius: 50px;
    padding: 10px 20px;
    transition: all 0.3s ease;
}

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

/* 문항 선택 카드 스타일 */
.question-type-card .card:hover {
    border-color: #667eea !important;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
    transform: translateY(-2px);
}

.question-type-card .card.selected {
    border-color: #667eea !important;
    background: rgba(102, 126, 234, 0.05);
}

/* 결과 화면 개선 */
.result-subtitle {
    font-size: 1.5rem;
    color: #888;
    font-weight: 500;
    margin-top: 10px;
}

.summary-card {
    border-left: 4px solid #667eea;
}

.detailed-card {
    border: 1px solid rgba(102, 126, 234, 0.1);
}

.trait-list {
    list-style: none;
    padding: 0;
}

.trait-list li {
    padding: 5px 0;
    border-bottom: 1px solid rgba(102, 126, 234, 0.1);
    font-size: 0.9rem;
}

.trait-list li:before {
    content: "✓";
    color: #667eea;
    font-weight: bold;
    margin-right: 8px;
}

.trait-list li:last-child {
    border-bottom: none;
}

/* Footer 스타일 */
.footer {
    background: linear-gradient(135deg, #4a3c8a 0%, #3d2a6b 100%);
    border: none;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    width: 100%;
    flex-shrink: 0;
    padding: 1.5rem 0;
    margin-top: auto;
    position: relative;
    z-index: 1;
}

/* 애드센스 광고 관련 여백 제거 */
.adsbygoogle {
    margin: 0 !important;
    padding: 0 !important;
}

/* 자동 삽입된 애드센스 광고 스타일 */
.google-auto-placed {
    margin: 0 !important;
    padding: 0 !important;
}

/* footer 바로 위 애드센스 광고 여백 제거 */
.footer + .adsbygoogle,
.footer + .google-auto-placed,
.footer + [id*="google_ads"] {
    margin: 0 !important;
    padding: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
}

.footer-content h6 {
    color: #ffffff;
    font-weight: 600;
    margin-bottom: 1rem;
}

.footer-links a {
    color: #e0e0e0;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: #ffffff;
}

.copyright p {
    color: #c0c0c0;
    font-size: 0.8rem;
    line-height: 1.4;
}

/* Footer 링크 호버 효과 */
.footer-links a {
    position: relative;
}

.footer-links a:hover::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 1px;
    background: #ffffff;
}

/* 결과 화면 개선된 카드 스타일 */
.description-card {
    background: #ffffff;
    border-radius: 15px;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.1);
    border-left: 4px solid #667eea;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.description-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.15);
}

.section-card {
    background: #ffffff;
    border-radius: 15px;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid rgba(102, 126, 234, 0.1);
}

.section-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.15);
}

.section-card h6 {
    color: #667eea;
    font-weight: 600;
    margin-bottom: 1rem;
}

.section-card .trait-list {
    margin: 0;
}

.section-card .trait-list li {
    padding: 6px 0;
    border-bottom: 1px solid rgba(102, 126, 234, 0.1);
    font-size: 0.9rem;
    color: #555;
}

.section-card .trait-list li:last-child {
    border-bottom: none;
}

.section-card p {
    color: #555;
    line-height: 1.6;
}

/* 로고 스타일 */
.logo-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(102, 126, 234, 0.1);
}

.logo-wrapper {
    display: inline-block;
    transition: transform 0.3s ease;
}

.logo-wrapper:hover {
    transform: scale(1.05);
}

.logo-text {
    font-size: 1.5rem;
    letter-spacing: 1px;
}

/* 처음으로 버튼 스타일 */
.btn-outline-light {
    transition: all 0.3s ease;
}

.btn-outline-light:hover {
    background: #667eea !important;
    color: white !important;
    border-color: #667eea !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* 선호도 강도 분석 스타일 */
.preference-analysis {
    background: #ffffff;
    border-radius: 15px;
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.1);
    border-left: 4px solid #ff6b6b;
    padding: 1rem;
}

.preference-item {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    font-size: 0.9rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.preference-label {
    font-weight: 600;
    color: #333;
    margin-right: 8px;
    min-width: 140px;
    flex-shrink: 0;
}

.preference-result {
    color: #667eea;
    font-weight: 500;
    margin-right: 8px;
    flex-shrink: 0;
}

.preference-strength.badge {
    font-size: 0.75rem;
    padding: 4px 8px;
    flex-shrink: 0;
}

.bg-danger {
    background-color: #dc3545 !important;
}

.bg-warning {
    background-color: #ffc107 !important;
    color: #000 !important;
}

.bg-success {
    background-color: #198754 !important;
}

/* 방문자 카운터 스타일 */
.visitor-counter {
    border-top: 1px solid rgba(255,255,255,0.2);
}

.counter-item {
    padding: 10px;
    transition: transform 0.3s ease;
}

.counter-item:hover {
    transform: scale(1.05);
}

.counter-number {
    color: #ffffff;
    font-size: 1.2rem;
    font-weight: bold;
    text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.counter-label {
    color: #c0c0c0;
    font-size: 0.8rem;
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ========================================
   모바일 반응형 스타일
   ======================================== */

/* 모바일 화면 (768px 이하) */
@media (max-width: 768px) {
    .main-container {
        padding: 0.75rem;
    }
    
    .card {
        margin: 0.75rem 0.5rem;
        border-radius: 15px;
        padding: 1rem 0.75rem;
    }
    
    .btn-answer {
        padding: 12px 16px;
        margin: 6px 0;
        font-size: 0.9rem;
    }
    
    .btn-primary {
        padding: 12px 24px;
        font-size: 0.9rem;
    }
    
    .logo-text {
        font-size: 1.2rem;
    }
    
    .footer {
        padding: 1rem 0.75rem;
    }
    
    .footer-content h6 {
        font-size: 1rem;
    }
    
    .footer-links {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .footer-links a {
        margin: 0;
    }
    
    /* 결과 페이지 특별 최적화 */
    .result-container {
        padding: 0.75rem;
    }
    
    .result-container .card {
        margin: 0.75rem 0.5rem;
        padding: 1rem 0.75rem;
    }
    
    /* 선호도 강도 분석 카드 최적화 */
    .preference-analysis {
        padding: 1rem 0.75rem !important;
    }
    
    .preference-item {
        flex-wrap: wrap;
        gap: 0.25rem;
    }
    
    .preference-label {
        min-width: 120px !important;
        font-size: 0.85rem;
    }
    
    .preference-result {
        font-size: 0.8rem;
    }
    
    .preference-strength.badge {
        font-size: 0.7rem !important;
        padding: 3px 6px !important;
    }
}

/* 작은 모바일 화면 (480px 이하) */
@media (max-width: 480px) {
    .main-container {
        padding: 0.5rem;
    }
    
    .card {
        margin: 0.5rem 0.25rem;
        border-radius: 12px;
        padding: 0.75rem 0.5rem;
    }
    
    .btn-answer {
        padding: 10px 12px;
        margin: 4px 0;
        font-size: 0.85rem;
        line-height: 1.3;
    }
    
    .btn-primary {
        padding: 10px 20px;
        font-size: 0.85rem;
    }
    
    .logo-text {
        font-size: 1rem;
    }
    
    .footer {
        padding: 0.75rem 0.5rem;
    }
    
    .footer-content h6 {
        font-size: 0.9rem;
    }
    
    .footer-links a {
        font-size: 0.8rem;
    }
    
    .copyright p {
        font-size: 0.7rem;
    }
    
    .counter-number {
        font-size: 1rem;
    }
    
    .counter-label {
        font-size: 0.7rem;
    }
    
    /* 결과 페이지 특별 최적화 */
    .result-container {
        padding: 0.5rem;
    }
    
    .result-container .card {
        margin: 0.5rem 0.25rem;
        padding: 0.75rem 0.5rem;
    }
    
    /* 선호도 강도 분석 카드 최적화 */
    .preference-analysis {
        padding: 0.75rem 0.5rem !important;
    }
    
    .preference-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
    
    .preference-label {
        min-width: auto !important;
        font-size: 0.8rem;
        width: 100%;
    }
    
    .preference-result {
        font-size: 0.75rem;
        margin-left: 0;
    }
    
    .preference-strength.badge {
        font-size: 0.65rem !important;
        padding: 2px 5px !important;
        margin-left: 0;
        margin-top: 0.25rem;
    }
}

/* 매우 작은 화면 (360px 이하) */
@media (max-width: 360px) {
    .main-container {
        padding: 0.25rem;
    }
    
    .card {
        margin: 0.25rem 0.1rem;
        border-radius: 10px;
        padding: 0.5rem 0.4rem;
    }
    
    .btn-answer {
        padding: 8px 10px;
        margin: 3px 0;
        font-size: 0.8rem;
    }
    
    .btn-primary {
        padding: 8px 16px;
        font-size: 0.8rem;
    }
    
    .logo-text {
        font-size: 0.9rem;
    }
    
    .footer {
        padding: 0.5rem 0.25rem;
    }
    
    .footer-content h6 {
        font-size: 0.85rem;
    }
    
    .footer-links a {
        font-size: 0.75rem;
    }
    
    .copyright p {
        font-size: 0.65rem;
    }
    
    /* 결과 페이지 특별 최적화 */
    .result-container {
        padding: 0.25rem;
    }
    
    .result-container .card {
        margin: 0.25rem 0.1rem;
        padding: 0.5rem 0.4rem;
    }
    
    /* 선호도 강도 분석 카드 최적화 */
    .preference-analysis {
        padding: 0.5rem 0.4rem !important;
    }
    
    .preference-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.2rem;
    }
    
    .preference-label {
        min-width: auto !important;
        font-size: 0.75rem;
        width: 100%;
        line-height: 1.2;
    }
    
    .preference-result {
        font-size: 0.7rem;
        margin-left: 0;
    }
    
    .preference-strength.badge {
        font-size: 0.6rem !important;
        padding: 2px 4px !important;
        margin-left: 0;
        margin-top: 0.2rem;
    }
}

/* 가로 모드 모바일 */
@media (max-width: 768px) and (orientation: landscape) {
    .main-container {
        padding: 0.5rem;
    }
    
    .card {
        margin: 0.5rem;
    }
    
    .btn-answer {
        padding: 10px 15px;
        margin: 4px 0;
    }
    
    .footer {
        padding: 0.75rem 0;
    }
}

/* 고해상도 모바일 (Retina 등) */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .card {
        box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    }
    
    .btn-primary {
        box-shadow: 0 5px 10px rgba(102, 126, 234, 0.3);
    }
}

/* 모바일 최적화 클래스 */
.mobile-optimized {
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

.mobile-optimized .card {
    margin: 0.5rem;
    border-radius: 15px;
}

.mobile-optimized .btn-answer {
    min-height: 44px;
    padding: 12px 16px;
    font-size: 0.9rem;
    line-height: 1.4;
}

.mobile-optimized .btn-primary {
    min-height: 44px;
    padding: 12px 24px;
}

/* 터치 최적화 */
@media (hover: none) and (pointer: coarse) {
    .btn-answer:hover,
    .btn-primary:hover {
        transform: none;
    }
    
    .btn-answer:active,
    .btn-primary:active {
        transform: scale(0.98);
        transition: transform 0.1s ease;
    }
}

/* iOS Safari 최적화 */
@supports (-webkit-touch-callout: none) {
    body {
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        -webkit-tap-highlight-color: transparent;
    }
    
    .btn-answer,
    .btn-primary {
        -webkit-tap-highlight-color: rgba(0,0,0,0.1);
    }
}

/* Android Chrome 최적화 */
@media screen and (-webkit-min-device-pixel-ratio: 0) {
    .main-container {
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
    }
}
