/* ============================================================
   VideoHub360 Affiliates – Frontend Styles
   ============================================================
   CSS custom properties used below (--vh360-primary-color,
   --vh360-primary-dark) are expected to be defined by the
   parent theme. Fallback values are provided so this stylesheet
   works standalone without the theme.
   ============================================================ */

/* Base layout
   ============================================================ */
.vh360-affiliate-page,
.vh360-affiliate-dashboard {
    max-width: 1120px;
    margin: 0 auto;
    padding: 32px 20px;
    font-family: inherit;
    color: inherit;
}

.vh360-affiliate-page > * + *,
.vh360-affiliate-dashboard > * + * {
    margin-top: 24px;
}

/* Card base
   ============================================================ */
.vh360-affiliate-card,
.vh360-affiliate-hero-card,
.vh360-affiliate-form-card,
.vh360-affiliate-table-card,
.vh360-affiliate-referral-card,
.vh360-affiliate-commission-summary-card,
.vh360-affiliate-payment-card {
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 18px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
    padding: 28px;
}

.vh360-affiliate-card h3,
.vh360-affiliate-form-card h3,
.vh360-affiliate-table-card h3,
.vh360-affiliate-referral-card h3,
.vh360-affiliate-commission-summary-card h3,
.vh360-affiliate-payment-card h3 {
    margin-top: 0;
    margin-bottom: 16px;
    font-size: 18px;
    font-weight: 700;
}

/* Notices
   ============================================================ */
.vh360-affiliate-notice,
.vh360-aff-notice,
.vh360-aff-error,
.vh360-aff-success {
    padding: 14px 18px;
    border-radius: 10px;
    font-size: 14px;
    line-height: 1.5;
}

.vh360-affiliate-notice--error,
.vh360-aff-error {
    background: #fdf3f3;
    border: 1px solid rgba(220, 38, 38, 0.2);
    color: #b91c1c;
}

.vh360-affiliate-notice--success,
.vh360-aff-success {
    background: #f0fdf4;
    border: 1px solid rgba(22, 163, 74, 0.2);
    color: #15803d;
}

.vh360-aff-notice {
    background: #eff6ff;
    border: 1px solid rgba(37, 99, 235, 0.2);
    color: #1d4ed8;
}

/* Status cards (logged-out, pending, rejected, etc.)
   ============================================================ */
.vh360-affiliate-status-card {
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 18px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
    padding: 32px 28px;
    text-align: center;
}

.vh360-affiliate-status-card h3 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 20px;
    font-weight: 700;
}

.vh360-affiliate-status-card p {
    margin: 0;
    color: #64748b;
    font-size: 15px;
}

.vh360-affiliate-status-login     { border-top: 4px solid #94a3b8; }
.vh360-affiliate-status-pending   { border-top: 4px solid #f59e0b; }
.vh360-affiliate-status-active    { border-top: 4px solid #10b981; }
.vh360-affiliate-status-rejected  { border-top: 4px solid #ef4444; }
.vh360-affiliate-status-suspended { border-top: 4px solid #f97316; }

/* Status badges (inline, inside tables)
   ============================================================ */
.vh360-affiliate-status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.vh360-affiliate-status-badge.vh360-affiliate-status-active    { background: #dcfce7; color: #15803d; }
.vh360-affiliate-status-badge.vh360-affiliate-status-pending   { background: #fef3c7; color: #b45309; }
.vh360-affiliate-status-badge.vh360-affiliate-status-approved  { background: #dbeafe; color: #1d4ed8; }
.vh360-affiliate-status-badge.vh360-affiliate-status-paid      { background: #d1fae5; color: #065f46; }
.vh360-affiliate-status-badge.vh360-affiliate-status-rejected  { background: #fee2e2; color: #b91c1c; }
.vh360-affiliate-status-badge.vh360-affiliate-status-reversed  { background: #fce7f3; color: #9d174d; }
.vh360-affiliate-status-badge.vh360-affiliate-status-suspended { background: #ffedd5; color: #c2410c; }

/* Registration hero card
   ============================================================ */
.vh360-affiliate-eyebrow {
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--vh360-primary-color, #2563eb);
    margin-top: 0;
    margin-bottom: 10px;
}

.vh360-affiliate-hero-card h2 {
    font-size: 26px;
    font-weight: 800;
    margin-top: 0;
    margin-bottom: 12px;
}

.vh360-affiliate-hero-desc {
    color: #475569;
    font-size: 15px;
    line-height: 1.65;
    margin-bottom: 24px;
}

.vh360-affiliate-benefits-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.vh360-affiliate-benefit {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 14px;
    color: #374151;
    line-height: 1.4;
}

.vh360-affiliate-benefit-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    min-width: 22px;
    background: var(--vh360-primary-color, #2563eb);
    color: #fff;
    border-radius: 50%;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
}

/* Dashboard header
   ============================================================ */
.vh360-affiliate-dashboard-header h2 {
    margin-top: 0;
    margin-bottom: 6px;
    font-size: 26px;
    font-weight: 800;
}

.vh360-affiliate-dashboard-header p {
    color: #64748b;
    margin: 0;
    font-size: 15px;
}

/* Stats grid
   ============================================================ */
.vh360-affiliate-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.vh360-affiliate-stat-card {
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 16px;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.05);
    padding: 18px 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.vh360-affiliate-stat-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #94a3b8;
    font-weight: 600;
}

.vh360-affiliate-stat-value {
    font-size: 24px;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.1;
}

.vh360-affiliate-stat-hint {
    font-size: 11px;
    color: #94a3b8;
    margin-top: 2px;
}

/* Referral link card
   ============================================================ */
.vh360-affiliate-referral-link-row {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 8px;
}

/* Dashboard grid (2 columns)
   ============================================================ */
.vh360-affiliate-dashboard-grid {
    display: grid;
    grid-template-columns: 1.4fr 0.8fr;
    gap: 20px;
}

/* Tables
   ============================================================ */
.vh360-affiliate-table-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.vh360-affiliate-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.vh360-affiliate-table th,
.vh360-affiliate-table td {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(15, 23, 42, 0.07);
    text-align: left;
    white-space: nowrap;
}

.vh360-affiliate-table thead th {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #94a3b8;
    background: transparent;
}

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

/* Allow line-wrapping in the compact summary table */
.vh360-affiliate-summary-table th,
.vh360-affiliate-summary-table td {
    white-space: normal;
}

/* Empty states
   ============================================================ */
.vh360-affiliate-empty-state {
    padding: 32px 20px;
    text-align: center;
    color: #94a3b8;
}

.vh360-affiliate-empty-state-title {
    font-size: 15px;
    font-weight: 600;
    color: #64748b;
    margin-top: 0;
    margin-bottom: 6px;
}

.vh360-affiliate-empty-state p {
    font-size: 14px;
    margin: 0;
}

/* Forms
   ============================================================ */
.vh360-affiliate-form-group {
    margin-bottom: 18px;
}

.vh360-affiliate-form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
}

.vh360-affiliate-form input[type="text"],
.vh360-affiliate-form input[type="email"],
.vh360-affiliate-form input[type="url"],
.vh360-affiliate-form textarea,
.vh360-affiliate-referral-link-input {
    width: 100%;
    min-height: 46px;
    border: 1px solid rgba(15, 23, 42, 0.14);
    border-radius: 12px;
    padding: 10px 14px;
    font-size: 15px;
    font-family: inherit;
    color: #0f172a;
    background: #f8fafc;
    box-sizing: border-box;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.vh360-affiliate-form input[type="text"]:focus,
.vh360-affiliate-form input[type="email"]:focus,
.vh360-affiliate-form input[type="url"]:focus,
.vh360-affiliate-form textarea:focus,
.vh360-affiliate-referral-link-input:focus {
    outline: none;
    border-color: var(--vh360-primary-color, #2563eb);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
    background: #fff;
}

.vh360-affiliate-referral-link-input[readonly] {
    background: #f1f5f9;
    cursor: default;
    color: #475569;
}

.vh360-affiliate-field-hint {
    display: block;
    font-size: 12px;
    color: #94a3b8;
    margin-top: 6px;
}

.vh360-affiliate-terms-notice {
    font-size: 13px;
    color: #64748b;
    margin-bottom: 20px;
}

.vh360-affiliate-terms-notice a {
    color: var(--vh360-primary-color, #2563eb);
    text-decoration: underline;
}

/* Buttons
   ============================================================ */
.vh360-affiliate-button,
.vh360-affiliate-form button[type="submit"],
.vh360-affiliate-form input[type="submit"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 22px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    font-family: inherit;
    text-decoration: none;
    cursor: pointer;
    border: none;
    background: var(--vh360-primary-color, #2563eb);
    color: #fff;
    transition: background 0.15s, box-shadow 0.15s, transform 0.1s;
    white-space: nowrap;
}

.vh360-affiliate-button:hover,
.vh360-affiliate-form button[type="submit"]:hover,
.vh360-affiliate-form input[type="submit"]:hover {
    background: var(--vh360-primary-dark, #1d4ed8);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.vh360-affiliate-button:active,
.vh360-affiliate-form button[type="submit"]:active,
.vh360-affiliate-form input[type="submit"]:active {
    transform: scale(0.98);
}

/* Responsive
   ============================================================ */
@media (max-width: 900px) {
    .vh360-affiliate-dashboard-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .vh360-affiliate-page,
    .vh360-affiliate-dashboard {
        padding: 20px 14px;
    }

    .vh360-affiliate-card,
    .vh360-affiliate-hero-card,
    .vh360-affiliate-form-card,
    .vh360-affiliate-table-card,
    .vh360-affiliate-referral-card,
    .vh360-affiliate-commission-summary-card,
    .vh360-affiliate-payment-card,
    .vh360-affiliate-status-card {
        padding: 20px;
        border-radius: 14px;
    }

    .vh360-affiliate-stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .vh360-affiliate-benefits-grid {
        grid-template-columns: 1fr;
    }

    .vh360-affiliate-referral-link-row {
        flex-direction: column;
        align-items: stretch;
    }

    .vh360-affiliate-button,
    .vh360-affiliate-form button[type="submit"],
    .vh360-affiliate-form input[type="submit"] {
        width: 100%;
    }
}

@media (max-width: 400px) {
    .vh360-affiliate-stats-grid {
        grid-template-columns: 1fr;
    }
}

