/* ══════════════════════════════════════════════════════════════
   VTO Admin Dashboard Styles for Magento 2
   ══════════════════════════════════════════════════════════════ */

/* ── Dashboard Layout ────────────────────────────────────────── */
.vto-dashboard {
    max-width: 1200px;
}

/* ── Alerts ──────────────────────────────────────────────────── */
.vto-alert {
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 20px;
    font-size: 13px;
    line-height: 1.5;
}

.vto-alert-warning {
    background: #fff3cd;
    border: 1px solid #ffc107;
    color: #856404;
}

.vto-alert-success {
    background: #d4edda;
    border: 1px solid #28a745;
    color: #155724;
}

.vto-alert-danger {
    background: #f8d7da;
    border: 1px solid #dc3545;
    color: #721c24;
}

.vto-alert-info {
    background: #d1ecf1;
    border: 1px solid #17a2b8;
    color: #0c5460;
}

/* ── Grid System ─────────────────────────────────────────────── */
.vto-grid {
    display: grid;
    gap: 16px;
    margin-bottom: 24px;
}

.vto-grid-4 {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.vto-grid-3 {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

/*.vto-grid-2 {*/
/*    grid-template-columns: 1fr 1fr;*/
/*}*/

.vto-grid-1 {
    grid-template-columns: 1fr;
}

/* ── Cards ───────────────────────────────────────────────────── */
.vto-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 16px;
    transition: box-shadow 0.2s ease;
}

.vto-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.vto-card h3 {
    margin: 0 0 12px;
    font-size: 14px;
    color: #666;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.vto-card--flat {
    box-shadow: none;
}

.vto-card--bordered {
    border-left: 3px solid #6366f1;
}

/* ── KPI Values ──────────────────────────────────────────────── */
.vto-kpi-value {
    font-size: 28px;
    font-weight: 700;
    color: #333;
    margin: 4px 0;
    line-height: 1.2;
}

.vto-kpi-value--small {
    font-size: 22px;
}

.vto-kpi-label {
    font-size: 12px;
    color: #999;
    margin-top: 4px;
}

/* ── Trend Indicators ────────────────────────────────────────── */
.vto-trend {
    font-size: 12px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.vto-trend-up {
    color: #28a745;
}

.vto-trend-down {
    color: #dc3545;
}

.vto-trend-flat {
    color: #999;
}

.vto-trend-arrow {
    font-size: 10px;
}

/* ── Status Badges ───────────────────────────────────────────── */
.vto-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.vto-badge--success {
    background: #d4edda;
    color: #155724;
}

.vto-badge--warning {
    background: #fff3cd;
    color: #856404;
}

.vto-badge--danger {
    background: #f8d7da;
    color: #721c24;
}

.vto-badge--info {
    background: #d1ecf1;
    color: #0c5460;
}

.vto-badge--pending {
    background: #e2e3e5;
    color: #383d41;
}

.vto-badge--processing {
    background: #e8eaf6;
    color: #3949ab;
}

.vto-badge--completed {
    background: #e8f5e9;
    color: #2e7d32;
}

.vto-badge--failed {
    background: #fce4ec;
    color: #c62828;
}

/* ── Setup Card ──────────────────────────────────────────────── */
.vto-setup-card {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 24px;
}

.vto-setup-card h2 {
    margin: 0 0 16px;
    font-size: 16px;
    color: #333;
}

.vto-setup-progress {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.vto-setup-progress__bar {
    flex: 1;
    height: 6px;
    background: #e0e0e0;
    border-radius: 3px;
    overflow: hidden;
}

.vto-setup-progress__fill {
    height: 100%;
    background: linear-gradient(90deg, #6366f1, #a78bfa);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.vto-setup-progress__label {
    font-size: 12px;
    color: #666;
    font-weight: 600;
    white-space: nowrap;
}

.vto-checklist-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.vto-checklist-item:last-child {
    border-bottom: none;
}

.vto-check {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #fff;
    flex-shrink: 0;
}

.vto-check-done {
    background: #28a745;
}

.vto-check-pending {
    background: #ccc;
}

.vto-checklist-desc {
    font-size: 12px;
    color: #888;
    margin-top: 2px;
}

.vto-checklist-text {
    font-size: 13px;
    color: #333;
}

.vto-checklist-text--done {
    color: #999;
    text-decoration: line-through;
}

/* ── Tables ──────────────────────────────────────────────────── */
.vto-table {
    width: 100%;
    border-collapse: collapse;
}

.vto-table th,
.vto-table td {
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
    font-size: 13px;
}

.vto-table th {
    background: #f5f5f5;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.3px;
}

.vto-table tr:hover {
    background: #fafafa;
}

.vto-table td.vto-table__empty {
    text-align: center;
    padding: 32px 12px;
    color: #999;
    font-style: italic;
}

.vto-thumb {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
}

.vto-thumb--lg {
    width: 60px;
    height: 60px;
    border-radius: 6px;
}

.vto-product-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ── Section Headers ─────────────────────────────────────────── */
.vto-section {
    margin-bottom: 24px;
}

.vto-section h2 {
    font-size: 18px;
    margin: 0 0 12px;
    color: #333;
    font-weight: 600;
}

.vto-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.vto-section-header h2 {
    margin: 0;
}

/* ── Info List ───────────────────────────────────────────────── */
.vto-info-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.vto-info-list li {
    padding: 6px 0;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    font-size: 13px;
}

.vto-info-list li:last-child {
    border-bottom: none;
}

.vto-info-label {
    color: #666;
}

.vto-info-value {
    font-weight: 600;
    color: #333;
}

/* ── Filter Bar ──────────────────────────────────────────────── */
.vto-filter-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding: 12px 16px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
    flex-wrap: wrap;
}

.vto-filter-bar label {
    font-size: 13px;
    color: #666;
    font-weight: 600;
}

.vto-filter-bar select,
.vto-filter-bar input[type="text"],
.vto-filter-bar input[type="date"] {
    padding: 6px 10px;
    border: 1px solid #d0d0d0;
    border-radius: 4px;
    font-size: 13px;
    background: #fff;
    min-width: 140px;
}

.vto-filter-bar button {
    padding: 6px 16px;
    border: 1px solid #6366f1;
    background: #6366f1;
    color: #fff;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.vto-filter-bar button:hover {
    background: #4f46e5;
}

.vto-filter-bar button.vto-filter-bar__reset {
    background: #fff;
    color: #666;
    border-color: #d0d0d0;
}

.vto-filter-bar button.vto-filter-bar__reset:hover {
    background: #f5f5f5;
}

/* ── Funnel Visualization ────────────────────────────────────── */
.vto-funnel {
    display: flex;
    flex-direction: column;
    gap: 0;
    max-width: 500px;
    margin: 0 auto;
}

.vto-funnel__step {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    position: relative;
}

.vto-funnel__bar {
    height: 36px;
    border-radius: 4px;
    background: linear-gradient(90deg, #6366f1, #a78bfa);
    min-width: 40px;
    transition: width 0.5s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.vto-funnel__bar-value {
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    padding: 0 8px;
    white-space: nowrap;
}

.vto-funnel__label {
    font-size: 13px;
    color: #333;
    font-weight: 500;
    white-space: nowrap;
}

.vto-funnel__rate {
    font-size: 11px;
    color: #999;
    margin-left: auto;
}

.vto-funnel__connector {
    width: 2px;
    height: 8px;
    background: #e0e0e0;
    margin-left: 38px;
}

/* Funnel color variants */
.vto-funnel__step:nth-child(1) .vto-funnel__bar { background: linear-gradient(90deg, #6366f1, #818cf8); }
.vto-funnel__step:nth-child(3) .vto-funnel__bar { background: linear-gradient(90deg, #818cf8, #a78bfa); }
.vto-funnel__step:nth-child(5) .vto-funnel__bar { background: linear-gradient(90deg, #a78bfa, #c4b5fd); }
.vto-funnel__step:nth-child(7) .vto-funnel__bar { background: linear-gradient(90deg, #10b981, #34d399); }

/* ── Dashboard Grid ──────────────────────────────────────────── */
.vto-dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

.vto-dashboard-grid--full {
    grid-template-columns: 1fr;
}

/* ── Action Buttons ──────────────────────────────────────────── */
.vto-btn-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, box-shadow 0.2s ease;
    text-decoration: none;
    border: 1px solid transparent;
}

.vto-btn-action--primary {
    background: #6366f1;
    color: #fff;
    border-color: #6366f1;
}

.vto-btn-action--primary:hover {
    background: #4f46e5;
}

.vto-btn-action--secondary {
    background: #fff;
    color: #333;
    border-color: #d0d0d0;
}

.vto-btn-action--secondary:hover {
    background: #f5f5f5;
}

.vto-btn-action--danger {
    background: #fff;
    color: #dc3545;
    border-color: #dc3545;
}

.vto-btn-action--danger:hover {
    background: #fce4ec;
}

.vto-btn-action--small {
    padding: 4px 10px;
    font-size: 12px;
}

/* ── Pagination ──────────────────────────────────────────────── */
.vto-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 16px;
}

.vto-pagination__btn {
    padding: 6px 12px;
    border: 1px solid #d0d0d0;
    background: #fff;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.15s;
    color: #333;
}

.vto-pagination__btn:hover {
    background: #f5f5f5;
}

.vto-pagination__btn--active {
    background: #6366f1;
    color: #fff;
    border-color: #6366f1;
}

.vto-pagination__btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ── Empty State ─────────────────────────────────────────────── */
.vto-empty-state {
    text-align: center;
    padding: 48px 24px;
    color: #999;
}

.vto-empty-state__icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.vto-empty-state__title {
    font-size: 16px;
    font-weight: 600;
    color: #666;
    margin: 0 0 8px;
}

.vto-empty-state__text {
    font-size: 13px;
    color: #999;
    margin: 0;
}

/* ── Analytics Page ──────────────────────────────────────────── */
.vto-analytics {
    max-width: 1200px;
}

.vto-range-bar {
    display: flex;
    gap: 6px;
    margin-bottom: 20px;
}

.vto-range-btn {
    display: inline-block;
    padding: 6px 14px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: #333;
    font-size: 13px;
    background: #fff;
    transition: background 0.15s, color 0.15s;
}

.vto-range-btn:hover {
    background: #f5f5f5;
    text-decoration: none;
    color: #333;
}

.vto-range-btn.active {
    background: #333;
    color: #fff;
    border-color: #333;
}

/* ── Funnel Rows (Analytics) ────────────────────────────────── */
.vto-funnel-row {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.vto-funnel-label {
    width: 160px;
    font-size: 13px;
    color: #333;
    flex-shrink: 0;
}

.vto-funnel-bar-wrap {
    flex: 1;
    background: #f0f0f0;
    border-radius: 4px;
    height: 28px;
    position: relative;
}

.vto-funnel-bar {
    height: 100%;
    border-radius: 4px;
    background: #4a90d9;
    transition: width 0.3s;
}

.vto-funnel-count {
    width: 80px;
    text-align: right;
    font-size: 13px;
    font-weight: 600;
    color: #333;
    flex-shrink: 0;
    margin-left: 12px;
}

.vto-funnel-pct {
    width: 60px;
    text-align: right;
    font-size: 12px;
    color: #666;
    flex-shrink: 0;
    margin-left: 8px;
}

.vto-funnel-summary {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #f0f0f0;
    font-size: 13px;
    color: #666;
}

.vto-conversion-cell {
    font-weight: 700;
    color: #6366f1;
}

/* ── Result Image Modal ──────────────────────────────────────── */
.vto-result-clickable {
    transition: transform 0.15s ease;
}

.vto-result-clickable:hover {
    transform: scale(1.08);
}

.vto-result-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.82);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.vto-result-modal-overlay.active {
    display: flex;
}

.vto-result-modal-image {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 6px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.vto-result-modal-close {
    position: absolute;
    top: 16px;
    right: 20px;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 32px;
    line-height: 1;
    cursor: pointer;
    padding: 4px 10px;
}

.vto-result-modal-close:hover {
    color: #ddd;
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 768px) {
    .vto-grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }

    .vto-grid-2,
    .vto-dashboard-grid {
        grid-template-columns: 1fr;
    }

    .vto-filter-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .vto-filter-bar select,
    .vto-filter-bar input {
        width: 100%;
    }

    .vto-kpi-value {
        font-size: 22px;
    }

    .vto-range-bar {
        flex-wrap: wrap;
    }

    .vto-funnel-label {
        width: 120px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .vto-grid-4 {
        grid-template-columns: 1fr;
    }

    .vto-table {
        font-size: 12px;
    }

    .vto-table th,
    .vto-table td {
        padding: 6px 8px;
    }
}
