/* ============================================================
   INTERACTIVE EXAMPLES STYLES – Flaxon Website
   ============================================================ */

/* ----- Example Container ----- */
.example-container {
    background: #0f172a;
    border-radius: 16px;
    padding: 1.5rem;
    border: 1px solid #1e293b;
    min-height: 400px;
}

.dark .example-container {
    background: #0a0f1a;
}

/* ----- Canvas Example ----- */
#drawing-canvas {
    width: 100%;
    height: 450px;
    background: #0f172a;
    border-radius: 12px;
    border: 1px solid #1e293b;
    cursor: crosshair;
    touch-action: none;
}

#drawing-canvas.dark-mode {
    background: #0a0f1a;
}

.canvas-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1rem;
    padding: 0.75rem;
    background: #1e293b;
    border-radius: 12px;
    border: 1px solid #334155;
}

.canvas-controls input[type="color"] {
    width: 40px;
    height: 40px;
    border: 2px solid #334155;
    border-radius: 8px;
    cursor: pointer;
    background: transparent;
    padding: 2px;
}

.canvas-controls input[type="range"] {
    width: 100px;
    accent-color: #3b82f6;
}

.canvas-controls button {
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    border: 1px solid #334155;
    background: #0f172a;
    color: #e2e8f0;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.85rem;
}

.canvas-controls button:hover {
    background: #334155;
}

.canvas-controls .color-option {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: border 0.2s;
}

.canvas-controls .color-option.active {
    border-color: #60a5fa;
}

#canvas-users {
    font-size: 0.85rem;
    color: #94a3b8;
}

/* ----- E-Commerce Example ----- */
.ecommerce-container {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
}

.ecommerce-product {
    background: #1e293b;
    border-radius: 12px;
    padding: 1rem;
    border: 1px solid #334155;
    transition: all 0.2s;
}

.ecommerce-product:hover {
    border-color: #3b82f6;
}

.ecommerce-product h4 {
    color: #f1f5f9;
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.ecommerce-product .price {
    color: #60a5fa;
    font-weight: 600;
}

.ecommerce-product .stock {
    font-size: 0.8rem;
    color: #94a3b8;
}

.ecommerce-product .stock.in-stock {
    color: #34d399;
}

.ecommerce-product .stock.out-of-stock {
    color: #f87171;
}

.ecommerce-cart {
    background: #1e293b;
    border-radius: 12px;
    padding: 1.25rem;
    border: 1px solid #334155;
    position: sticky;
    top: 100px;
}

.ecommerce-cart h3 {
    color: #f1f5f9;
    margin-bottom: 1rem;
}

.ecommerce-cart-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid #334155;
    color: #cbd5e1;
    font-size: 0.9rem;
}

.ecommerce-cart-total {
    display: flex;
    justify-content: space-between;
    padding-top: 1rem;
    font-weight: 700;
    color: #f1f5f9;
}

/* ----- Media Player ----- */
.media-player {
    background: #0f172a;
    border-radius: 16px;
    padding: 1.5rem;
    border: 1px solid #1e293b;
}

.media-player video,
.media-player audio {
    width: 100%;
    border-radius: 8px;
    background: #000;
}

.media-player .playlist {
    margin-top: 1rem;
    max-height: 150px;
    overflow-y: auto;
}

.media-player .playlist-item {
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    cursor: pointer;
    color: #94a3b8;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.media-player .playlist-item:hover {
    background: #1e293b;
    color: #e2e8f0;
}

.media-player .playlist-item.active {
    background: #1e293b;
    color: #60a5fa;
}

.media-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: #1e293b;
    border-radius: 12px;
    border: 1px solid #334155;
}

.media-controls button {
    background: transparent;
    border: none;
    color: #e2e8f0;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0.3rem 0.5rem;
    transition: color 0.2s;
}

.media-controls button:hover {
    color: #60a5fa;
}

.media-controls .progress-bar {
    flex: 1;
    height: 4px;
    background: #334155;
    border-radius: 4px;
    cursor: pointer;
    position: relative;
}

.media-controls .progress-bar .fill {
    height: 100%;
    background: #3b82f6;
    border-radius: 4px;
    width: 0%;
    transition: width 0.1s;
}

.media-controls .time-display {
    font-size: 0.8rem;
    color: #94a3b8;
    font-family: monospace;
}

.media-visualizer {
    height: 60px;
    display: flex;
    align-items: flex-end;
    gap: 2px;
    margin-top: 0.75rem;
    padding: 0.5rem;
    background: #0a0f1a;
    border-radius: 8px;
}

.media-visualizer .bar {
    flex: 1;
    background: #3b82f6;
    border-radius: 2px;
    transition: height 0.1s;
}

/* ----- Dashboard ----- */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
}

.dashboard-chart {
    background: #1e293b;
    border-radius: 12px;
    padding: 1.25rem;
    border: 1px solid #334155;
}

.dashboard-chart h4 {
    color: #f1f5f9;
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
}

.dashboard-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.dashboard-stat {
    background: #1e293b;
    border-radius: 12px;
    padding: 1rem;
    border: 1px solid #334155;
    text-align: center;
}

.dashboard-stat .value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #f1f5f9;
}

.dashboard-stat .label {
    font-size: 0.75rem;
    color: #94a3b8;
}

.dashboard-controls {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.dashboard-controls button {
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    border: 1px solid #334155;
    background: #0f172a;
    color: #e2e8f0;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.85rem;
}

.dashboard-controls button:hover {
    background: #334155;
}

.dashboard-controls button.active {
    background: #3b82f6;
    border-color: #3b82f6;
}

/* ----- Responsive ----- */
@media (max-width: 768px) {
    .ecommerce-container {
        grid-template-columns: 1fr;
    }
    .ecommerce-cart {
        position: static;
    }
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    .dashboard-stats {
        grid-template-columns: 1fr 1fr;
    }
    .media-controls {
        flex-wrap: wrap;
    }
    .media-controls .progress-bar {
        order: 10;
        flex-basis: 100%;
    }
}