/* app/fun/static/css/badge.css */

/* 배경은 main-content에만 적용 (사이드바 제외) */
.badge-page .main-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: calc(100vh - 150px);
    border-radius: 8px;
    padding: 2rem;
    width: 100%;
    box-sizing: border-box;
    max-width: 100%;
    overflow-x: hidden;
}

.badge-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 1rem;
    width: 100%;
    box-sizing: border-box;
}

.badge-header {
    text-align: center;
    color: #fff;
    margin-bottom: 1.5rem;
}

.badge-header h1 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    font-weight: 400;
}

.badge-header p {
    font-size: 0.875rem;
    opacity: 0.9;
}

/* 입력 화면 */
.name-input-section {
    background: #fff;
    border-radius: 20px;
    padding: 3rem 2rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    text-align: center;
    width: 100%;
    box-sizing: border-box;
    max-width: 100%;
}

.name-input-section h2 {
    font-size: 1.8rem;
    color: #333;
    margin-bottom: 1.5rem;
}

.name-input-wrapper {
    max-width: 400px;
    margin: 0 auto 2rem;
    width: 100%;
    box-sizing: border-box;
    padding: 0;
    min-width: 0;
}

.name-input {
    width: 100%;
    padding: 1rem 1.5rem;
    font-size: 1.2rem;
    border: 3px solid #e2e8f0;
    border-radius: 15px;
    outline: none;
    transition: all 0.3s;
    box-sizing: border-box;
    max-width: 100%;
    min-width: 0;
}

.name-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.start-btn {
    padding: 1rem 3rem;
    font-size: 1.3rem;
    color: #fff;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 15px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    transition: transform 0.2s, box-shadow 0.2s;
}

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

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

.start-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 테스트 진행 화면 */
.test-section {
    background: #fff;
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    display: none;
    width: 100%;
    box-sizing: border-box;
    max-width: 100%;
}

.test-section.active {
    display: block;
}

.progress-bar-wrapper {
    margin-bottom: 2rem;
}

.progress-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 1rem;
    color: #64748b;
}

.progress-bar {
    width: 100%;
    height: 12px;
    background: #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
}

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

.question-card {
    text-align: center;
    margin-bottom: 2.5rem;
}

.question-text {
    font-size: 1.8rem;
    color: #1e293b;
    margin-bottom: 2rem;
    line-height: 1.6;
}

.answers-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    max-width: 700px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
}

.answer-btn {
    padding: 1.5rem 1rem;
    font-size: 1.1rem;
    color: #1e293b;
    background: #f8fafc;
    border: 3px solid #e2e8f0;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s;
    word-break: keep-all;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.answer-btn:hover {
    background: #f1f5f9;
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

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

/* answers-grid 반응형은 아래 더 상세한 미디어 쿼리에서 처리 */

/* 결과 화면 */
.result-section {
    background: #fff;
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    display: none;
    text-align: center;
    width: 100%;
    box-sizing: border-box;
    max-width: 100%;
}

.result-section.active {
    display: block;
}

.result-title {
    font-size: 2rem;
    color: #1e293b;
    margin-bottom: 2rem;
}

.badge-card {
    max-width: 400px;
    margin: 0 auto 2rem;
    min-height: 250px;
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: visible;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
}

.badge-emoji {
    font-size: 6rem;
    margin-bottom: 1rem;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

.badge-title {
    font-size: 2rem;
    color: #fff;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.badge-desc {
    font-size: 1.1rem;
    color: #fff;
    margin-bottom: 1.5rem;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
    line-height: 1.6;
    word-wrap: break-word;
    word-break: keep-all;
    overflow: visible;
    white-space: normal;
    text-align: center;
    flex: 0 0 auto;
}

.badge-issuer {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.3);
    width: 100%;
    word-wrap: break-word;
    word-break: keep-all;
    overflow: visible;
    white-space: normal;
    text-align: center;
    flex: 0 0 auto;
}

.action-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.action-btn {
    padding: 1rem 2rem;
    font-size: 1.1rem;
    color: #fff;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 15px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.action-btn.secondary {
    background: #64748b;
    box-shadow: 0 4px 15px rgba(100, 116, 139, 0.4);
}

.action-btn.secondary:hover {
    box-shadow: 0 6px 20px rgba(100, 116, 139, 0.6);
}

@media (max-width: 1024px) {
    .badge-page .main-content {
        padding: 1.5rem;
    }
    
    .badge-container {
        padding: 1.5rem 1rem;
    }
    
    .name-input-section {
        padding: 2rem 1.5rem;
    }
    
    .name-input-wrapper {
        max-width: 100%;
        padding: 0 0.5rem;
    }
    
    .test-section {
        padding: 2rem 1.5rem;
    }
    
    .result-section {
        padding: 2rem 1.5rem;
    }
}

@media (max-width: 768px) {
    .answers-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .badge-page .main-content {
        padding: 1rem;
    }
    
    .badge-container {
        padding: 1rem 0.75rem;
    }
    
    .badge-header h1 {
        font-size: 1.3rem;
    }
    
    .badge-header p {
        font-size: 0.8125rem;
    }
    
    .name-input-section {
        padding: 1.5rem 1rem;
        border-radius: 15px;
    }
    
    .name-input-section h2 {
        font-size: 1.5rem;
        margin-bottom: 1rem;
    }
    
    .name-input-wrapper {
        margin-bottom: 1.5rem;
        max-width: 100%;
        padding: 0 0.5rem;
    }
    
    .name-input {
        padding: 0.875rem 1.25rem;
        font-size: 1.1rem;
        max-width: 100%;
    }
    
    .start-btn {
        padding: 0.875rem 2rem;
        font-size: 1.1rem;
    }
    
    .test-section {
        padding: 1.5rem 1rem;
        border-radius: 15px;
    }
    
    .question-text {
        font-size: 1.4rem;
        margin-bottom: 1.5rem;
    }
    
    .result-section {
        padding: 1.5rem 1rem;
        border-radius: 15px;
    }
    
    .result-title {
        font-size: 1.6rem;
        margin-bottom: 1.5rem;
    }
    
    .badge-card {
        padding: 1.5rem 1rem;
        border-radius: 15px;
        max-width: 100%;
    }
    
    .badge-emoji {
        font-size: 4rem;
        margin-bottom: 0.75rem;
    }
    
    .badge-title {
        font-size: 1.5rem;
        margin-bottom: 0.75rem;
    }
    
    .badge-desc {
        font-size: 1rem;
        margin-bottom: 1rem;
    }
    
    .badge-issuer {
        font-size: 0.8125rem;
        padding-top: 0.75rem;
    }
    
    .action-buttons {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .action-btn {
        width: 100%;
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
    }
}

@media (max-width: 640px) {
    .badge-page .main-content {
        padding: 0.75rem;
        border-radius: 4px;
    }
    
    .badge-container {
        padding: 0.75rem 0.5rem;
    }
    
    .badge-header h1 {
        font-size: 1.2rem;
        margin-bottom: 0.375rem;
    }
    
    .badge-header p {
        font-size: 0.75rem;
    }
    
    .name-input-section {
        padding: 1.25rem 0.75rem;
    }
    
    .name-input-section h2 {
        font-size: 1.3rem;
        margin-bottom: 1rem;
    }
    
    .name-input-wrapper {
        padding: 0 0.25rem;
        max-width: 100%;
    }
    
    .name-input {
        padding: 0.75rem 1rem;
        font-size: 1rem;
        max-width: 100%;
    }
    
    .start-btn {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
    }
    
    .test-section {
        padding: 1.25rem 0.75rem;
    }
    
    .question-text {
        font-size: 1.2rem;
        margin-bottom: 1.25rem;
    }
    
    .answers-grid {
        gap: 0.5rem;
    }
    
    .answer-btn {
        padding: 1rem 0.75rem;
        font-size: 0.9375rem;
        min-height: 60px;
    }
    
    .result-section {
        padding: 1.25rem 0.75rem;
    }
    
    .result-title {
        font-size: 1.4rem;
        margin-bottom: 1.25rem;
    }
    
    .badge-card {
        padding: 1.25rem 0.75rem;
        min-height: 200px;
    }
    
    .badge-emoji {
        font-size: 3.5rem;
    }
    
    .badge-title {
        font-size: 1.3rem;
    }
    
    .badge-desc {
        font-size: 0.9375rem;
    }
}

