:root {
    /* Shared values */
    --font-sans: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;
    --theme-transition: background-color 0.4s ease, color 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease, transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

[data-theme="dark"] {
    --primary-color: oklch(0.68 0.18 145);
    --secondary-color: oklch(0.72 0.16 200);
    --bg-color: oklch(0.12 0.015 200);
    --text-color: oklch(0.95 0.01 200);
    --card-bg: rgba(20, 24, 33, 0.65);
    --card-border: rgba(255, 255, 255, 0.08);
    --ball-bg: oklch(0.18 0.015 200);
    --ball-border: oklch(0.68 0.18 145);
    --ball-text: oklch(0.95 0.01 200);
    --ball-shadow: 0 4px 15px rgba(0, 0, 0, 0.3), inset 0 -4px 10px rgba(255, 255, 255, 0.05);
    --shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    --glow: 0 0 25px oklch(0.68 0.18 145 / 0.4);
    --radial-1: oklch(0.3 0.08 200 / 0.25);
    --radial-2: oklch(0.3 0.08 145 / 0.15);
    --radial-3: oklch(0.3 0.08 260 / 0.25);
    --btn-text-color: oklch(0.12 0.015 200);
}

[data-theme="light"] {
    --primary-color: oklch(0.6 0.18 145);
    --secondary-color: oklch(0.65 0.15 200);
    --bg-color: oklch(0.97 0.01 200);
    --text-color: oklch(0.2 0.02 200);
    --card-bg: rgba(255, 255, 255, 0.75);
    --card-border: rgba(0, 0, 0, 0.06);
    --ball-bg: oklch(1 0 0);
    --ball-border: oklch(0.6 0.18 145);
    --ball-text: oklch(0.2 0.02 200);
    --ball-shadow: 0 6px 15px rgba(0, 0, 0, 0.08), inset 0 -4px 10px rgba(0, 0, 0, 0.03);
    --shadow: 0 15px 35px rgba(0, 0, 0, 0.08);
    --glow: 0 0 20px oklch(0.6 0.18 145 / 0.25);
    --radial-1: oklch(0.85 0.06 200 / 0.35);
    --radial-2: oklch(0.85 0.06 145 / 0.2);
    --radial-3: oklch(0.85 0.06 260 / 0.35);
    --btn-text-color: oklch(1 0 0);
}

body {
    font-family: var(--font-sans);
    background: var(--bg-color);
    background-image: 
        radial-gradient(at 0% 0%, var(--radial-1) 0, transparent 50%),
        radial-gradient(at 50% 0%, var(--radial-2) 0, transparent 50%),
        radial-gradient(at 100% 0%, var(--radial-3) 0, transparent 50%);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    padding: 3.5rem 0;
    color: var(--text-color);
    transition: var(--theme-transition);
    gap: 2.5rem;
}

/* Subtle noise texture */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.015;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    transition: opacity 0.4s ease;
}

[data-theme="light"] body::before {
    opacity: 0.03; /* slightly higher noise opacity for light theme */
}

.container {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 3.5rem 3rem 3rem 3rem;
    border-radius: 28px;
    box-shadow: var(--shadow);
    border: 1px solid var(--card-border);
    text-align: center;
    max-width: 680px;
    width: 90%;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), var(--theme-transition);
    position: relative;
}

.container:hover {
    transform: translateY(-6px);
}

/* Theme Toggle Button Styling */
.theme-toggle {
    position: absolute;
    top: 1.2rem;
    right: 1.2rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--card-border);
    cursor: pointer;
    padding: 0.6rem;
    border-radius: 50%;
    color: var(--text-color);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--theme-transition);
    outline: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.theme-toggle:hover {
    transform: scale(1.1) rotate(15deg);
    background: rgba(255, 255, 255, 0.12);
}

.theme-toggle:active {
    transform: scale(0.95);
}

[data-theme="light"] .theme-toggle {
    background: rgba(0, 0, 0, 0.03);
}

[data-theme="light"] .theme-toggle:hover {
    background: rgba(0, 0, 0, 0.06);
}

/* Toggle icons display rule */
[data-theme="dark"] .sun-icon {
    display: block;
}
[data-theme="dark"] .moon-icon {
    display: none;
}
[data-theme="light"] .sun-icon {
    display: none;
}
[data-theme="light"] .moon-icon {
    display: block;
}

.sun-icon, .moon-icon {
    animation: rotateIn 0.4s ease;
}

@keyframes rotateIn {
    0% { transform: rotate(-45deg) scale(0.5); opacity: 0; }
    100% { transform: rotate(0) scale(1); opacity: 1; }
}

h1 {
    font-size: 2.2rem;
    margin-bottom: 2rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.03em;
    transition: var(--theme-transition);
}

/* Settings Toggle and Panel Styling */
.settings-toggle {
    position: absolute;
    top: 1.2rem;
    left: 1.2rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--card-border);
    cursor: pointer;
    padding: 0.6rem;
    border-radius: 50%;
    color: var(--text-color);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--theme-transition);
    outline: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.settings-toggle:hover {
    transform: scale(1.1) rotate(45deg);
    background: rgba(255, 255, 255, 0.12);
}

.settings-toggle:active {
    transform: scale(0.95);
}

[data-theme="light"] .settings-toggle {
    background: rgba(0, 0, 0, 0.03);
}

[data-theme="light"] .settings-toggle:hover {
    background: rgba(0, 0, 0, 0.06);
}

.settings-section {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease, margin 0.3s ease;
    text-align: left;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 16px;
    border: 1px solid transparent;
}

.settings-section.expanded {
    max-height: 250px;
    opacity: 1;
    margin-top: 1rem;
    margin-bottom: 1.5rem;
    padding: 1.2rem;
    border-color: var(--card-border);
    background: rgba(255, 255, 255, 0.03);
}

[data-theme="light"] .settings-section.expanded {
    background: rgba(0, 0, 0, 0.015);
}

.settings-content h3 {
    font-size: 1rem;
    margin-top: 0;
    margin-bottom: 0.4rem;
    font-weight: 700;
}

.settings-help {
    font-size: 0.8rem;
    opacity: 0.6;
    margin-top: 0;
    margin-bottom: 1rem;
    line-height: 1.3;
}

.settings-form {
    display: flex;
    gap: 0.8rem;
}

.settings-form input {
    flex: 1;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    padding: 0.6rem 0.8rem;
    color: var(--text-color);
    font-family: inherit;
    font-size: 0.85rem;
    outline: none;
    transition: all 0.3s ease;
}

[data-theme="light"] .settings-form input {
    background: rgba(0, 0, 0, 0.02);
}

.settings-form input:focus {
    border-color: var(--primary-color);
    background: rgba(255, 255, 255, 0.06);
}

.settings-form button {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--btn-text-color);
    border: none;
    padding: 0.6rem 1.2rem;
    font-size: 0.85rem;
    font-weight: 700;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.settings-form button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px oklch(0.68 0.18 145 / 0.3);
}

[data-theme="light"] .settings-form button:hover {
    box-shadow: 0 4px 12px oklch(0.6 0.18 145 / 0.2);
}

.model-status {
    font-size: 0.75rem;
    margin-top: 0.6rem;
    font-weight: 600;
    opacity: 0.8;
}

.model-status.success {
    color: oklch(0.7 0.14 140);
}

.model-status.error {
    color: oklch(0.65 0.15 20);
}

/* Subtitle Styling */
.subtitle {
    font-size: 0.95rem;
    line-height: 1.5;
    opacity: 0.7;
    margin-top: -1.2rem;
    margin-bottom: 2.2rem;
    font-weight: 500;
    transition: var(--theme-transition);
}

/* Upload Area Styling */
.upload-area {
    border: 2px dashed var(--card-border);
    border-radius: 20px;
    padding: 3rem 2rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), var(--theme-transition);
    background: rgba(255, 255, 255, 0.01);
}

.upload-area:hover {
    border-color: var(--primary-color);
    transform: scale(1.02);
    background: rgba(255, 255, 255, 0.03);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
}

.upload-area.drag-over {
    border-color: var(--primary-color);
    background: oklch(0.68 0.18 145 / 0.06);
    transform: scale(1.03);
    box-shadow: 0 0 20px oklch(0.68 0.18 145 / 0.15);
}

[data-theme="light"] .upload-area {
    background: rgba(0, 0, 0, 0.005);
}

[data-theme="light"] .upload-area:hover {
    background: rgba(0, 0, 0, 0.015);
}

[data-theme="light"] .upload-area.drag-over {
    background: oklch(0.6 0.18 145 / 0.04);
}

.upload-prompt {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.upload-icon {
    color: var(--primary-color);
    transition: transform 0.3s ease, var(--theme-transition);
}

.upload-area:hover .upload-icon {
    transform: translateY(-4px) scale(1.05);
}

.upload-main-text {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
}

.upload-sub-text {
    font-size: 0.8rem;
    opacity: 0.5;
    margin: 0;
    line-height: 1.4;
}

/* Preview and Scanning Container Styling */
.preview-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    animation: fadeIn 0.4s ease;
}

.image-wrapper {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid var(--card-border);
    box-shadow: var(--shadow);
    max-width: 100%;
    width: 320px;
    height: 320px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.2);
}

#preview-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.scan-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    box-sizing: border-box;
}

/* Scanning glowing line */
.scan-line {
    position: absolute;
    width: 100%;
    height: 4px;
    background: linear-gradient(to bottom, transparent, var(--primary-color) 50%, transparent);
    box-shadow: 0 0 15px var(--primary-color), 0 0 5px var(--primary-color);
    opacity: 0.8;
    animation: scanLine 2s ease-in-out infinite;
}

/* Ambient glow pulses during scan */
.scan-pulse {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: oklch(0.68 0.18 145 / 0.1);
    opacity: 0;
    animation: pulseGlow 2s ease-in-out infinite;
}

@keyframes scanLine {
    0% { top: 0%; }
    50% { top: 100%; }
    100% { top: 0%; }
}

@keyframes pulseGlow {
    0%, 100% { opacity: 0; }
    50% { opacity: 1; }
}

.scan-status {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: blink 1.2s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* Results Container Styling */
.results-container {
    display: flex;
    flex-direction: column;
    gap: 1.8rem;
    animation: slideUpPop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}

.result-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
}

.result-emoji {
    font-size: 3.5rem;
    line-height: 1;
    animation: emojiPop 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.4) both;
}

@keyframes emojiPop {
    0% { transform: scale(0) rotate(-20deg); }
    70% { transform: scale(1.2) rotate(10deg); }
    100% { transform: scale(1) rotate(0); }
}

.result-title {
    font-size: 1.6rem;
    font-weight: 800;
    margin: 0;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.result-desc {
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0;
    opacity: 0.85;
    padding: 1.2rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 16px;
    border: 1px solid var(--card-border);
    text-align: left;
}

[data-theme="light"] .result-desc {
    background: rgba(0, 0, 0, 0.015);
}

.result-charts {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.chart-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.chart-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    font-weight: 700;
}

.percent-val {
    color: var(--primary-color);
}

.bar-container {
    height: 16px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--card-border);
    position: relative;
}

[data-theme="light"] .bar-container {
    background: rgba(0, 0, 0, 0.03);
}

.bar-fill {
    height: 100%;
    border-radius: 8px;
    width: 0%;
    transition: width 1.5s cubic-bezier(0.1, 0.8, 0.2, 1);
    position: relative;
    overflow: hidden;
}

/* Beautiful Gloss layer on filled bars */
.bar-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0) 100%);
    animation: barShine 3s infinite linear;
}

@keyframes barShine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Golden theme for Dog */
.dog-chart .bar-fill {
    background: linear-gradient(90deg, oklch(0.78 0.14 85), oklch(0.72 0.16 95));
    box-shadow: 0 0 10px oklch(0.75 0.15 85 / 0.3);
}
.dog-chart .percent-val {
    color: oklch(0.75 0.15 85);
}

/* Purple/Violet theme for Cat */
.cat-chart .bar-fill {
    background: linear-gradient(90deg, oklch(0.68 0.2 320), oklch(0.58 0.22 340));
    box-shadow: 0 0 10px oklch(0.65 0.22 320 / 0.3);
}
.cat-chart .percent-val {
    color: oklch(0.65 0.22 320);
}

.retry-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--btn-text-color);
    border: none;
    padding: 1.1rem 2.2rem;
    font-size: 1rem;
    font-weight: 700;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), var(--theme-transition);
    box-shadow: var(--glow);
    margin-top: 0.5rem;
}

.retry-btn:hover {
    transform: scale(1.03);
    box-shadow: 0 6px 20px oklch(0.68 0.18 145 / 0.45);
}

[data-theme="light"] .retry-btn:hover {
    box-shadow: 0 6px 20px oklch(0.6 0.18 145 / 0.3);
}

.retry-btn:active {
    transform: scale(0.98);
}

/* Global Animations & Utilities */
.hidden {
    display: none !important;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.97); }
    to { opacity: 1; transform: scale(1); }
}

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


/* Divider and Contact Form Styling */
.divider {
    height: 1px;
    background: var(--card-border);
    margin: 2.5rem 0 1.5rem 0;
    transition: var(--theme-transition);
}

.footer-links {
    display: flex;
    justify-content: center;
    margin-bottom: 0.5rem;
}

.contact-toggle {
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    opacity: 0.85;
}

.contact-toggle:hover {
    opacity: 1;
    text-shadow: 0 0 10px oklch(0.68 0.18 145 / 0.25);
    transform: translateY(-1px);
}

.contact-toggle::after {
    content: ' ▾';
    display: inline-block;
    transition: transform 0.3s ease;
}

.contact-toggle.active::after {
    transform: rotate(180deg);
}

.contact-section {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s ease;
    text-align: left;
}

.contact-section.expanded {
    max-height: 500px; /* high enough to contain the form */
    opacity: 1;
    margin-top: 1rem;
}

#contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    padding: 0.5rem 0.2rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-color);
    opacity: 0.8;
    transition: var(--theme-transition);
}

.form-group input,
.form-group textarea {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 0.8rem 1rem;
    color: var(--text-color);
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
    transition: all 0.3s ease, var(--theme-transition);
}

[data-theme="light"] .form-group input,
[data-theme="light"] .form-group textarea {
    background: rgba(0, 0, 0, 0.02);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-color);
    opacity: 0.4;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px oklch(0.68 0.18 145 / 0.15);
    background: rgba(255, 255, 255, 0.06);
}

[data-theme="light"] .form-group input:focus,
[data-theme="light"] .form-group textarea:focus {
    box-shadow: 0 0 0 3px oklch(0.6 0.18 145 / 0.1);
    background: rgba(255, 255, 255, 0.95);
}

.form-group textarea {
    resize: none;
    height: 100px;
}

#contact-submit {
    background: var(--text-color);
    color: var(--bg-color);
    border: none;
    padding: 1rem;
    font-size: 1rem;
    font-weight: 700;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), var(--theme-transition);
    margin-top: 0.5rem;
}

#contact-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

[data-theme="light"] #contact-submit:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

#contact-submit:active {
    transform: scale(0.98);
}

.form-status {
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
    padding: 0.8rem;
    border-radius: 8px;
    display: none;
    animation: popIn 0.3s ease;
}

.form-status.success {
    display: block;
    background: oklch(0.85 0.15 140 / 0.15);
    color: oklch(0.65 0.15 140);
    border: 1px solid oklch(0.65 0.15 140 / 0.3);
}

.form-status.error {
    display: block;
    background: oklch(0.85 0.15 20 / 0.15);
    color: oklch(0.65 0.15 20);
    border: 1px solid oklch(0.65 0.15 20 / 0.3);
}

/* Comments Container Styling */
.comments-container {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 3rem 2.5rem 2.5rem 2.5rem;
    border-radius: 28px;
    box-shadow: var(--shadow);
    border: 1px solid var(--card-border);
    max-width: 680px;
    width: 90%;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), var(--theme-transition);
    text-align: left;
    box-sizing: border-box;
}

.comments-container:hover {
    transform: translateY(-5px);
}

.comments-container h2 {
    font-size: 1.6rem;
    font-weight: 800;
    margin-top: 0;
    margin-bottom: 1.8rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.03em;
    transition: var(--theme-transition);
}

/* Navigation Tabs Styling */
.nav-tabs {
    display: flex;
    gap: 0.4rem;
    justify-content: flex-start;
    margin-bottom: 2.5rem;
    padding: 0.4rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    overflow-x: auto;
    scrollbar-width: none; /* Firefox */
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
}

.nav-tabs::-webkit-scrollbar {
    display: none; /* Safari and Chrome */
}

[data-theme="light"] .nav-tabs {
    background: rgba(0, 0, 0, 0.02);
}

.tab-btn {
    background: transparent;
    border: none;
    padding: 0.75rem 1.2rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-color);
    opacity: 0.65;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.25s ease;
    outline: none;
}

.tab-btn:hover {
    opacity: 0.95;
    background: rgba(255, 255, 255, 0.04);
}

[data-theme="light"] .tab-btn:hover {
    background: rgba(0, 0, 0, 0.03);
}

.tab-btn.active {
    opacity: 1;
    background: rgba(255, 255, 255, 0.09);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    color: var(--primary-color);
}

[data-theme="light"] .tab-btn.active {
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

/* Tab content section fade-in transition */
.tab-content {
    animation: fadeInTab 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

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

/* Encyclopedia Grid & Cards Styling */
.encyclopedia-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
    text-align: left;
}

.section-help {
    font-size: 0.95rem;
    opacity: 0.75;
    line-height: 1.6;
    margin-top: -0.5rem;
    margin-bottom: 2rem;
    text-align: left;
}

.animal-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 1.6rem;
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    box-sizing: border-box;
}

[data-theme="light"] .animal-card {
    background: rgba(0, 0, 0, 0.01);
}

.animal-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.animal-card h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-top: 0;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--card-border);
}

.animal-card p {
    font-size: 0.88rem;
    line-height: 1.55;
    opacity: 0.8;
    margin: 0.6rem 0;
}

.animal-card strong {
    font-weight: 700;
    color: var(--text-color);
}

/* Custom visual identity border accents matching progress bar themes */
.dog-theme {
    border-top: 4px solid oklch(0.75 0.15 85);
    background: linear-gradient(180deg, oklch(0.75 0.15 85 / 0.02) 0%, rgba(255, 255, 255, 0.01) 100%);
}
.cat-theme {
    border-top: 4px solid oklch(0.65 0.22 320);
    background: linear-gradient(180deg, oklch(0.65 0.22 320 / 0.02) 0%, rgba(255, 255, 255, 0.01) 100%);
}
.fox-theme {
    border-top: 4px solid oklch(0.7 0.2 45);
    background: linear-gradient(180deg, oklch(0.7 0.2 45 / 0.02) 0%, rgba(255, 255, 255, 0.01) 100%);
}
.rabbit-theme {
    border-top: 4px solid oklch(0.75 0.18 350);
    background: linear-gradient(180deg, oklch(0.75 0.18 350 / 0.02) 0%, rgba(255, 255, 255, 0.01) 100%);
}
.bear-theme {
    border-top: 4px solid oklch(0.55 0.12 120);
    background: linear-gradient(180deg, oklch(0.55 0.12 120 / 0.02) 0%, rgba(255, 255, 255, 0.01) 100%);
}
.dino-theme {
    border-top: 4px solid oklch(0.65 0.15 170);
    background: linear-gradient(180deg, oklch(0.65 0.15 170 / 0.02) 0%, rgba(255, 255, 255, 0.01) 100%);
}

/* About Section & Technology Cards styling */
.about-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 2.2rem;
    text-align: left;
    margin-top: 1.5rem;
    box-sizing: border-box;
}

[data-theme="light"] .about-card {
    background: rgba(0, 0, 0, 0.01);
}

.about-card h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-top: 1.6rem;
    margin-bottom: 0.6rem;
    color: var(--primary-color);
}

.about-card h3:first-of-type {
    margin-top: 0;
}

.about-card p {
    font-size: 0.92rem;
    line-height: 1.65;
    opacity: 0.8;
    margin: 0 0 1.2rem 0;
}

.about-card p:last-of-type {
    margin-bottom: 0;
}

/* GDPR Privacy & Compliance Sections */
.compliance-article {
    text-align: left;
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.6rem;
}

.compliance-article h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
    color: var(--primary-color);
}

.compliance-article p {
    font-size: 0.9rem;
    line-height: 1.65;
    opacity: 0.8;
    margin: 0;
}

.compliance-article strong {
    color: var(--text-color);
}

/* Elegant designated Google AdSense slots */
.adsense-slot {
    margin: 1.8rem 0;
    padding: 1.2rem;
    background: rgba(255, 255, 255, 0.015);
    border: 1px dashed var(--card-border);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    box-sizing: border-box;
    transition: var(--theme-transition);
}

[data-theme="light"] .adsense-slot {
    background: rgba(0, 0, 0, 0.008);
}

.adsense-top {
    margin-top: 0;
    margin-bottom: 2rem;
}

.adsense-bottom {
    margin-top: 2rem;
    margin-bottom: 0;
}

.ad-label {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    opacity: 0.35;
    text-transform: uppercase;
}

.ad-mock-placeholder {
    font-size: 0.8rem;
    opacity: 0.55;
    text-align: center;
    padding: 1.6rem 1rem;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.025);
    width: 100%;
    box-sizing: border-box;
    border: 1px solid rgba(255, 255, 255, 0.02);
}

[data-theme="light"] .ad-mock-placeholder {
    background: rgba(0, 0, 0, 0.015);
    border-color: rgba(0, 0, 0, 0.01);
}

/* Settings Utility and History Card Styling */
.settings-divider {
    height: 1px;
    background: var(--card-border);
    margin: 1.5rem 0;
}

.utility-controls {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.control-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.control-label {
    font-size: 0.9rem;
    font-weight: 600;
    opacity: 0.85;
}

.util-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.2s ease;
    outline: none;
}

[data-theme="light"] .util-btn {
    background: rgba(0, 0, 0, 0.03);
}

.util-btn:hover {
    background: var(--primary-color);
    color: var(--btn-text-color);
    border-color: var(--primary-color);
}

.danger-btn {
    color: oklch(0.65 0.15 20);
    border-color: oklch(0.65 0.15 20 / 0.3);
}

.danger-btn:hover {
    background: oklch(0.65 0.15 20);
    color: white;
    border-color: oklch(0.65 0.15 20);
}

.history-card {
    margin-top: 2.5rem;
    text-align: left;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 1.8rem;
    box-sizing: border-box;
}

[data-theme="light"] .history-card {
    background: rgba(0, 0, 0, 0.01);
}

.history-card h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-top: 0;
    margin-bottom: 1.2rem;
    color: var(--primary-color);
    border-bottom: 1px solid var(--card-border);
    padding-bottom: 0.6rem;
}

.no-history {
    font-size: 0.9rem;
    opacity: 0.5;
    text-align: center;
    margin: 1rem 0;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.history-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.8rem 1rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    transition: all 0.25s ease;
}

[data-theme="light"] .history-item {
    background: rgba(0, 0, 0, 0.005);
}

.history-item:hover {
    transform: translateX(3px);
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--primary-color);
}

[data-theme="light"] .history-item:hover {
    background: rgba(0, 0, 0, 0.015);
}

.history-thumb {
    width: 42px;
    height: 42px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid var(--card-border);
}

.history-details {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
}

.history-label {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text-color);
}

.history-date {
    font-size: 0.75rem;
    opacity: 0.5;
}

/* ==========================================
 * GDPR Consent Management Platform (CMP) Modal
 * ========================================== */
.cmp-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    animation: fadeIn 0.3s ease;
}

.cmp-card {
    background: var(--card-bg);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid var(--card-border);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4);
    border-radius: 24px;
    padding: 2.2rem;
    max-width: 560px;
    width: 90%;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    animation: slideUpPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.15) both;
}

[data-theme="light"] .cmp-card {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.cmp-header {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    color: var(--primary-color);
}

.cmp-header h2 {
    font-size: 1.3rem;
    font-weight: 800;
    margin: 0;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.cmp-icon {
    flex-shrink: 0;
    color: var(--primary-color);
}

.cmp-body p {
    font-size: 0.88rem;
    line-height: 1.6;
    margin: 0 0 1rem 0;
    opacity: 0.85;
}

.cmp-options {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
    border-top: 1px solid var(--card-border);
    padding-top: 1rem;
}

.cmp-options.expanded {
    max-height: 400px;
    opacity: 1;
    overflow-y: auto;
}

.cmp-option-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 0.8rem 1rem;
}

[data-theme="light"] .cmp-option-item {
    background: rgba(0, 0, 0, 0.015);
}

.cmp-option-info {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    flex: 1;
}

.cmp-option-title {
    font-size: 0.88rem;
    font-weight: 700;
}

.cmp-option-desc {
    font-size: 0.72rem;
    opacity: 0.55;
    line-height: 1.4;
}

/* Premium toggle sliders */
.switch-container {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.switch-container input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--card-border);
    transition: .3s;
    border-radius: 24px;
}

[data-theme="light"] .slider {
    background-color: rgba(0, 0, 0, 0.05);
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

[data-theme="light"] .slider:before {
    background-color: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.switch-container input:checked + .slider {
    background-color: var(--primary-color);
}

.switch-container input:checked + .slider:before {
    transform: translateX(20px);
}

.cmp-footer {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 0.5rem;
}

.cmp-primary-buttons {
    display: flex;
    gap: 1rem;
}

.cmp-secondary-buttons {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.cmp-btn {
    flex: 1;
    border: none;
    padding: 0.9rem;
    font-size: 0.9rem;
    font-weight: 700;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
    outline: none;
}

.cmp-btn.primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--btn-text-color);
}

.cmp-btn.primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px oklch(0.68 0.18 145 / 0.3);
}

[data-theme="light"] .cmp-btn.primary:hover {
    box-shadow: 0 4px 15px oklch(0.6 0.18 145 / 0.25);
}

.cmp-btn.secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    color: var(--text-color);
}

[data-theme="light"] .cmp-btn.secondary {
    background: rgba(0, 0, 0, 0.02);
}

.cmp-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.09);
}

[data-theme="light"] .cmp-btn.secondary:hover {
    background: rgba(0, 0, 0, 0.04);
}

/* Footer link formatting */
.footer-separator {
    opacity: 0.3;
    font-size: 0.8rem;
    align-self: center;
}

.cmp-toggle {
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    opacity: 0.85;
}

.cmp-toggle:hover {
    opacity: 1;
    text-shadow: 0 0 10px oklch(0.68 0.18 145 / 0.25);
    transform: translateY(-1px);
}
