/* ========================================
   PhET Simulation - Shared Style CSS
   File ini dipakai bersama oleh semua halaman simulasi
   ======================================== */

/* Reset */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Nunito', sans-serif;
    background: linear-gradient(180deg, #87CEEB 0%, #E0F4FF 50%, #FFF8E7 100%);
    min-height: 100vh;
    overflow-x: hidden;
    user-select: none;
}

/* ========================================
   Header - PhET Style
   ======================================== */
.header {
    background: linear-gradient(180deg, #4A90A4 0%, #2E6B7F 100%);
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    border-bottom: 4px solid #1E4A5A;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    font-size: 32px;
    width: 40px;
    height: 40px;
    color: #FFE066;
}

.logo h1 {
    color: #FFE066;
    font-size: 1.5rem;
    font-weight: 800;
    text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.3);
}

.subtitle {
    color: #B8E0EC;
    font-size: 0.9rem;
}

/* ========================================
   Main Container - Flex Layout
   ======================================== */
.main-container {
    display: flex;
    gap: 16px;
    padding: 16px;
    max-width: 1400px;
    margin: 0 auto;
}

/* ========================================
   Panel Base Style - PhET Cartoon Look
   ======================================== */
.panel {
    background: linear-gradient(180deg, #FFFEF5 0%, #F5EDD8 100%);
    border: 4px solid #8B7355;
    border-radius: 20px;
    box-shadow:
        0 6px 0 #6B5344,
        0 8px 16px rgba(0, 0, 0, 0.2),
        inset 0 2px 4px rgba(255, 255, 255, 0.8);
    overflow: hidden;
}

.panel-header {
    background: linear-gradient(180deg, #FFB347 0%, #FF8C00 100%);
    padding: 10px 16px;
    border-bottom: 3px solid #CC6600;
    text-align: center;
}

.panel-header h2 {
    color: #FFF;
    font-size: 1rem;
    font-weight: 700;
    text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.3);
    margin: 0;
}

.panel-title {
    background: linear-gradient(180deg, #FFB347 0%, #FF8C00 100%);
    padding: 10px 16px;
    border-bottom: 3px solid #CC6600;
    text-align: center;
    color: #FFF;
    font-size: 1rem;
    font-weight: 700;
    text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.3);
    margin: -24px -24px 16px -24px;
}

.panel-content {
    padding: 16px;
}

/* ========================================
   Left Panel - Controls
   ======================================== */
.control-panel {
    width: 300px;
    flex-shrink: 0;
}

/* ========================================
   Center Panel - Simulation
   ======================================== */
.simulation-panel {
    flex: 1;
    min-width: 400px;
}

.canvas-container {
    width: 100%;
    aspect-ratio: 4/3;
    background: linear-gradient(180deg, #E8F4FF 0%, #D0E8F8 100%);
    border-radius: 12px;
    border: 3px solid #7BA3C4;
    overflow: hidden;
    position: relative;
}

#simulationCanvas {
    width: 100%;
    height: 100%;
    cursor: pointer;
}

/* ========================================
   Right Panel - Info
   ======================================== */
.info-panel {
    width: 280px;
    flex-shrink: 0;
}

/* ========================================
   Right Column - Horizontal Layout
   ======================================== */
.right-column {
    display: flex;
    flex: 1;
    gap: 16px;
    min-width: 0;
}

/* ========================================
   Batik Reference Section
   ======================================== */
.batik-reference {
    margin-bottom: 16px;
}

.batik-thumbnails,
.thumbnail-selector {
    display: flex;
    gap: 6px;
    margin-bottom: 10px;
}

.batik-thumb,
.thumbnail {
    flex: 1;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 3px solid #CCC;
    transition: all 0.15s ease;
    background: #EEE;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.batik-thumb:hover,
.thumbnail:hover {
    border-color: #FFB347;
    transform: scale(1.05);
}

.batik-thumb.active,
.thumbnail.active {
    border-color: #FF8C00;
    box-shadow: 0 0 0 3px rgba(255, 140, 0, 0.3);
}

.batik-thumb img,
.thumbnail img,
.thumb-img {
    width: 100%;
    height: auto;
    object-fit: cover;
}

.batik-thumb span,
.thumbnail span {
    display: block;
    text-align: center;
    font-size: 0.65rem;
    color: #666;
    padding: 2px;
    background: rgba(255, 255, 255, 0.9);
}

.batik-main-display {
    width: 100%;
    aspect-ratio: 4/3;
    border-radius: 10px;
    overflow: hidden;
    border: 3px solid #8B7355;
    background: #F5F5DC;
}

.batik-main-display img,
.batik-main-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ========================================
   Layer Selection - Interactive Strips
   ======================================== */
.layer-section,
.layer-strips-container {
    margin-bottom: 16px;
}

.section-title,
.layer-title {
    color: #5D4E37;
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-align: center;
}

.layer-strips {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.layer-strip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: #FFF;
    border: 2px solid #CCC;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.layer-strip:hover {
    transform: scale(1.02);
    border-color: #FFB347;
    box-shadow: 0 2px 8px rgba(255, 179, 71, 0.4);
}

.layer-strip.active {
    border-color: #FF8C00;
    background: linear-gradient(90deg, #FFF5E6 0%, #FFE8CC 100%);
    box-shadow: 0 0 0 3px rgba(255, 140, 0, 0.3);
}

.layer-strip.matched {
    border-color: #4CAF50;
    background: linear-gradient(90deg, #E8F5E9 0%, #C8E6C9 100%);
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.3);
}

.layer-number,
.layer-number-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #666;
    min-width: 50px;
}

.layer-color-box {
    width: 100%;
    height: 24px;
    border-radius: 4px;
    border: 1px solid rgba(0, 0, 0, 0.2);
    flex: 1;
}

/* Target Selector */
.target-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    padding: 12px;
    background: #FFF;
    border: 2px solid #DDD;
    border-radius: 8px;
}

.target-label {
    font-size: 0.85rem;
    color: #555;
    font-weight: 600;
}

.layer-select {
    flex: 1;
    padding: 8px 12px;
    border-radius: 8px;
    border: 2px solid #CCC;
    background: #FFF;
    font-family: inherit;
    font-size: 0.85rem;
    cursor: pointer;
}

.layer-select:hover,
.layer-select:focus {
    border-color: #FF8C00;
    outline: none;
}

/* ========================================
   Buttons - PhET Style
   ======================================== */
.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    border: none;
    border-radius: 12px;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.1s ease;
    text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.2);
}

.btn:active {
    transform: translateY(2px);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-primary {
    background: linear-gradient(180deg, #4CAF50 0%, #388E3C 100%);
    color: white;
    border-bottom: 4px solid #2E7D32;
    box-shadow: 0 4px 8px rgba(76, 175, 80, 0.4);
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(180deg, #5CBF60 0%, #43A047 100%);
}

.btn-warning {
    background: linear-gradient(180deg, #FFC107 0%, #FFA000 100%);
    color: #333;
    border-bottom: 4px solid #FF8F00;
    box-shadow: 0 4px 8px rgba(255, 193, 7, 0.4);
}

.btn-danger {
    background: linear-gradient(180deg, #F44336 0%, #D32F2F 100%);
    color: white;
    border-bottom: 4px solid #B71C1C;
    box-shadow: 0 4px 8px rgba(244, 67, 54, 0.4);
}

.btn-secondary,
.reset-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(180deg, #78909C 0%, #546E7A 100%);
    color: white;
    border: none;
    border-bottom: 4px solid #37474F;
    padding: 12px 20px;
    border-radius: 12px;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
}

.reset-btn svg {
    width: 16px;
    height: 16px;
}

.control-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 16px;
}

/* ========================================
   Duration/Timer Controls
   ======================================== */
.duration-control {
    background: #FFF;
    padding: 12px;
    border-radius: 12px;
    border: 2px solid #DDD;
    margin-bottom: 16px;
}

.duration-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.85rem;
    color: #555;
}

.duration-value {
    font-weight: 700;
    color: #FF8C00;
    font-size: 1.1rem;
}

input[type="range"] {
    width: 100%;
    height: 12px;
    border-radius: 6px;
    background: linear-gradient(90deg, #E0E0E0 0%, #BDBDBD 100%);
    outline: none;
    -webkit-appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(180deg, #FFB347 0%, #FF8C00 100%);
    border: 3px solid #FFF;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    cursor: pointer;
}

.timer-display {
    background: linear-gradient(180deg, #263238 0%, #1C1C1C 100%);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    margin-bottom: 16px;
    border: 3px solid #455A64;
}

.timer-value {
    font-size: 2.5rem;
    font-weight: 800;
    color: #4FC3F7;
    font-family: 'Courier New', monospace;
    text-shadow: 0 0 20px rgba(79, 195, 247, 0.5);
}

.timer-label {
    font-size: 0.8rem;
    color: #90A4AE;
    margin-top: 4px;
}

.progress-container {
    height: 16px;
    background: #37474F;
    border-radius: 8px;
    margin-top: 8px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #4FC3F7 0%, #29B6F6 100%);
    border-radius: 8px;
    transition: width 0.1s linear;
}

/* ========================================
   Color Info Cards
   ======================================== */
.color-card {
    background: #FFF;
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 12px;
    border: 2px solid #E0E0E0;
}

.color-card-title {
    font-size: 0.75rem;
    color: #888;
    margin-bottom: 8px;
}

.color-preview {
    display: flex;
    align-items: center;
    gap: 12px;
}

.color-box-large {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    border: 3px solid rgba(0, 0, 0, 0.15);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
    background: #0E2F5E;
}

.color-details {
    flex: 1;
}

.color-layer {
    font-size: 1.1rem;
    font-weight: 700;
    color: #333;
}

/* ========================================
   Gradient Card
   ======================================== */
.gradient-card-top {
    margin-bottom: 1rem;
    padding: 10px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 8px;
    border: 2px solid rgba(139, 115, 85, 0.3);
}

.gradient-header {
    display: flex;
    justify-content: space-between;
    padding: 0 5px 5px 5px;
    font-size: 0.85rem;
    font-weight: 700;
    color: #333;
}

.header-label-left,
.header-label-right {
    font-weight: 800;
}

.gradient-footer {
    text-align: center;
    padding: 8px 0 0 0;
    font-size: 0.9rem;
    font-weight: 700;
    color: #333;
    border-top: 2px solid rgba(0, 0, 0, 0.1);
    margin-top: 5px;
}

.gradient-card-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.gradient-card-full {
    flex: 1;
    overflow: hidden;
    border: 3px solid #333;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    cursor: grab;
}

.gradient-card-full:active {
    cursor: grabbing;
}

.gradient-colors {
    display: flex;
    gap: 0;
    transition: transform 0.3s ease;
}

.color-swatch {
    width: 50px;
    height: 100px;
    border: none;
    border-right: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 0;
    position: relative;
    cursor: default;
    flex-shrink: 0;
}

.color-swatch:last-child {
    border-right: none;
}

.color-swatch::after {
    content: attr(data-index);
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.7rem;
    font-weight: 700;
    color: #000;
    text-shadow: 0 0 4px rgba(255, 255, 255, 0.95);
}

/* Scroll Buttons */
.scroll-btn {
    width: 36px;
    height: 36px;
    background: linear-gradient(180deg, #FFB347 0%, #FF8C00 100%);
    border: none;
    border-bottom: 3px solid #CC6600;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.scroll-btn:hover {
    background: linear-gradient(180deg, #FFC966 0%, #FFB347 100%);
    transform: scale(1.1);
}

.scroll-btn:active {
    transform: translateY(2px);
    border-bottom-width: 1px;
}

.scroll-btn svg {
    width: 16px;
    height: 16px;
}

/* ========================================
   Result Section
   ======================================== */
.result-section {
    padding: 12px;
    background: linear-gradient(180deg, #E8F5E9 0%, #C8E6C9 100%);
    border-radius: 12px;
    border: 2px solid #81C784;
    display: none;
}

.result-section.show {
    display: block;
}

.result-title {
    color: #2E7D32;
    font-weight: 700;
    margin-bottom: 8px;
    text-align: center;
}

.result-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    padding: 4px 0;
}

/* ========================================
   History
   ======================================== */
.history-section {
    margin-top: 16px;
}

.history-list {
    max-height: 150px;
    overflow-y: auto;
}

.history-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    background: #FFF;
    border-radius: 8px;
    margin-bottom: 6px;
    font-size: 0.8rem;
}

.history-color {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    border: 1px solid rgba(0, 0, 0, 0.2);
}

.history-empty {
    text-align: center;
    color: #999;
    font-size: 0.85rem;
    padding: 16px;
}

/* ========================================
   Celebration Modal
   ======================================== */
.celebration-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.celebration-overlay.active {
    display: flex;
}

.celebration-popup {
    background: linear-gradient(180deg, #FFF 0%, #F5F5F5 100%);
    border-radius: 24px;
    padding: 32px;
    text-align: center;
    max-width: 360px;
    border: 4px solid #FFB347;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    animation: popIn 0.4s ease;
}

@keyframes popIn {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }

    70% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.celebration-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.celebration-title {
    color: #FF8C00;
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 8px;
}

.celebration-color-box {
    width: 80px;
    height: 80px;
    border-radius: 16px;
    margin: 16px auto;
    border: 4px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.celebration-details {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin: 16px 0;
}

.celebration-stat {
    text-align: center;
}

.celebration-stat-label {
    font-size: 0.75rem;
    color: #888;
}

.celebration-stat-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: #333;
}

.celebration-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    background: linear-gradient(180deg, #4CAF50 0%, #388E3C 100%);
    color: white;
    border: none;
    border-bottom: 4px solid #2E7D32;
    border-radius: 12px;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    margin-top: 16px;
}

/* ========================================
   Toast Notification
   ======================================== */
.toast-container {
    position: fixed;
    top: 100px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    pointer-events: none;
}

.toast {
    background: linear-gradient(135deg, #4CAF50 0%, #2E7D32 100%);
    color: white;
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.95rem;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    gap: 10px;
    animation: toastSlide 3s ease forwards;
}

.toast-icon {
    font-size: 1.3rem;
}

@keyframes toastSlide {
    0% {
        opacity: 0;
        transform: translateY(-20px);
    }

    10% {
        opacity: 1;
        transform: translateY(0);
    }

    80% {
        opacity: 1;
        transform: translateY(0);
    }

    100% {
        opacity: 0;
        transform: translateY(-20px);
    }
}

/* ========================================
   Simulation Content (Takaranair specific)
   ======================================== */
.simulation-content {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
    width: 100%;
}

.sim-left {
    flex: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.sim-right {
    flex: 1;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 220px;
}

.tools-row {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: rgba(139, 115, 85, 0.15);
    border-radius: 12px;
    width: 100%;
}

.counters-column {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.counter-box {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #FFF;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border: 2px solid #DDD;
    font-size: 0.9rem;
    font-weight: 500;
    color: #555;
}

.counter-icon {
    width: 20px;
    height: 20px;
    border-radius: 4px;
}

.counter-value {
    font-size: 1.2rem;
    font-weight: 800;
    color: #FF8C00;
    min-width: 30px;
    text-align: center;
}

.water-icon {
    width: 20px;
    height: 20px;
    color: #4A90A4;
}

.match-status {
    margin-top: 0.5rem;
    width: 100%;
}

.match-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem;
    background: #FFF;
    border-radius: 12px;
    border: 2px solid #DDD;
}

.match-indicator.matched {
    border-color: #4CAF50;
    background: linear-gradient(90deg, #E8F5E9 0%, #C8E6C9 100%);
}

.match-text {
    font-size: 0.9rem;
    color: #555;
    font-weight: 500;
}

#targetLayerNum {
    font-weight: 800;
    color: #FF8C00;
}

/* ========================================
   Glass/Tools (Takaranair specific)
   ======================================== */
.glass-section {
    display: flex;
    justify-content: center;
    padding: 1rem 0;
    width: 100%;
}

.glass-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
}

.measuring-glass {
    width: 240px;
    height: 220px;
    background: linear-gradient(90deg,
            rgba(255, 255, 255, 0.6) 0%,
            rgba(255, 255, 255, 0.8) 20%,
            rgba(255, 255, 255, 0.6) 50%,
            rgba(255, 255, 255, 0.4) 80%,
            rgba(255, 255, 255, 0.6) 100%);
    border: 3px solid rgba(100, 100, 100, 0.5);
    border-radius: 10px 10px 20px 20px;
    position: relative;
    overflow: hidden;
    box-shadow:
        inset 0 0 30px rgba(255, 255, 255, 0.3),
        0 10px 40px rgba(0, 0, 0, 0.2);
}

.glass-markings {
    position: absolute;
    left: 8px;
    top: 0;
    bottom: 20px;
    z-index: 5;
}

.glass-markings .mark {
    position: absolute;
    font-size: 0.75rem;
    color: rgba(0, 0, 0, 0.5);
    font-weight: 600;
    transform: translateY(50%);
}

.liquid {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 0%;
    background: #0E2F5E;
    transition: all 0.5s ease;
    border-radius: 0 0 18px 18px;
}

.liquid-surface {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 15px;
    background: linear-gradient(180deg,
            rgba(255, 255, 255, 0.4) 0%,
            transparent 100%);
    border-radius: 50%;
}

.glass-reflection {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 20px;
    height: 60%;
    background: linear-gradient(180deg,
            rgba(255, 255, 255, 0.5) 0%,
            rgba(255, 255, 255, 0.2) 30%,
            transparent 100%);
    border-radius: 10px;
}

.glass-label {
    font-size: 0.9rem;
    color: #555;
    font-weight: 600;
}

/* Tools */
.tool {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: transform 0.15s ease;
    position: relative;
}

.tool:hover {
    transform: scale(1.05);
}

.spoon-head {
    width: 60px;
    height: 50px;
    background: linear-gradient(135deg, #C4A574 0%, #8B6914 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow:
        inset 0 -3px 6px rgba(0, 0, 0, 0.3),
        0 4px 8px rgba(0, 0, 0, 0.2);
}

.spoon-content {
    width: 45px;
    height: 35px;
    border-radius: 50%;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.spoon-content.water {
    background: linear-gradient(180deg,
            rgba(126, 190, 255, 0.9) 0%,
            rgba(71, 133, 196, 1) 100%);
    position: relative;
    overflow: hidden;
}

.water-drop {
    position: absolute;
    width: 8px;
    height: 8px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 50%;
    animation: floatDrop 2s ease-in-out infinite;
}

.water-drop:nth-child(1) {
    left: 10px;
    top: 10px;
}

.water-drop:nth-child(2) {
    left: 25px;
    top: 15px;
    animation-delay: 0.5s;
}

.water-drop:nth-child(3) {
    left: 18px;
    top: 20px;
    animation-delay: 1s;
}

@keyframes floatDrop {

    0%,
    100% {
        transform: translateY(0);
        opacity: 0.6;
    }

    50% {
        transform: translateY(-5px);
        opacity: 1;
    }
}

.spoon-handle {
    width: 12px;
    height: 60px;
    background: linear-gradient(90deg, #C4A574 0%, #8B6914 50%, #C4A574 100%);
    border-radius: 0 0 6px 6px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.tool-label {
    font-size: 0.85rem;
    color: #555;
    font-weight: 600;
    text-align: center;
}

.click-hint {
    font-size: 0.75rem;
    color: #FF8C00;
    font-weight: 600;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 0.5;
    }

    50% {
        opacity: 1;
    }
}

.color-spoon {
    opacity: 0.5;
    cursor: not-allowed;
}

.color-spoon.clickable {
    opacity: 1;
    cursor: pointer;
}

.color-spoon.used {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ========================================
   Footer
   ======================================== */
.footer {
    background: linear-gradient(180deg, #2E6B7F 0%, #1E4A5A 100%);
    padding: 12px 20px;
    text-align: center;
    color: #B8E0EC;
    font-size: 0.85rem;
    border-top: 4px solid #1E4A5A;
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 1100px) {
    .main-container {
        flex-direction: column;
    }

    .control-panel,
    .info-panel {
        width: 100%;
    }

    .right-column {
        flex-direction: column;
    }

    .simulation-panel {
        min-width: auto;
    }
}

@media (max-width: 768px) {
    .gradient-card-top {
        padding: 8px;
    }

    .color-swatch {
        width: 30px;
        height: 60px;
    }

    .color-swatch::after {
        font-size: 0.5rem;
    }

    .gradient-header {
        font-size: 0.7rem;
    }

    .gradient-footer {
        font-size: 0.75rem;
    }

    .simulation-content {
        flex-direction: column;
    }

    .sim-right {
        width: 100%;
    }

    .counters-column {
        flex-direction: row;
        justify-content: center;
    }
}

@media (max-width: 600px) {
    .tools-row {
        gap: 1.5rem;
        padding: 0.75rem;
    }
}

/* ========================================
   Toast Notification (JS generated)
   ======================================== */
.toast-notification {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    background: linear-gradient(135deg, #4CAF50 0%, #2E7D32 100%);
    color: white;
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.95rem;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 9999;
}

.toast-notification.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast-notification.toast-info {
    background: linear-gradient(135deg, #2196F3 0%, #1976D2 100%);
}

.toast-notification.toast-warning {
    background: linear-gradient(135deg, #FF9800 0%, #F57C00 100%);
}

.toast-notification.toast-success {
    background: linear-gradient(135deg, #4CAF50 0%, #2E7D32 100%);
}
/* ========================================
   Enhanced Celebration Popup
   ======================================== */
.celebration-popup {
    width: 90%;
    max-width: 360px;
}

.celebration-subtitle {
    color: #666;
    font-size: 0.95rem;
    margin-bottom: 20px;
    line-height: 1.4;
}

.celebration-color-result {
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
}

.celebration-color-box {
    width: 120px;
    height: 120px;
    border-radius: 24px;
    margin: 0;
    border: 5px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.celebration-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.celebration-stat-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    background: linear-gradient(135deg, #F8F9FA 0%, #E9ECEF 100%);
    border-radius: 14px;
    border: 2px solid #DEE2E6;
    transition: all 0.2s ease;
}

.celebration-stat-item:hover {
    border-color: #FFB347;
    background: linear-gradient(135deg, #FFF8E1 0%, #FFECB3 100%);
}

.celebration-stat-item.hidden {
    display: none;
}

.stat-icon {
    font-size: 1.6rem;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 12px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.12);
    flex-shrink: 0;
}

.stat-info {
    flex: 1;
    text-align: left;
}

.stat-label {
    font-size: 0.7rem;
    color: #888;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 2px;
}

.stat-value {
    font-size: 1.15rem;
    font-weight: 800;
    color: #333;
}

.celebration-btn {
    width: 100%;
}

/* ========================================
   Celebration Responsive & Safe Area
   ======================================== */
.celebration-overlay {
    padding: 20px;
    box-sizing: border-box;
}

.celebration-popup {
    max-height: calc(100vh - 40px);
    max-height: calc(100dvh - 40px);
    overflow-y: auto;
    padding: 24px;
}

.celebration-icon {
    font-size: 48px;
    margin-bottom: 8px;
}

.celebration-title {
    font-size: 1.4rem;
    margin-bottom: 4px;
}

.celebration-subtitle {
    font-size: 0.85rem;
    margin-bottom: 14px;
}

.celebration-color-result {
    margin-bottom: 16px;
}

.celebration-color-box {
    width: 90px;
    height: 90px;
    border-radius: 18px;
    border-width: 4px;
}

.celebration-stats {
    gap: 8px;
    margin-bottom: 16px;
}

.celebration-stat-item {
    padding: 10px 14px;
    gap: 10px;
}

.stat-icon {
    font-size: 1.3rem;
    width: 36px;
    height: 36px;
    border-radius: 10px;
}

.stat-label {
    font-size: 0.65rem;
}

.stat-value {
    font-size: 1rem;
}

.celebration-btn {
    padding: 12px 20px;
    font-size: 1rem;
}

/* Small screens */
@media (max-height: 600px) {
    .celebration-popup {
        padding: 16px;
    }
    
    .celebration-icon {
        font-size: 36px;
        margin-bottom: 4px;
    }
    
    .celebration-title {
        font-size: 1.2rem;
    }
    
    .celebration-color-box {
        width: 70px;
        height: 70px;
        border-radius: 14px;
    }
    
    .celebration-color-result {
        margin-bottom: 12px;
    }
    
    .celebration-stats {
        gap: 6px;
        margin-bottom: 12px;
    }
    
    .celebration-stat-item {
        padding: 8px 12px;
    }
    
    .stat-icon {
        width: 32px;
        height: 32px;
        font-size: 1.1rem;
    }
    
    .stat-value {
        font-size: 0.9rem;
    }
    
    .celebration-btn {
        padding: 10px 16px;
        font-size: 0.9rem;
    }
}

/* ========================================
   Gradient Card Active Indicator
   ======================================== */
.gradient-card-full {
    position: relative;
}

.gradient-indicator {
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    transition: left 0.3s ease;
    display: none;
}

.indicator-arrow {
    font-size: 16px;
    color: #FF5722;
    text-shadow: 
        0 0 4px white,
        0 0 8px white,
        0 2px 4px rgba(0,0,0,0.3);
    animation: indicatorPulse 1s ease-in-out infinite;
}

@keyframes indicatorPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.8; }
}

/* Active swatch highlight */
.color-swatch.active {
    box-shadow: 
        inset 0 0 0 3px #FF5722,
        0 0 10px rgba(255, 87, 34, 0.5);
    z-index: 5;
    position: relative;
}

/* Fix Gradient Indicator Positioning */
.gradient-indicator {
    position: absolute;
    top: 0;
    transform: translateX(-50%);
    pointer-events: none;
}

.indicator-arrow {
    display: block;
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 12px solid #FF5722;
    filter: drop-shadow(0 2px 3px rgba(0,0,0,0.3));
}

/* Complete Gradient Indicator Styles - Override */
.gradient-card-full {
    position: relative;
    overflow: visible !important;
}

.gradient-indicator {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    pointer-events: none;
    display: none;
    transition: left 0.4s ease;
}

.indicator-arrow {
    width: 0;
    height: 0;
    border-left: 12px solid transparent;
    border-right: 12px solid transparent;
    border-top: 14px solid #FF5722;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.4));
    animation: indicatorBounce 0.5s ease-in-out infinite alternate;
}

@keyframes indicatorBounce {
    from { transform: translateY(0); }
    to { transform: translateY(-4px); }
}

.color-swatch.active {
    outline: 3px solid #FF5722;
    outline-offset: -3px;
    position: relative;
    z-index: 10;
}

.color-swatch.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 87, 34, 0.2);
    pointer-events: none;
}

/* Fix Gradient Card Scroll - Override visible */
.gradient-card-full {
    overflow: hidden !important;
    position: relative;
}

.gradient-card-wrapper {
    position: relative;
}

/* Move indicator to wrapper level */
.gradient-indicator {
    position: absolute;
    top: -2px;
    z-index: 100;
}

/* Final Gradient Wrapper & Indicator Positioning */
.gradient-card-wrapper {
    position: relative;
    padding-top: 18px;
}

.gradient-indicator {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    pointer-events: none;
    display: none;
    transition: left 0.3s ease-out;
}

.indicator-arrow {
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 12px solid #FF5722;
    filter: drop-shadow(0 2px 3px rgba(0,0,0,0.3));
}

/* FINAL Gradient Indicator - Force Visibility */
.gradient-card-top .gradient-card-wrapper {
    position: relative;
    padding-top: 20px;
}

.gradient-card-top .gradient-indicator {
    position: absolute !important;
    top: 2px !important;
    z-index: 1000 !important;
    pointer-events: none;
    display: none;
    transition: left 0.3s ease-out;
}

.gradient-card-top .gradient-indicator.show {
    display: block !important;
}

.gradient-card-top .indicator-arrow {
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 14px solid #FF5722;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.4));
    animation: arrowBounce 0.6s ease-in-out infinite alternate;
}

@keyframes arrowBounce {
    0% { transform: translateY(0); }
    100% { transform: translateY(3px); }
}

/* Color swatch active state */
.gradient-colors .color-swatch.active {
    outline: 3px solid #FF5722 !important;
    outline-offset: -3px;
    z-index: 10;
    position: relative;
}

/* Match Button Style */
.action-btn.primary-btn {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
}

.action-btn.primary-btn:hover {
    background: linear-gradient(135deg, #45a049, #3d8b40);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
}

.action-btn.primary-btn:active {
    transform: translateY(0);
}

/* Result Info Row in Modal */
.result-info-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
}

.result-info-row span {
    display: inline-block;
}

/* Celebration Modal - Not Match State */
.celebration-icon {
    font-size: 48px;
    margin-bottom: 8px;
}

/* Match Result Badge */
.match-result-badge {
    margin: 16px 0;
    text-align: center;
}

.match-result-badge span {
    display: inline-block;
    padding: 10px 24px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.match-result-badge.success span {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.4);
}

.match-result-badge.failed span {
    background: linear-gradient(135deg, #f44336, #d32f2f);
    color: white;
    box-shadow: 0 4px 15px rgba(244, 67, 54, 0.4);
}

/* History Item Styles */
.history-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    margin-bottom: 8px;
    border-left: 3px solid #666;
    transition: all 0.2s ease;
}

.history-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.history-item.success {
    border-left-color: #4CAF50;
}

.history-item.failed {
    border-left-color: #f44336;
}

.history-color {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.history-info {
    flex: 1;
    min-width: 0;
}

.history-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 2px;
}

.history-status {
    font-size: 12px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
}

.history-status.success {
    background: rgba(76, 175, 80, 0.2);
    color: #4CAF50;
}

.history-status.failed {
    background: rgba(244, 67, 54, 0.2);
    color: #f44336;
}

.history-target {
    font-size: 11px;
    opacity: 0.8;
}

.history-details {
    font-size: 11px;
    opacity: 0.7;
}

.history-empty {
    text-align: center;
    padding: 16px;
    opacity: 0.5;
    font-size: 13px;
}
