:root {
    --primary-color: #4a90e2;
    --secondary-color: #f5a623;
    --bg-color: #f8f9fa;
    --card-bg: #ffffff;
    --text-color: #333;
    --border-radius: 12px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    min-height: 100vh;
}

#app {
    width: 100%;
    max-width: 500px;
    padding: 20px;
    box-sizing: border-box;
}

header {
    text-align: center;
    margin-bottom: 30px;
}

header h1 {
    margin: 0;
    font-size: 1.5rem;
}

header p {
    color: #666;
    margin: 5px 0 0;
}

.card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    margin-bottom: 20px;
}

.button-group {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.btn {
    flex: 1;
    border: none;
    border-radius: 8px;
    padding: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: opacity 0.2s;
}

.btn:active {
    opacity: 0.7;
}

.btn.primary { background-color: var(--primary-color); color: white; }
.btn.secondary { background-color: var(--secondary-color); color: white; }
.btn.outline { background: none; border: 2px solid var(--primary-color); color: var(--primary-color); }
.btn.link { background: none; color: var(--primary-color); font-size: 0.9rem; text-decoration: underline; }

.btn.recording {
    background-color: #e74c3c;
    animation: pulse 1.5s infinite;
}

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

.info-text {
    text-align: center;
    font-size: 0.85rem;
    color: #888;
}

.info-text p { margin: 2px 0; }

.hidden { display: none !important; }

/* Loader */
.loader {
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

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

.progress-bar {
    background: #eee;
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 10px;
}

#progress-fill {
    background: var(--primary-color);
    height: 100%;
    width: 0%;
    transition: width 0.3s;
}

/* Results */
#top-prediction {
    text-align: center;
    margin-bottom: 20px;
}

#top-label {
    display: block;
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary-color);
}

#top-confidence {
    font-size: 1.2rem;
    color: #666;
}

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

.prediction-item .label { width: 80px; }
.prediction-item .bar-container {
    flex: 1;
    background: #eee;
    height: 6px;
    border-radius: 3px;
}
.prediction-item .bar {
    background: var(--secondary-color);
    height: 100%;
    border-radius: 3px;
}
.prediction-item .val { width: 40px; text-align: right; font-weight: bold; }

.sample-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 10px;
}

.sample-item {
    padding: 8px;
    font-size: 0.8rem;
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sample-item:hover {
    background: #e0e0e0;
}

.result-visual-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 12px;
    margin-bottom: 20px;
    padding: 30px 20px;
    box-sizing: border-box;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
    text-align: center;
}

.result-translation {
    word-break: keep-all;
    max-width: 90%;
    margin-top: 15px;
    line-height: 1.4;
    font-weight: bold;
    font-size: 1.1rem;
    color: #333;
}

.result-img {
    width: 200px;
    height: 200px;
    object-fit: cover;
    border-radius: 50%;
    border: 5px solid white;
    box-shadow: 0 6px 15px rgba(0,0,0,0.15);
}

.result-emoji {
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.1));
}

canvas {
    width: 100%;
    height: 100px;
    background: #f9f9f9;
    border-radius: 8px;
    margin-bottom: 10px;
}

#highlight-info {
    font-size: 0.9rem;
    line-height: 1.4;
    background: #eef7ff;
    padding: 10px;
    border-radius: 8px;
}

#reset-btn {
    width: 100%;
    margin: 20px 0;
}

/* Share Actions */
.share-actions {
    margin-top: 20px;
    text-align: center;
    display: flex;
    justify-content: center;
    gap: 10px;
}

.btn.small {
    padding: 8px 16px;
    font-size: 0.9rem;
    display: inline-flex;
    width: auto;
}

/* History Section */
#history-section h3 {
    margin-top: 0;
    font-size: 1.1rem;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #eee;
}

.history-item:last-child {
    border-bottom: none;
}

.history-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.history-date {
    font-size: 0.75rem;
    color: #999;
}

.history-meta {
    font-size: 0.85rem;
    color: #555;
}

.history-result {
    text-align: right;
}

.history-label {
    display: inline-block;
    font-weight: bold;
    color: var(--primary-color);
    margin-right: 5px;
}

.history-confidence {
    font-size: 0.8rem;
    color: #666;
}

.highlight-container {
    margin-top: 20px;
    padding: 15px;
    background: #f0f7ff;
    border-radius: 10px;
    border-left: 4px solid var(--primary-color);
    font-size: 0.95rem;
    line-height: 1.6;
    text-align: left;
}

.highlight-container p {
    margin: 0;
}

/* MBTI 섹션 스타일 */
.divider {
    border: 0;
    border-top: 1px solid #eee;
    margin: 20px 0;
}

.mbti-container {
    text-align: left;
    background: #fdfdfd;
    border-radius: 12px;
    padding: 5px 15px 15px;
    margin-bottom: 20px;
}

.mbti-header {
    margin-bottom: 15px;
    text-align: center;
}

.mbti-header h3 {
    margin: 10px 0 5px;
    color: #2c3e50;
    font-size: 1.25rem;
}

.mbti-desc {
    font-size: 0.95rem;
    color: #555;
    margin-bottom: 15px;
    text-align: center;
}

.mbti-tips {
    background: #fff;
    border: 1px solid #edf2f7;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 20px;
}

.mbti-tips p {
    font-size: 0.85rem;
    margin: 5px 0;
    color: #444;
}

.match-container h4 {
    font-size: 1rem;
    margin-bottom: 10px;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 5px;
}

.match-card {
    background: #f0f7ff;
    border-left: 4px solid var(--primary-color);
    padding: 12px;
    border-radius: 0 8px 8px 0;
}

.match-card p {
    font-size: 0.85rem;
    margin: 4px 0;
}

.match-tip {
    margin-top: 8px !important;
    color: #2c5282;
    font-weight: 500;
}

.disclaimer {
    font-size: 0.75rem;
    color: #a0aec0;
    text-align: center;
    margin-top: 15px;
}

.highlight-container strong {
    color: var(--primary-color);
}

footer {
    text-align: center;
    font-size: 0.8rem;
    color: #aaa;
    margin-top: 40px;
}

/* Info Cards */
.info-card h3 {
    margin-top: 0;
    margin-bottom: 12px;
    font-size: 1.1rem;
    color: #333;
}

.info-list {
    margin: 0;
    padding-left: 20px;
}

.info-list li {
    margin-bottom: 8px;
    font-size: 0.9rem;
    line-height: 1.5;
    color: #555;
}

.small-text {
    font-size: 0.85rem;
    line-height: 1.5;
    color: #666;
    margin: 0;
}

.state-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.badge {
    background: #f0f4f8;
    color: #4a90e2;
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
    border: 1px solid #d1e3f8;
}
