/* ═══════════════════════════════════════════════════════
   OpenClaw Setup — Inline Component Styles
   These style our injected content inside main.content
   while integrating with OpenClaw's native look
   ═══════════════════════════════════════════════════════ */

/* ─── Separator for our nav section ─────────────────── */
#ocs-nav-section {
    border-bottom: 1px solid var(--border-soft, rgba(0, 0, 0, 0.08));
    padding-bottom: 4px;
    margin-bottom: 4px;
}

#ocs-balance-link .nav-item__text {
    color: #3b82f6;
}

#ocs-balance-link:hover .nav-item__text {
    color: #60a5fa;
}

/* ─── Loading / Error states ────────────────────────── */
.ocs-loading {
    padding: 40px;
    text-align: center;
    color: var(--text-2, #888);
    font-size: 15px;
}

.ocs-error {
    padding: 20px;
    color: #ef4444;
    background: rgba(239, 68, 68, 0.08);
    border-radius: 8px;
    margin: 16px 0;
}

/* ─── Cards Grid ────────────────────────────────────── */
.ocs-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

.ocs-card {
    background: var(--bg-card, #fff);
    border: 1px solid var(--border, rgba(0, 0, 0, 0.08));
    border-radius: 10px;
    padding: 16px 20px;
    transition: box-shadow 0.15s;
}

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

.ocs-card-link {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.ocs-card-link:hover {
    border-color: #3b82f6;
}

.ocs-card-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-2, #888);
    margin-bottom: 6px;
    font-weight: 600;
}

.ocs-card-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-1, #111);
    line-height: 1.2;
}

.ocs-card-hint {
    font-size: 12px;
    color: var(--text-2, #888);
    margin-top: 8px;
}

/* ─── Sections ──────────────────────────────────────── */
.ocs-section {
    margin-bottom: 28px;
}

.ocs-section-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-1, #111);
    margin: 0 0 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border, rgba(0, 0, 0, 0.06));
}

/* ─── Top Up ────────────────────────────────────────── */
.ocs-topup-grid {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.ocs-topup-btn {
    padding: 8px 20px;
    border: 1px solid var(--border, rgba(0, 0, 0, 0.12));
    border-radius: 8px;
    background: var(--bg-card, #fff);
    color: var(--text-1, #111);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.ocs-topup-btn:hover {
    border-color: #3b82f6;
    color: #3b82f6;
    background: rgba(59, 130, 246, 0.04);
}

.ocs-topup-custom {
    display: flex;
    gap: 8px;
    max-width: 360px;
}

.ocs-topup-custom input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--border, rgba(0, 0, 0, 0.12));
    border-radius: 8px;
    background: var(--bg-card, #fff);
    color: var(--text-1, #111);
    font-size: 14px;
    outline: none;
}

.ocs-topup-custom input:focus {
    border-color: #3b82f6;
}

/* ─── Buttons ───────────────────────────────────────── */
.ocs-btn-primary {
    padding: 8px 20px;
    background: #3b82f6;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

.ocs-btn-primary:hover {
    background: #2563eb;
}

.ocs-btn-outline {
    padding: 10px 20px;
    background: transparent;
    color: var(--text-1, #111);
    border: 1px solid var(--border, rgba(0, 0, 0, 0.12));
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: all 0.15s;
}

.ocs-btn-outline:hover:not(:disabled) {
    border-color: #3b82f6;
    color: #3b82f6;
}

.ocs-btn-outline:disabled {
    opacity: 0.5;
    cursor: default;
}

/* ─── Table ─────────────────────────────────────────── */
.ocs-table-wrap {
    overflow-x: auto;
}

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

.ocs-table thead th {
    text-align: left;
    padding: 10px 12px;
    font-weight: 600;
    color: var(--text-2, #888);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border, rgba(0, 0, 0, 0.08));
}

.ocs-table tbody td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border, rgba(0, 0, 0, 0.04));
    color: var(--text-1, #111);
}

.ocs-table tbody tr:last-child td {
    border-bottom: none;
}

.ocs-amount-positive {
    color: #22c55e;
    font-weight: 600;
}

.ocs-amount-negative {
    color: #ef4444;
    font-weight: 600;
}

/* ─── Subscription Plan Card ──────────────────────── */
.ocs-plan-card {
    background: var(--bg-card, #fff);
    border: 2px solid #3b82f6;
    border-radius: 12px;
    padding: 20px 24px;
    margin-bottom: 24px;
}

.ocs-plan-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.ocs-plan-name {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-1, #111);
}

.ocs-plan-status {
    font-size: 13px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 20px;
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
}

.ocs-status-past_due {
    background: rgba(234, 179, 8, 0.1);
    color: #eab308;
}

.ocs-status-cancelled {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.ocs-status-suspended {
    background: rgba(156, 163, 175, 0.1);
    color: #9ca3af;
}

.ocs-plan-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ocs-plan-detail {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: var(--text-2, #888);
}

.ocs-plan-detail span:last-child {
    color: var(--text-1, #111);
    font-weight: 500;
}

/* ─── Plans Grid ────────────────────────────────────── */
.ocs-plans-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}

.ocs-plan-option {
    background: var(--bg-card, #fff);
    border: 1px solid var(--border, rgba(0, 0, 0, 0.08));
    border-radius: 12px;
    padding: 24px 20px;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: border-color 0.15s;
}

.ocs-plan-option:hover {
    border-color: #3b82f6;
}

.ocs-plan-current {
    border-color: #3b82f6;
    background: rgba(59, 130, 246, 0.02);
}

.ocs-plan-popular {
    border-color: #8b5cf6;
}

.ocs-plan-badge {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: #8b5cf6;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 12px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ocs-plan-option-name {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-1, #111);
    margin-bottom: 4px;
}

.ocs-plan-option-price {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-1, #111);
    margin-bottom: 16px;
}

.ocs-plan-option-price span {
    font-size: 14px;
    font-weight: 400;
    color: var(--text-2, #888);
}

.ocs-plan-option-features {
    list-style: none;
    padding: 0;
    margin: 0 0 20px;
    flex: 1;
}

.ocs-plan-option-features li {
    padding: 4px 0;
    font-size: 13px;
    color: var(--text-2, #888);
}

.ocs-plan-option-features li::before {
    content: '✓ ';
    color: #22c55e;
    font-weight: 700;
}

/* ─── Ticket Form ───────────────────────────────────── */
.ocs-ticket-form {
    max-width: 560px;
}

.ocs-form-group {
    margin-bottom: 14px;
}

.ocs-form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-2, #888);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.ocs-form-group input,
.ocs-form-group textarea,
.ocs-form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border, rgba(0, 0, 0, 0.12));
    border-radius: 8px;
    background: var(--bg-card, #fff);
    color: var(--text-1, #111);
    font-size: 14px;
    font-family: inherit;
    outline: none;
    box-sizing: border-box;
}

.ocs-form-group input:focus,
.ocs-form-group textarea:focus,
.ocs-form-group select:focus {
    border-color: #3b82f6;
}

.ocs-form-group textarea {
    resize: vertical;
    min-height: 100px;
}

/* ─── Tickets List ──────────────────────────────────── */
.ocs-ticket {
    background: var(--bg-card, #fff);
    border: 1px solid var(--border, rgba(0, 0, 0, 0.08));
    border-radius: 10px;
    padding: 16px 20px;
    margin-bottom: 10px;
}

.ocs-ticket-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.ocs-ticket-status {
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.ocs-ticket-body {
    font-size: 14px;
    color: var(--text-2, #888);
    line-height: 1.5;
}

.ocs-ticket-reply {
    margin-top: 12px;
    padding: 12px 16px;
    background: rgba(59, 130, 246, 0.04);
    border-left: 3px solid #3b82f6;
    border-radius: 0 8px 8px 0;
}

.ocs-ticket-reply-label {
    font-size: 11px;
    font-weight: 700;
    color: #3b82f6;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.ocs-ticket-reply-text {
    font-size: 14px;
    color: var(--text-1, #111);
    line-height: 1.5;
}

/* ─── Setup Steps (Status page) ─────────────────────── */
.ocs-setup-steps {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ocs-setup-step {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    background: var(--bg-card, #fff);
    border: 1px solid var(--border, rgba(0, 0, 0, 0.06));
    border-radius: 10px;
    transition: all 0.15s;
}

.ocs-step-done {
    opacity: 0.7;
}

.ocs-step-icon {
    font-size: 20px;
    flex-shrink: 0;
    width: 28px;
    text-align: center;
}

.ocs-step-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-1, #111);
}

.ocs-step-date {
    font-size: 12px;
    color: var(--text-2, #888);
    margin-top: 2px;
}

.ocs-step-info {
    flex: 1;
}

/* ─── Notification Badge ────────────────────────────── */
.ocs-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    background: #ef4444;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    line-height: 16px;
    text-align: center;
    border-radius: 8px;
    padding: 0 4px;
}

/* ─── Notifications List ──────────────────────────── */
.ocs-notifications-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ocs-notification-item {
    background: var(--bg-card, #fff);
    border: 1px solid var(--border, rgba(0, 0, 0, 0.08));
    border-left: 3px solid #3b82f6;
    border-radius: 8px;
    padding: 14px 18px;
    cursor: pointer;
    transition: all 0.15s;
}

.ocs-notification-item:hover {
    border-left-color: #2563eb;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.ocs-notification-read {
    opacity: 0.6;
    border-left-color: var(--border, rgba(0, 0, 0, 0.08));
    cursor: default;
}

.ocs-notification-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.ocs-notification-type {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-1, #111);
}

.ocs-notification-date {
    font-size: 12px;
    color: var(--text-2, #888);
}

.ocs-notification-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-1, #111);
    margin-bottom: 4px;
}

.ocs-notification-body {
    font-size: 13px;
    color: var(--text-2, #888);
    line-height: 1.4;
}

/* ─── Responsive ────────────────────────────────────── */
@media (max-width: 768px) {
    .ocs-cards {
        grid-template-columns: 1fr;
    }

    .ocs-plans-grid {
        grid-template-columns: 1fr;
    }

    .ocs-plan-card-header {
        flex-direction: column;
        gap: 8px;
    }

    .ocs-topup-custom {
        flex-direction: column;
    }
}