/* ==========================================================
   STYLE.CSS - PEMBEDA REMPAH INDONESIA
   Tema: Nuansa Rempah Nusantara (Dark Mode Default + Light Mode Support)
   ========================================================== */

/* --- CSS Variables: Dark Mode (Default) --- */
:root, [data-theme="dark"] {
    --bg-base: #0b120e;
    --bg-surface: #131d17;
    --bg-surface-elevated: #192720;
    --bg-gradient-1: rgba(245, 158, 11, 0.07);
    --bg-gradient-2: rgba(16, 185, 129, 0.07);

    --card-bg: rgba(19, 29, 23, 0.88);
    --card-border: rgba(255, 255, 255, 0.08);
    --card-border-focus: rgba(245, 158, 11, 0.35);

    --primary-green: #10b981;
    --primary-green-light: #34d399;
    --primary-green-dark: #064e3b;

    --kunyit-gold: #f59e0b;
    --kunyit-gold-light: #fbbf24;
    --kunyit-amber: #d97706;

    --spice-brown: #d97706;
    --spice-brown-light: #f59e0b;
    --spice-brown-dark: #ffffff;

    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --text-light: #6b7280;

    --pill-bg: rgba(245, 158, 11, 0.12);
    --pill-border: rgba(245, 158, 11, 0.28);
    --pill-text: #fbbf24;

    --model-badge-bg: #16241c;
    --model-badge-border: rgba(255, 255, 255, 0.08);
    --model-badge-text: #9ca3af;

    --match-card-bg: linear-gradient(135deg, #182820, #14221b);
    --match-card-border: rgba(245, 158, 11, 0.35);
    --match-icon-bg: #1e3226;
    --match-icon-border: rgba(245, 158, 11, 0.2);
    --match-title: #ffffff;

    --predictions-bg: #15221b;
    --pred-item-bar-bg: #1f3026;
    --pred-name-color: #f3f4f6;
    --pred-pct-color: #fbbf24;

    --btn-sec-bg: #22352b;
    --btn-sec-text: #f3f4f6;
    --btn-sec-hover: #2c4437;

    --btn-outline-bg: #17261e;
    --btn-outline-border: rgba(255, 255, 255, 0.12);
    --btn-outline-text: #f3f4f6;
    --btn-outline-hover: #22352b;

    --tip-bg: rgba(245, 158, 11, 0.08);
    --tip-border: #f59e0b;
    --tip-text: #d1d5db;

    --info-card-bg: rgba(16, 185, 129, 0.08);
    --info-card-border: rgba(16, 185, 129, 0.22);
    --info-title: #34d399;
    --tag-bg: #1a2d23;
    --tag-border: rgba(16, 185, 129, 0.3);
    --tag-text: #6ee7b7;

    --theme-toggle-bg: #18261e;
    --theme-toggle-border: rgba(245, 158, 11, 0.3);
    --theme-toggle-text: #fbbf24;
    --theme-toggle-hover: #23372c;

    --shadow-card: 0 20px 40px -10px rgba(0, 0, 0, 0.5), 0 0 1px rgba(255, 255, 255, 0.1);
    --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.3);
    
    --decor-opacity: 0.18;
}

/* --- CSS Variables: Light Mode --- */
[data-theme="light"] {
    --bg-base: #faf7f2;
    --bg-surface: #ffffff;
    --bg-surface-elevated: #f3ede2;
    --bg-gradient-1: rgba(245, 158, 11, 0.06);
    --bg-gradient-2: rgba(26, 77, 54, 0.06);

    --card-bg: #ffffff;
    --card-border: rgba(92, 56, 28, 0.12);
    --card-border-focus: rgba(230, 138, 0, 0.35);

    --primary-green: #1a4d36;
    --primary-green-light: #246a4a;
    --primary-green-dark: #0f3021;

    --kunyit-gold: #e68a00;
    --kunyit-gold-light: #f59e0b;
    --kunyit-amber: #d97706;

    --spice-brown: #5c381c;
    --spice-brown-light: #7c4c26;
    --spice-brown-dark: #3a2211;

    --text-main: #2b1f17;
    --text-muted: #6b5c52;
    --text-light: #9e8d82;

    --pill-bg: rgba(230, 138, 0, 0.12);
    --pill-border: rgba(230, 138, 0, 0.25);
    --pill-text: #5c381c;

    --model-badge-bg: #ffffff;
    --model-badge-border: rgba(92, 56, 28, 0.12);
    --model-badge-text: #6b5c52;

    --match-card-bg: linear-gradient(135deg, #fef8ee, #fbf2e3);
    --match-card-border: rgba(230, 138, 0, 0.3);
    --match-icon-bg: #ffffff;
    --match-icon-border: rgba(230, 138, 0, 0.15);
    --match-title: #3a2211;

    --predictions-bg: #ffffff;
    --pred-item-bar-bg: #f1ede8;
    --pred-name-color: #2b1f17;
    --pred-pct-color: #5c381c;

    --btn-sec-bg: #e5e7eb;
    --btn-sec-text: #2b1f17;
    --btn-sec-hover: #d1d5db;

    --btn-outline-bg: #ffffff;
    --btn-outline-border: rgba(92, 56, 28, 0.15);
    --btn-outline-text: #5c381c;
    --btn-outline-hover: #f5ede0;

    --tip-bg: rgba(245, 158, 11, 0.08);
    --tip-border: #e68a00;
    --tip-text: #6b5c52;

    --info-card-bg: rgba(26, 77, 54, 0.05);
    --info-card-border: rgba(26, 77, 54, 0.18);
    --info-title: #0f3021;
    --tag-bg: #ffffff;
    --tag-border: rgba(26, 77, 54, 0.18);
    --tag-text: #1a4d36;

    --theme-toggle-bg: #f5ede0;
    --theme-toggle-border: rgba(92, 56, 28, 0.15);
    --theme-toggle-text: #5c381c;
    --theme-toggle-hover: #eadccb;

    --shadow-card: 0 15px 35px -5px rgba(43, 31, 23, 0.08), 0 0 1px rgba(43, 31, 23, 0.1);
    --shadow-soft: 0 10px 30px rgba(92, 56, 28, 0.06);
    
    --decor-opacity: 0.45;
}

/* --- Global Tokens --- */
:root {
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;

    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-full: 9999px;

    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.2s ease, box-shadow 0.3s ease;
}

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: var(--bg-base);
    background-image: 
        radial-gradient(at 0% 0%, var(--bg-gradient-1) 0px, transparent 50%),
        radial-gradient(at 100% 100%, var(--bg-gradient-2) 0px, transparent 50%);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    line-height: 1.6;
}

/* Background Animated / Soft Decor Elements */
.background-decorations {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.decor-circle {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    opacity: var(--decor-opacity);
}

.circle-1 {
    width: 420px;
    height: 420px;
    background: radial-gradient(circle, var(--kunyit-gold), var(--kunyit-amber));
    top: -100px;
    right: -100px;
}

.circle-2 {
    width: 480px;
    height: 480px;
    background: radial-gradient(circle, var(--primary-green), var(--primary-green-dark));
    bottom: -140px;
    left: -140px;
}

.decor-leaf {
    position: absolute;
    color: var(--primary-green);
    font-size: 140px;
    opacity: 0.05;
    z-index: 0;
}

.leaf-1 {
    top: 12%;
    left: 4%;
    transform: rotate(-25deg);
}

.leaf-2 {
    bottom: 12%;
    right: 5%;
    transform: rotate(35deg);
}

/* Main Container */
.app-container {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 20px 48px;
}

/* --- Top Navigation Bar (Theme Switcher) --- */
.top-nav-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding: 8px 0;
}

.app-brand-mini {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-main);
    letter-spacing: 0.3px;
}

.brand-icon-wrapper {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-sm);
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid var(--pill-border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--kunyit-gold);
    font-size: 0.95rem;
}

.app-brand-mini strong {
    color: var(--kunyit-gold);
}

/* Theme Toggle Button */
.theme-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    background: var(--theme-toggle-bg);
    border: 1px solid var(--theme-toggle-border);
    color: var(--theme-toggle-text);
    padding: 8px 16px;
    border-radius: var(--radius-full);
    font-family: inherit;
    font-size: 0.86rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: var(--transition-smooth);
    user-select: none;
}

.theme-toggle-btn:hover {
    background: var(--theme-toggle-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.18);
}

.theme-icon-box {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
}

.theme-toggle-btn:hover #theme-icon {
    transform: rotate(20deg);
    transition: transform 0.3s ease;
}

/* --- Header Section --- */
.app-header {
    text-align: center;
    margin-bottom: 36px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.badge-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--pill-bg);
    color: var(--pill-text);
    border: 1px solid var(--pill-border);
    padding: 6px 16px;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    animation: fadeInDown 0.6s ease;
}

.badge-pill i {
    color: var(--kunyit-gold);
}

.main-title {
    font-family: 'Playfair Display', serif;
    font-size: 2.8rem;
    font-weight: 700;
    color: var(--spice-brown-dark);
    letter-spacing: -0.5px;
    line-height: 1.2;
}

.main-title span {
    color: var(--primary-green-light);
    position: relative;
    display: inline-block;
}

.main-title span::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 0;
    width: 100%;
    height: 6px;
    background: rgba(245, 158, 11, 0.35);
    border-radius: 4px;
    z-index: -1;
}

.subtitle {
    font-size: 1.05rem;
    color: var(--text-muted);
    max-width: 680px;
    margin: 0 auto;
}

.model-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--model-badge-bg);
    border: 1px solid var(--model-badge-border);
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    color: var(--model-badge-text);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-top: 4px;
}

.model-badge i {
    color: var(--kunyit-gold);
}

.model-badge strong {
    color: var(--primary-green-light);
}

/* --- Main Card Layout --- */
.main-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    padding: 32px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.grid-layout {
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    gap: 32px;
}

/* Section Header */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--card-border);
}

.section-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title i {
    font-size: 1.25rem;
    color: var(--kunyit-gold);
    background: rgba(245, 158, 11, 0.12);
    padding: 8px;
    border-radius: var(--radius-sm);
}

.section-title h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--spice-brown-dark);
}

/* Status Indicators */
.status-dot-wrapper {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--bg-surface-elevated);
    border: 1px solid var(--card-border);
    padding: 4px 10px;
    border-radius: var(--radius-full);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--text-light);
}

.status-dot-wrapper.active .status-dot {
    background-color: var(--success);
    box-shadow: 0 0 8px var(--success);
    animation: pulseDot 1.5s infinite;
}

.status-dot-wrapper.active .status-label {
    color: var(--primary-green-light);
}

.live-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    animation: pulseDot 1.8s infinite;
}

/* --- Camera Viewport --- */
.viewport-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    background: #090e0b;
    border-radius: var(--radius-md);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 0 25px rgba(0,0,0,0.6);
    border: 2px solid var(--card-border);
}

/* Brackets Overlay */
.corner-bracket {
    position: absolute;
    width: 24px;
    height: 24px;
    border: 3px solid var(--kunyit-gold);
    z-index: 5;
    pointer-events: none;
}

.top-left {
    top: 12px;
    left: 12px;
    border-right: none;
    border-bottom: none;
    border-top-left-radius: 4px;
}

.top-right {
    top: 12px;
    right: 12px;
    border-left: none;
    border-bottom: none;
    border-top-right-radius: 4px;
}

.bottom-left {
    bottom: 12px;
    left: 12px;
    border-right: none;
    border-top: none;
    border-bottom-left-radius: 4px;
}

.bottom-right {
    bottom: 12px;
    right: 12px;
    border-left: none;
    border-top: none;
    border-bottom-right-radius: 4px;
}

/* Laser Scan Animation */
.scan-laser {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--kunyit-gold), #fff, var(--kunyit-gold), transparent);
    box-shadow: 0 0 15px var(--kunyit-gold);
    z-index: 6;
    opacity: 0;
    pointer-events: none;
}

.scan-laser.scanning {
    opacity: 1;
    animation: scanAnimation 2.2s ease-in-out infinite alternate;
}

/* Video / Image Containers */
.webcam-box {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.webcam-box canvas,
.webcam-box video {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
    border-radius: calc(var(--radius-md) - 2px);
}

.image-box {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
}

.image-box img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Idle State Placeholder */
.idle-placeholder {
    position: absolute;
    inset: 0;
    background: linear-gradient(145deg, #121c17, #0a110d);
    color: #e5e7eb;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 24px;
    z-index: 2;
    transition: var(--transition-smooth);
}

.icon-pulse {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: rgba(245, 158, 11, 0.15);
    color: var(--kunyit-gold);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin-bottom: 16px;
    border: 1px solid rgba(245, 158, 11, 0.35);
    animation: iconFloat 3s ease-in-out infinite;
}

.idle-placeholder h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 8px;
}

.idle-placeholder p {
    font-size: 0.9rem;
    color: #9ca3af;
    max-width: 320px;
    line-height: 1.5;
}

/* Loading Overlay */
.loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(10, 17, 13, 0.88);
    backdrop-filter: blur(6px);
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition-smooth);
}

.loading-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.spinner {
    width: 44px;
    height: 44px;
    border: 4px solid rgba(245, 158, 11, 0.2);
    border-top: 4px solid var(--kunyit-gold);
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
    margin-bottom: 14px;
}

/* --- Control Buttons --- */
.controls-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-top: 18px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    outline: none;
    transition: var(--transition-smooth);
    user-select: none;
}

.btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-primary {
    background: linear-gradient(135deg, #059669, #047857);
    color: #ffffff;
    flex: 1;
    min-width: 140px;
    box-shadow: 0 4px 14px rgba(5, 150, 105, 0.35);
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #10b981, #059669);
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(16, 185, 129, 0.45);
}

.btn-secondary {
    background: var(--btn-sec-bg);
    color: var(--btn-sec-text);
    border: 1px solid var(--card-border);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--btn-sec-hover);
    transform: translateY(-1px);
}

.btn-icon {
    padding: 12px 16px;
    background: var(--btn-outline-bg);
    color: var(--kunyit-gold);
    border: 1px solid var(--card-border);
}

.btn-icon:hover:not(:disabled) {
    background: var(--btn-sec-hover);
    color: var(--kunyit-gold-light);
}

.btn-outline {
    background: var(--btn-outline-bg);
    color: var(--btn-outline-text);
    border: 1px solid var(--btn-outline-border);
}

.btn-outline:hover {
    background: var(--btn-outline-hover);
    border-color: var(--kunyit-gold);
    transform: translateY(-1px);
}

/* Tip Box */
.tip-box {
    margin-top: 16px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: var(--tip-bg);
    border-left: 3px solid var(--tip-border);
    padding: 12px 14px;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-size: 0.85rem;
    color: var(--tip-text);
}

.tip-box i {
    color: var(--kunyit-amber);
    margin-top: 2px;
    font-size: 1rem;
}

/* --- Right Column: Predictions & Results --- */
.results-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Top Match Card */
.top-match-card {
    background: var(--match-card-bg);
    border: 1.5px solid var(--match-card-border);
    border-radius: var(--radius-md);
    padding: 20px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
    transition: var(--transition-smooth);
}

.match-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: linear-gradient(135deg, var(--kunyit-gold), var(--kunyit-amber));
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 4px 14px;
    border-bottom-left-radius: var(--radius-sm);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.match-content {
    display: flex;
    align-items: center;
    gap: 16px;
}

.match-icon {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-md);
    background: var(--match-icon-bg);
    color: var(--kunyit-gold);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    flex-shrink: 0;
    border: 1px solid var(--match-icon-border);
}

.match-info h3 {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--match-title);
    margin-bottom: 6px;
    line-height: 1.2;
}

.confidence-meter {
    display: flex;
    align-items: center;
    gap: 8px;
}

.confidence-pill {
    background: var(--primary-green);
    color: #fff;
    padding: 2px 10px;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.confidence-text {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Predictions Breakdown List */
.predictions-list-container {
    background: var(--predictions-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 18px 20px;
}

.list-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--kunyit-gold-light);
    margin-bottom: 14px;
    padding-bottom: 8px;
    border-bottom: 1px dashed var(--card-border);
}

.list-heading i {
    color: var(--text-light);
}

.predictions-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 120px;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--text-light);
    padding: 24px 10px;
    gap: 8px;
}

.empty-state i {
    font-size: 24px;
    color: var(--text-light);
}

.empty-state p {
    font-size: 0.85rem;
}

/* Prediction Bar Item */
.pred-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    animation: fadeIn 0.4s ease;
}

.pred-labels {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.88rem;
    font-weight: 600;
}

.pred-name {
    color: var(--pred-name-color);
    display: flex;
    align-items: center;
    gap: 6px;
}

.pred-percentage {
    color: var(--pred-pct-color);
    font-family: monospace;
    font-size: 0.9rem;
    font-weight: 700;
}

.pred-bar-bg {
    width: 100%;
    height: 10px;
    background: var(--pred-item-bar-bg);
    border-radius: var(--radius-full);
    overflow: hidden;
    position: relative;
}

.pred-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--kunyit-gold), var(--primary-green));
    border-radius: var(--radius-full);
    transition: width 0.25s ease-out;
}

/* Highlight item with highest confidence */
.pred-item.is-top .pred-name {
    color: var(--primary-green-light);
    font-weight: 700;
}

.pred-item.is-top .pred-percentage {
    color: var(--kunyit-gold-light);
}

.pred-item.is-top .pred-bar-fill {
    background: linear-gradient(90deg, var(--kunyit-gold), var(--primary-green-light));
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
}

/* --- Spice Info Card --- */
.spice-info-card {
    background: var(--info-card-bg);
    border: 1px solid var(--info-card-border);
    border-radius: var(--radius-md);
    padding: 16px 18px;
    animation: fadeInUp 0.4s ease;
}

.info-header {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--info-title);
    margin-bottom: 8px;
}

.info-header i {
    color: var(--kunyit-gold);
    font-size: 1.1rem;
}

.info-header h4 {
    font-size: 0.95rem;
    font-weight: 700;
}

.info-body p {
    font-size: 0.86rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 10px;
}

.info-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.info-tags .tag {
    background: var(--tag-bg);
    border: 1px solid var(--tag-border);
    color: var(--tag-text);
    padding: 3px 9px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* --- Footer --- */
.app-footer {
    text-align: center;
    margin-top: 36px;
    color: var(--text-muted);
    font-size: 0.88rem;
}

.app-footer p {
    margin-bottom: 4px;
}

.copyright {
    font-size: 0.8rem;
    color: var(--text-light);
}

/* --- Toast Notification --- */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #111827;
    color: #ffffff;
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    box-shadow: 0 10px 25px rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    z-index: 999;
    transform: translateY(100px);
    opacity: 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast.error {
    background: #7f1d1d;
    border-left: 4px solid #ef4444;
}

.toast.success {
    background: #064e3b;
    border-left: 4px solid #10b981;
}

/* --- Keyframe Animations --- */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes scanAnimation {
    0% { top: 4%; }
    100% { top: 94%; }
}

@keyframes pulseDot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.85); }
}

@keyframes iconFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

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

/* --- Responsive Media Queries --- */
@media (max-width: 900px) {
    .grid-layout {
        grid-template-columns: 1fr;
        gap: 28px;
    }
    
    .main-card {
        padding: 24px;
    }

    .main-title {
        font-size: 2.2rem;
    }
}

@media (max-width: 600px) {
    .app-container {
        padding: 16px 14px 36px;
    }

    .main-title {
        font-size: 1.8rem;
    }

    .subtitle {
        font-size: 0.95rem;
    }

    .main-card {
        padding: 18px;
        border-radius: var(--radius-md);
    }

    .controls-group {
        flex-direction: column;
        width: 100%;
    }

    .controls-group .btn {
        width: 100%;
    }

    .viewport-wrapper {
        aspect-ratio: 1 / 1;
    }
}
