@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;600;700;800&family=Be+Vietnam+Pro:wght@400;500&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200&display=swap');

/* ─── CSS Variables ────────────────────────────────── */
:root {
    --bg:               #f7f6f3;
    --surface:          #ffffff;
    --surface-low:      #f1f1ee;
    --surface-mid:      #e8e8e5;
    --surface-high:     #ddddd9;
    --primary:          #854c43;
    --primary-light:    #fdb1a5;
    --secondary:        #7b4886;
    --secondary-light:  #f7beff;
    --tertiary:         #386360;
    --tertiary-light:   #cffdf8;
    --text:             #2e2f2d;
    --text-muted:       #5b5c5a;
    --outline:          #adadab;
    --shadow:           rgba(46,47,45,0.08);
    --shadow-lg:        rgba(46,47,45,0.14);
    --accent-color:     #854c43;
    --accent-hover:     #6d3830;
    --border-color:     #ddddd9;
    --container-bg:     #ffffff;
    --header-bg:        rgba(255,255,255,0.7);
}

body.dark {
    --bg:               #1a1b19;
    --surface:          #252623;
    --surface-low:      #2e2f2c;
    --surface-mid:      #363734;
    --surface-high:     #3f403d;
    --primary:          #eda498;
    --primary-light:    #6d3830;
    --secondary:        #ecaff6;
    --secondary-light:  #501f5c;
    --tertiary:         #c1eeea;
    --tertiary-light:   #25504e;
    --text:             #e4e3e0;
    --text-muted:       #9d9d9a;
    --outline:          #5b5c5a;
    --shadow:           rgba(0,0,0,0.3);
    --shadow-lg:        rgba(0,0,0,0.5);
    --accent-color:     #eda498;
    --accent-hover:     #fdb1a5;
    --border-color:     #3f403d;
    --container-bg:     #252623;
    --header-bg:        rgba(26,27,25,0.7);
}

/* ─── Reset & Base ─────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: 'Be Vietnam Pro', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 1rem;
    line-height: 1.6;
    background-color: var(--bg);
    color: var(--text);
    margin: 0;
    min-height: 100vh;
    transition: background-color 0.3s, color 0.3s;
}

h1, h2, h3, h4 {
    font-family: 'Plus Jakarta Sans', sans-serif;
    line-height: 1.25;
}

a { color: inherit; text-decoration: none; }

/* ─── Header / Nav ─────────────────────────────────── */
.main-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--header-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(173,173,171,0.2);
    padding: 0 5%;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 8px 32px var(--shadow);
}

.logo {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -0.03em;
    display: flex;
    align-items: center;
    gap: 8px;
}

nav ul.nav-links {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 0;
    padding: 0;
}

nav ul.nav-links li a {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    padding: 8px 16px;
    border-radius: 9999px;
    transition: background 0.2s, color 0.2s;
}

nav ul.nav-links li a:hover {
    background: rgba(133,76,67,0.08);
    color: var(--primary);
}

nav ul.nav-links li.lang-selector {
    font-size: 0.85rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 8px;
    border-left: 1px solid var(--outline);
    margin-left: 8px;
}

nav ul.nav-links li.lang-selector .active {
    font-weight: 700;
    color: var(--primary);
}

nav ul.nav-links li.lang-selector a {
    padding: 0;
    font-size: 0.85rem;
    color: var(--text-muted);
    opacity: 0.7;
}

nav ul.nav-links li.lang-selector a:hover {
    background: transparent;
    opacity: 1;
    color: var(--primary);
}

#theme-toggle {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    background: var(--surface-low);
    border: 1px solid var(--outline);
    color: var(--text-muted);
    padding: 8px 18px;
    border-radius: 9999px;
    cursor: pointer;
    transition: all 0.2s;
}

#theme-toggle:hover {
    background: var(--surface-mid);
    color: var(--text);
}

/* ─── Main Container ───────────────────────────────── */
.container {
    max-width: 860px;
    margin: 3rem auto;
    padding: 0 1.5rem 4rem;
}

/* ─── Hero / Test Section ──────────────────────────── */
.animal-test-section {
    text-align: center;
    margin-bottom: 1rem;
}

.animal-test-section h1 {
    font-size: clamp(1.9rem, 4.5vw, 3rem);
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.04em;
    margin: 0 0 0.75rem;
}

.subtitle {
    font-size: 1rem;
    color: var(--text-muted);
    max-width: 580px;
    margin: 0 auto 2.5rem;
    line-height: 1.65;
}

/* ─── Upload Area ──────────────────────────────────── */
.upload-area {
    background: var(--surface);
    border: 2px dashed var(--outline);
    border-radius: 24px;
    padding: 3.5rem 2rem;
    cursor: pointer;
    transition: all 0.25s;
    box-shadow: 0 8px 32px var(--shadow);
    margin: 0 0 1.5rem;
}

.upload-area:hover {
    border-color: var(--primary);
    box-shadow: 0 12px 40px var(--shadow-lg);
    transform: translateY(-2px);
}

.upload-area.dragover {
    border-color: var(--primary);
    background: rgba(133,76,67,0.04);
    transform: scale(1.01);
}

.upload-icon {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    display: block;
}

.upload-area p {
    color: var(--text-muted);
    margin: 0 0 1.75rem;
    font-size: 0.95rem;
}

/* ─── Buttons ──────────────────────────────────────── */
.secondary-btn {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    border: none;
    border-radius: 9999px;
    padding: 14px 32px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.23,1,0.32,1);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

#upload-btn {
    background: linear-gradient(135deg, var(--primary) 0%, #a8635a 100%);
    color: #ffefed;
    box-shadow: 0 4px 16px rgba(133,76,67,0.35);
}

#upload-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(133,76,67,0.45);
}

#upload-btn:active { transform: scale(0.97); }

#reset-btn {
    background: var(--secondary-light);
    color: var(--secondary);
    margin-top: 1.25rem;
}

body.dark #reset-btn {
    background: rgba(236,175,246,0.15);
    color: var(--secondary);
}

#reset-btn:hover {
    transform: translateY(-2px);
    filter: brightness(1.05);
}

/* ─── Image Preview ────────────────────────────────── */
#image-preview {
    max-width: 100%;
    max-height: 380px;
    width: auto;
    border-radius: 20px;
    box-shadow: 0 12px 40px var(--shadow-lg);
    display: block;
    margin: 1.5rem auto;
    object-fit: contain;
}

/* ─── Result Container ─────────────────────────────── */
#result-container {
    background: var(--surface);
    border-radius: 20px;
    padding: 1.75rem 2rem;
    box-shadow: 0 8px 32px var(--shadow);
    margin-top: 1rem;
    text-align: left;
    border: 1px solid var(--surface-mid);
    font-size: 1rem;
}

#result-container:empty { display: none; }

/* ─── Share Section ────────────────────────────────── */
.share-section {
    background: var(--surface);
    border-radius: 20px;
    padding: 1.75rem 2rem;
    box-shadow: 0 8px 32px var(--shadow);
    margin-top: 1.25rem;
    border: 1px solid var(--surface-mid);
    display: none;
}

.share-title {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    color: var(--text);
    margin: 0 0 1rem;
    text-align: center;
}

.share-buttons {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.share-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    font-weight: 700;
    transition: transform 0.2s, box-shadow 0.2s;
    color: white;
    box-shadow: 0 4px 12px var(--shadow);
}

.share-btn:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px var(--shadow-lg);
}

.btn-twitter   { background: #1DA1F2; }
.btn-facebook  { background: #4267B2; }
.btn-copy      { background: var(--secondary); }
.btn-share-all { background: var(--tertiary); }

/* ─── Separator ────────────────────────────────────── */
.separator {
    border: none;
    border-top: 1px solid var(--surface-mid);
    margin: 3.5rem 0;
}

/* ─── Info Section ─────────────────────────────────── */
.info-section {
    display: grid;
    gap: 1.25rem;
    margin: 0;
    text-align: left;
}

.info-section > h2 {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--primary);
    margin: 0;
    letter-spacing: -0.03em;
}

.info-card {
    background: var(--surface);
    border-radius: 20px;
    padding: 1.75rem 2rem;
    border: 1px solid var(--surface-mid);
    box-shadow: 0 4px 16px var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
}

.info-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px var(--shadow-lg);
}

.info-card h2, .info-card h3 {
    margin: 0 0 0.75rem;
    color: var(--primary);
    font-size: 1.1rem;
    font-weight: 700;
}

.info-card p { margin: 0 0 0.75rem; color: var(--text-muted); font-size: 0.95rem; }
.info-card p:last-child { margin-bottom: 0; }
.info-card strong { color: var(--text); }

/* ─── FAQ ──────────────────────────────────────────── */
.faq-container { display: grid; gap: 1rem; }

.faq-item {
    background: var(--surface);
    border-radius: 16px !important;
    padding: 1.5rem 1.75rem !important;
    border-left: 4px solid var(--primary) !important;
    border-top: 1px solid var(--surface-mid);
    border-right: 1px solid var(--surface-mid);
    border-bottom: 1px solid var(--surface-mid);
    box-shadow: 0 4px 16px var(--shadow);
    background: rgba(133,76,67,0.03) !important;
}

.faq-item h3 {
    color: var(--primary) !important;
    font-size: 1rem !important;
    margin: 0 0 0.6rem !important;
    font-weight: 700;
}

.faq-item p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin: 0 !important;
    line-height: 1.55;
}

/* ─── About Section ────────────────────────────────── */
.about-section {
    background: var(--surface);
    border-radius: 20px;
    padding: 2rem;
    border: 1px solid var(--surface-mid);
    box-shadow: 0 4px 16px var(--shadow);
    text-align: left;
}

.about-section h2 {
    color: var(--primary);
    font-size: 1.3rem;
    margin: 0 0 0.75rem;
}

.about-section p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin: 0;
}

/* ─── Contact Form ─────────────────────────────────── */
.inquiry-form {
    background: var(--surface);
    border-radius: 20px;
    padding: 2rem;
    border: 1px solid var(--surface-mid);
    box-shadow: 0 4px 16px var(--shadow);
    text-align: left;
}

.inquiry-form h2 {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--text);
    margin: 0 0 1.5rem;
    letter-spacing: -0.03em;
}

.form-group { margin-bottom: 1rem; }

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 14px 18px;
    background: var(--surface-low);
    border: 1.5px solid var(--surface-mid);
    border-radius: 14px;
    color: var(--text);
    font-family: 'Be Vietnam Pro', sans-serif;
    font-size: 0.95rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
    resize: vertical;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(133,76,67,0.12);
}

.form-group textarea { min-height: 120px; }

#submit-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, var(--primary) 0%, #a8635a 100%);
    color: #ffefed;
    border: none;
    border-radius: 9999px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 16px rgba(133,76,67,0.3);
    margin-top: 0.5rem;
}

#submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(133,76,67,0.4);
}

/* ─── Footer ───────────────────────────────────────── */
.main-footer {
    background: var(--surface);
    border-top: 1px solid var(--surface-mid);
    padding: 2.5rem 5%;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.main-footer p { margin: 0 0 0.75rem; }

.footer-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px 20px;
}

.footer-links a {
    color: var(--text-muted);
    opacity: 0.8;
    transition: opacity 0.2s, color 0.2s;
    font-size: 0.875rem;
}

.footer-links a:hover {
    opacity: 1;
    color: var(--primary);
}

/* ─── Secondary info-card variant ─────────────────── */
.info-card--secondary {
    background: rgba(123,72,134,0.05);
    border-color: rgba(123,72,134,0.2);
}

.info-card--secondary h3 {
    color: var(--secondary) !important;
}

.info-link {
    display: inline-block;
    margin-top: 0.5rem;
    color: var(--secondary);
    font-weight: 700;
    font-size: 0.9rem;
    transition: opacity 0.2s;
}

.info-link:hover { opacity: 0.75; }

/* ─── FAQ heading ──────────────────────────────────── */
.faq-heading {
    font-size: 1.5rem !important;
    font-weight: 800;
    color: var(--primary) !important;
    margin: 0 !important;
    letter-spacing: -0.03em;
}

/* ─── Disqus thread spacing ────────────────────────── */
#disqus_thread { margin-top: 2rem; }

/* ─── Blog Preview Section (homepage) ─────────────── */
.blog-preview-section {
    margin-bottom: 1rem;
}

.blog-preview-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}

.blog-preview-header h2 {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text);
    margin: 0;
    letter-spacing: -0.03em;
}

.blog-preview-all {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
    transition: opacity 0.2s;
}

.blog-preview-all:hover { opacity: 0.7; }

.blog-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1rem;
}

.blog-preview-card {
    background: var(--surface);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--surface-mid);
    box-shadow: 0 4px 16px var(--shadow);
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s, box-shadow 0.2s;
}

.blog-preview-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 30px var(--shadow-lg);
}

.blog-preview-emoji {
    width: 100%;
    aspect-ratio: 2.8 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
}

.blog-preview-body {
    padding: 1rem 1.1rem 1.2rem;
}

.blog-preview-tag {
    font-size: 0.72rem;
    font-weight: 700;
    font-family: 'Plus Jakarta Sans', sans-serif;
    background: rgba(133,76,67,0.1);
    color: var(--primary);
    padding: 2px 10px;
    border-radius: 9999px;
    display: inline-block;
    margin-bottom: 0.5rem;
}

.blog-preview-body h3 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 0.4rem;
    line-height: 1.35;
    letter-spacing: -0.02em;
}

.blog-preview-body p {
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin: 0;
}

/* ─── Responsive ───────────────────────────────────── */
@media (max-width: 640px) {
    .main-header { padding: 0 4%; }

    nav ul.nav-links {
        gap: 2px;
    }

    nav ul.nav-links li a {
        padding: 7px 10px;
        font-size: 0.82rem;
    }

    nav ul.nav-links li.lang-selector {
        display: none;
    }

    .animal-test-section h1 {
        font-size: 1.65rem;
    }

    .upload-area {
        padding: 2.5rem 1.25rem;
        border-radius: 18px;
    }

    .info-card,
    .share-section,
    #result-container,
    .about-section,
    .inquiry-form {
        padding: 1.25rem 1.25rem;
        border-radius: 16px;
    }

    .footer-links {
        flex-direction: column;
        gap: 8px;
        align-items: center;
    }
}
