:root {
    --primary-color: #2e7d32;
    --secondary-color: #558b2f;
    --accent-color: #ef6c00;
    --bg-color: #f1f8e9;
    --card-bg: #ffffff;
    --text-main: #333333;
    --text-muted: #666666;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 20px;
    text-align: center;
}

header {
    margin-bottom: 40px;
}

.logo {
    font-size: 3rem;
    font-weight: 900;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.logo span {
    font-size: 2.5rem;
}

.subtitle {
    font-size: 1.2rem;
    color: var(--text-muted);
}

.card {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
    margin-bottom: 30px;
    transition: transform 0.3s ease;
}

.hidden {
    display: none !important;
}

.intro-img {
    font-size: 5rem;
    margin-bottom: 20px;
}

h2 {
    margin-bottom: 20px;
    font-weight: 700;
}

.btn-primary, .btn-secondary, .btn-info {
    padding: 15px 35px;
    border-radius: 50px;
    border: none;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
    margin: 10px;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: #1b5e20;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(46, 125, 50, 0.3);
}

.btn-secondary {
    background-color: #e0e0e0;
    color: var(--text-main);
}

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

.btn-info {
    background-color: var(--secondary-color);
    color: white;
}

.btn-info:hover {
    background-color: #33691e;
}

/* 업로드 영역 */
.drop-zone {
    border: 3px dashed #ccc;
    border-radius: 15px;
    padding: 60px 20px;
    margin-bottom: 20px;
    cursor: pointer;
    background-color: #fafafa;
    transition: border-color 0.2s;
}

.drop-zone:hover, .drop-zone.active {
    border-color: var(--primary-color);
    background-color: #f1f8e9;
}

.camera-actions {
    margin-top: 20px;
}

#webcam-container {
    margin-top: 20px;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

#webcam {
    border-radius: 15px;
    background: #000;
    width: 100%;
}

/* 로딩 */
.loader-container {
    padding: 20px;
}

.loader {
    width: 60px;
    height: 60px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    display: inline-block;
}

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

.loading-text {
    font-size: 1.2rem;
    margin-top: 20px;
}

/* 결과 */
.result-main-card {
    text-align: center;
    padding: 20px;
}

.result-emoji {
    font-size: 6rem;
    margin-bottom: 20px;
}

.result-name {
    font-size: 2.2rem;
    color: var(--primary-color);
    font-weight: 800;
    margin-bottom: 10px;
}

.result-tagline {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--accent-color);
    margin-bottom: 15px;
}

.result-desc {
    margin-top: 15px;
    font-size: 1.1rem;
    color: var(--text-muted);
}

#result-others {
    margin-top: 40px;
    border-top: 1px solid #eee;
    padding-top: 30px;
}

#result-others h3 {
    margin-bottom: 20px;
    font-size: 1.2rem;
    color: var(--text-muted);
}

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

.top-3-label {
    width: 160px;
    text-align: left;
    font-weight: 600;
    font-size: 1rem;
}

.progress-bar-bg {
    flex-grow: 1;
    height: 14px;
    background: #eee;
    border-radius: 7px;
    margin: 0 15px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: var(--primary-color);
    border-radius: 7px;
    width: 0;
    transition: width 1s ease-out;
}

.top-3-percent {
    width: 60px;
    text-align: right;
    font-weight: 700;
    color: var(--primary-color);
}

/* 블로그 섹션 */
.blog-section {
    margin-top: 80px;
    border-top: 2px solid #e0e0e0;
    padding-top: 60px;
}

.section-title {
    font-size: 2.2rem;
    margin-bottom: 40px;
    color: var(--primary-color);
}

.dino-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
}

.dino-info-card {
    background: white;
    padding: 30px;
    border-radius: 20px;
    text-align: left;
    box-shadow: 0 5px 15px rgba(0,0,0,0.03);
    transition: all 0.3s ease;
    cursor: pointer;
    border: 1px solid transparent;
}

.dino-info-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.08);
    border-color: var(--primary-color);
}

.dino-info-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.dino-info-emoji {
    font-size: 2.5rem;
}

.dino-info-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary-color);
}

.dino-info-body {
    font-size: 1rem;
    color: var(--text-muted);
    border-top: 1px solid #f5f5f5;
    padding-top: 15px;
}

.dino-info-char {
    margin-top: 10px;
    font-weight: 600;
    color: var(--accent-color);
}

/* 상세 페이지 (블로그 포스트 스타일) */
#dino-detail-section {
    text-align: left;
    padding: 60px;
    max-width: 800px;
    margin: 40px auto;
}

.detail-nav {
    margin-bottom: 40px;
}

.dino-article {
    animation: fadeIn 0.5s ease;
}

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

.detail-header {
    text-align: center;
    margin-bottom: 40px;
}

.detail-emoji {
    font-size: 8rem;
    margin-bottom: 20px;
}

.detail-tagline {
    font-size: 1.2rem;
    color: var(--accent-color);
    font-weight: 600;
    margin-bottom: 10px;
}

.detail-title {
    font-size: 3rem;
    color: var(--primary-color);
    font-weight: 900;
}

.detail-content {
    font-size: 1.2rem;
    color: var(--text-main);
    line-height: 1.8;
}

.detail-section {
    margin-top: 30px;
    padding: 25px;
    border-radius: 15px;
    background-color: #f9fdf4;
    border-left: 5px solid var(--primary-color);
}

.detail-section h4 {
    color: var(--primary-color);
    margin-bottom: 12px;
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.detail-section p {
    color: var(--text-main);
    font-size: 1.1rem;
    line-height: 1.8;
}

/* 키워드 태그 스타일 */
.keyword-container {
    margin-top: 15px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.keyword-tag {
    background-color: #e8f5e9;
    color: var(--primary-color);
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.95rem;
    font-weight: 600;
    border: 1px solid rgba(46, 125, 50, 0.2);
}

/* 연예인 섹션 스타일 */
.celeb-section {
    margin-top: 40px;
    padding: 30px;
    background: #fff3e0;
    border-radius: 20px;
    text-align: left;
    border: 1px solid #ffe0b2;
}

.celeb-section h4 {
    color: var(--accent-color);
    margin-bottom: 20px;
    font-size: 1.3rem;
}

.celeb-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.celeb-item {
    font-size: 1.1rem;
    color: var(--text-main);
    padding-bottom: 10px;
    border-bottom: 1px dashed #ffd180;
}

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

.celeb-item strong {
    color: var(--accent-color);
    margin-right: 10px;
}

.detail-footer {
    margin-top: 40px;
    padding-top: 20px;
    font-size: 0.9rem;
    color: var(--text-muted);
    border-top: 1px solid #eee;
    text-align: center;
}

footer {
    margin-top: 80px;
    padding: 40px 0;
    color: #999;
    font-size: 0.9rem;
}

@media (max-width: 600px) {
    .container {
        padding: 20px 15px;
    }
    .logo {
        font-size: 2.5rem;
    }
    .card {
        padding: 25px;
    }
    .top-3-label {
        width: 100px;
        font-size: 0.9rem;
    }
}
