/* OnlyPlay Workflow — My Account dashboard
 * Dark + orange theme matching Lovable mock.
 * Hides WC sidebar, expands content to full width.
 */

/* Blocksy wraps WC account in .ct-woo-account flex container with .ct-acount-nav
 * reserving 220px+ even when inner nav hidden. Hide outer wrapper, not just inner.
 */
.woocommerce-account .ct-acount-nav,
.woocommerce-account .woocommerce-MyAccount-navigation {
    display: none !important;
}

.woocommerce-account .ct-woo-account {
    display: block !important;
}

.woocommerce-account .woocommerce-MyAccount-content {
    width: 100% !important;
    flex: 1 1 100% !important;
    float: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.opwf-account {
    --opwf-bg: #0a0a0a;
    --opwf-surface: #141414;
    --opwf-surface-2: #1c1c1c;
    --opwf-border: #2a2a2a;
    --opwf-text: #f5f5f5;
    --opwf-text-muted: #9a9a9a;
    --opwf-accent: #f59e0b;
    --opwf-accent-soft: rgba(245, 158, 11, 0.15);
    --opwf-danger: #ef4444;
    --opwf-success: #10b981;

    background: var(--opwf-bg);
    color: var(--opwf-text);
    padding: 32px;
    border-radius: 12px;
    font-family: -apple-system, "Segoe UI", "PingFang TC", "Microsoft JhengHei", sans-serif;
}

.opwf-account *,
.opwf-account *::before,
.opwf-account *::after {
    box-sizing: border-box;
}

/* Hero */
.opwf-account__hero {
    margin-bottom: 24px;
}

.opwf-account__title {
    color: var(--opwf-accent);
    font-size: 32px;
    font-weight: 700;
    margin: 0 0 8px;
    line-height: 1.2;
}

.opwf-account__subtitle {
    color: var(--opwf-text-muted);
    font-size: 14px;
    margin: 0;
}

.opwf-account__subtitle span {
    color: var(--opwf-text);
}

/* Stats grid */
.opwf-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.opwf-stat {
    position: relative;
    background: var(--opwf-surface);
    border: 1px solid var(--opwf-border);
    border-radius: 10px;
    padding: 20px;
    min-height: 96px;
}

.opwf-stat__label {
    color: var(--opwf-text-muted);
    font-size: 13px;
    margin-bottom: 10px;
}

.opwf-stat__value {
    color: var(--opwf-text);
    font-size: 32px;
    font-weight: 700;
    line-height: 1;
}

.opwf-stat--accent .opwf-stat__value {
    color: var(--opwf-accent);
}

.opwf-stat--danger .opwf-stat__value {
    color: var(--opwf-danger);
}

.opwf-stat__icon {
    position: absolute;
    top: 18px;
    right: 18px;
    font-size: 20px;
    opacity: 0.75;
}

/* Tabs */
.opwf-tabs {
    display: inline-flex;
    gap: 4px;
    background: var(--opwf-surface);
    border: 1px solid var(--opwf-border);
    padding: 4px;
    border-radius: 999px;
    margin-bottom: 20px;
}

.opwf-tab {
    appearance: none;
    background: transparent;
    border: 0;
    color: var(--opwf-text-muted);
    padding: 8px 18px;
    border-radius: 999px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.opwf-tab:hover {
    color: var(--opwf-text);
}

.opwf-tab.is-active {
    background: var(--opwf-accent);
    color: #1a1a1a;
    font-weight: 600;
}

/* Panel */
.opwf-panel {
    display: none;
}

.opwf-panel.is-active {
    display: block;
}

.opwf-panel__title {
    color: var(--opwf-text);
    font-size: 18px;
    margin: 16px 0 12px;
}

/* Filters row */
.opwf-filters {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    background: var(--opwf-surface);
    border: 1px solid var(--opwf-border);
    padding: 12px;
    border-radius: 10px;
}

.opwf-filter select {
    appearance: none;
    background: var(--opwf-surface-2);
    color: var(--opwf-text);
    border: 1px solid var(--opwf-border);
    border-radius: 8px;
    padding: 8px 28px 8px 12px;
    font-size: 14px;
    min-width: 130px;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%239a9a9a' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 10px;
}

.opwf-btn {
    appearance: none;
    background: var(--opwf-accent);
    color: #1a1a1a;
    border: 0;
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    line-height: 1.4;
    display: inline-block;
}

.opwf-btn:hover {
    filter: brightness(1.05);
}

.opwf-btn--ghost {
    background: transparent;
    color: var(--opwf-text-muted);
    border: 1px solid var(--opwf-border);
}

.opwf-btn--ghost:hover {
    color: var(--opwf-text);
    border-color: var(--opwf-text-muted);
}

/* Table */
.opwf-table-wrap {
    overflow-x: auto;
    background: var(--opwf-surface);
    border: 1px solid var(--opwf-border);
    border-radius: 10px;
}

.opwf-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    min-width: 1100px;
}

.opwf-account .opwf-table,
.opwf-account .opwf-table thead,
.opwf-account .opwf-table tbody,
.opwf-account .opwf-table tr {
    border: 0 !important;
    box-shadow: none !important;
}

.opwf-account .opwf-table th,
.opwf-account .opwf-table td {
    padding: 12px 14px;
    text-align: left;
    border: 0 !important;
    border-bottom: 1px solid var(--opwf-border) !important;
    box-shadow: none !important;
    outline: 0 !important;
    background-image: none !important;
    white-space: nowrap;
}

.opwf-table thead th {
    color: var(--opwf-text-muted);
    font-weight: 500;
    background: var(--opwf-surface-2);
    font-size: 12px;
}

.opwf-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.opwf-table tbody tr:last-child td {
    border-bottom: 0;
}

.opwf-table__name a {
    color: var(--opwf-text);
    text-decoration: none;
}

.opwf-table__name a:hover {
    color: var(--opwf-accent);
}

.opwf-table__amount {
    color: var(--opwf-accent);
    font-weight: 600;
    white-space: nowrap;
}

.opwf-amount__native { color: var(--opwf-accent); font-weight: 700; }
.opwf-amount__excludes { color: var(--opwf-text-muted); font-size: 11px; font-weight: 400; }
.opwf-amount__nt { color: #fff; font-size: 12px; font-weight: 600; margin-top: 2px; }
.opwf-amount__poster-note { color: var(--opwf-text-muted); font-size: 11px; font-weight: 400; margin-top: 1px; }
.opwf-table__poster { color: var(--opwf-text-muted); font-size: 12px; margin-top: 3px; }

.opwf-table__id a {
    color: var(--opwf-text-muted);
    text-decoration: none;
    font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
    font-size: 12px;
}
.opwf-table__id a:hover { color: var(--opwf-accent); }

.opwf-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.opwf-badge {
    display: inline-block;
    background: var(--opwf-accent-soft);
    color: var(--opwf-accent);
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    line-height: 1.4;
    white-space: nowrap;
}

.opwf-badge--japanese  { background: rgba(245, 158, 11, 0.18); color: #f59e0b; }
.opwf-badge--chinese   { background: rgba(220, 38, 38, 0.18);  color: #f87171; }
.opwf-badge--single    { background: rgba(59, 130, 246, 0.18); color: #60a5fa; }
.opwf-badge--instock   { background: rgba(16, 185, 129, 0.18); color: #34d399; }
.opwf-badge--purchasing{ background: rgba(168, 85, 247, 0.18); color: #c084fc; }
.opwf-badge--online    { background: rgba(236, 72, 153, 0.18); color: #f472b6; }

.opwf-status {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
}

.opwf-status--ok {
    background: rgba(16, 185, 129, 0.15);
    color: var(--opwf-success);
}

.opwf-status--warn {
    background: rgba(239, 68, 68, 0.15);
    color: var(--opwf-danger);
}

/* Coupons */
.opwf-coupons__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.opwf-pill {
    background: var(--opwf-accent-soft);
    color: var(--opwf-accent);
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
}

.opwf-coupons__filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.opwf-chip {
    appearance: none;
    background: var(--opwf-surface);
    border: 1px solid var(--opwf-border);
    color: var(--opwf-text-muted);
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 13px;
    cursor: pointer;
}

.opwf-chip.is-active {
    background: var(--opwf-accent);
    color: #1a1a1a;
    border-color: var(--opwf-accent);
}

/* Empty state */
.opwf-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--opwf-text-muted);
}

.opwf-empty--large {
    padding: 80px 20px;
}

.opwf-empty__icon {
    font-size: 36px;
    margin-bottom: 10px;
    opacity: 0.5;
}

.opwf-empty p {
    margin: 0;
}

/* Responsive */
@media (max-width: 900px) {
    .opwf-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    .opwf-account {
        padding: 20px;
    }
}

@media (max-width: 540px) {
    .opwf-stats {
        grid-template-columns: 1fr;
    }
    .opwf-account__title {
        font-size: 26px;
    }
}
