:root {
    --primary-color: #6C5CE7;
    --primary-hover: #5A4FCF;
    --secondary-color: #00CEC9;
    --bg-color: #F8F9FA;
    --card-bg: #FFFFFF;
    --text-main: #2D3436;
    --text-muted: #636E72;
    --border-color: #DFE6E9;
    --shadow-sm: 0 4px 6px rgba(0,0,0,0.05);
    --shadow-md: 0 10px 15px rgba(0,0,0,0.1);
    --border-radius: 16px;
}

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

body {
    font-family: 'Pretendard', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

body.pdf-exporting {
    width: 794px !important;
    margin: 0 auto !important;
    background-color: white !important;
    display: flex;
    justify-content: center;
}

#pdfExportContainer {
    width: 794px;
    margin: 0 auto;
    background-color: white;
}

.app-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
}

.app-header {
    text-align: center;
    margin-bottom: 30px;
    padding-top: 20px;
}

.app-header h1 {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.app-header p {
    font-size: 1rem;
    color: var(--text-muted);
}

.section-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
    transition: all 0.3s ease;
}

/* Note: Do not use !important on ID display to avoid conflict with .hidden */
#loadingSection:not(.hidden), #premiumLoadingSection:not(.hidden) {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.hidden {
    display: none !important;
}

.intro-box {
    background: #F1F2F6;
    padding: 16px;
    border-radius: 12px;
    text-align: center;
    margin-bottom: 24px;
    font-weight: 500;
    color: var(--text-main);
}

.question-group {
    margin-bottom: 24px;
}

.question-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 10px;
    font-size: 1.05rem;
}

.question-group select {
    width: 100%;
    padding: 14px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    color: var(--text-main);
    background-color: #fff;
    cursor: pointer;
    transition: border-color 0.2s;
}

.question-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.2);
}

.primary-btn, .secondary-btn {
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s, background-color 0.2s;
    font-family: inherit;
}

.primary-btn {
    background-color: var(--primary-color);
    color: white;
    margin-top: 10px;
}

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

.secondary-btn {
    background-color: #F1F2F6;
    color: var(--text-main);
    margin-bottom: 12px;
}

.secondary-btn:hover {
    background-color: #E2E6EA;
}

.pulse-anim {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(108, 92, 231, 0.4); }
    70% { box-shadow: 0 0 0 15px rgba(108, 92, 231, 0); }
    100% { box-shadow: 0 0 0 0 rgba(108, 92, 231, 0); }
}

/* Loading */
.loading-content {
    margin: 30px 0;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #F1F2F6;
    border-top: 5px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

.ad-container {
    width: 100%;
    clear: both;
    text-align: center;
    margin-top: 10px;
}

/* Result Section */
.result-capture-area {
    padding: 10px;
    background: white;
    border-radius: 12px;
}

.pdf-mode .result-capture-area {
    box-shadow: none;
    border: none;
    padding: 0;
}

.pdf-mode .watermark {
    display: block !important;
    text-align: right;
    color: #b2bec3;
    font-size: 0.8rem;
    margin-top: 10px;
}

.result-header {
    text-align: center;
    margin-bottom: 20px;
}

.result-header h2 {
    color: var(--primary-color);
    font-size: 1.4rem;
}

.character-image-box {
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 20px;
    background: #F1F2F6;
    aspect-ratio: 1/1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.character-image-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.score-box {
    text-align: center;
    margin-bottom: 24px;
}

.score-circle {
    display: inline-block;
    text-align: center;
    background-color: #6C5CE7;
    background-image: linear-gradient(135deg, #6C5CE7, #00CEC9);
    color: white;
    padding: 10px 30px;
    border-radius: 30px;
    font-size: 1.2rem;
    font-weight: bold;
}

.score-circle span {
    font-size: 2.2rem;
    margin-right: 2px;
}

.score-label {
    margin-top: 8px;
    font-weight: 600;
    color: var(--text-muted);
}

.analysis-box {
    background: #F8F9FA;
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 16px;
}

.analysis-box h3 {
    font-size: 1.1rem;
    color: #2D3436;
    margin-bottom: 8px;
}

.text-content {
    font-size: 0.95rem;
    color: #2D3436;
    white-space: pre-wrap;
}

.action-buttons {
    margin-top: 24px;
}

.premium-hook-box {
    margin-top: 32px;
    padding: 20px;
    background: linear-gradient(to bottom right, #fdfbfb, #ebedee);
    border: 2px solid var(--primary-color);
    border-radius: 16px;
    text-align: center;
}

.premium-hook-box h3 {
    color: var(--primary-color);
    margin-bottom: 12px;
    font-size: 1.2rem;
}

.premium-hook-box p {
    font-size: 0.95rem;
    margin-bottom: 20px;
}

/* Premium PDF Specific Styles */
.pdf-page {
    width: 794px;
    min-height: 1080px;
    margin: 0;
    padding: 40px;
    background: white;
    box-sizing: border-box;
    position: relative;
    page-break-after: always;
}

.pdf-cover {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    height: 100%;
    background: linear-gradient(135deg, #fdfbfb 0%, #ebedee 100%);
    border: 10px solid var(--primary-color);
}

.pdf-title {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 20px;
    font-weight: 800;
}

.pdf-section-title {
    font-size: 1.6rem;
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 10px;
    margin-bottom: 20px;
    margin-top: 10px;
}

.pdf-text {
    font-size: 11pt;
    line-height: 1.8;
    margin-bottom: 20px;
    color: #2D3436;
    white-space: pre-wrap;
}

.pdf-card {
    background: #F1F2F6;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-size: 11pt;
    white-space: pre-wrap;
}

.pdf-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.pdf-table th, .pdf-table td {
    border: 1px solid #DFE6E9;
    padding: 12px;
    text-align: left;
}

.pdf-table th {
    background-color: var(--primary-color);
    color: white;
}
