/**
 * Commission Table Component - Ultra Dark Mode Edition
 *
 * Responsive table for displaying commission structure details.
 * Features glassmorphism, mobile cards, and premium styling.
 */

/* ============================================
   Table Container
   ============================================ */
.commission-table-container {
    background: #ffffff !important;
    border-radius: 20px;
    padding: 1.5rem;
    margin: 3rem 0;
    border: 1px solid rgba(0, 0, 0, 0.08);
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}

[data-theme="dark"] .commission-table-container {
    background: rgba(30, 41, 59, 0.6) !important;
    border-color: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
}

/* ============================================
   Desktop Table
   ============================================ */
.commission-table-wrapper {
    overflow-x: auto;
    margin-bottom: 1.5rem;
}

.commission-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.95rem;
}

/* Table Header */
.commission-table thead {
    background: linear-gradient(135deg, #0c2340 0%, #1a3a5a 100%);
}

[data-theme="dark"] .commission-table thead {
    background: linear-gradient(135deg, #0a0f1a 0%, #1e293b 100%);
}

.commission-table__header {
    font-family: var(--font-family-heading, 'Playfair Display', serif);
    padding: 1.25rem 1rem;
    text-align: left;
    font-weight: 600;
    color: #ffffff;
    white-space: nowrap;
    border-bottom: 2px solid rgba(0, 0, 0, 0.1);
}

.commission-table__header:first-child {
    border-top-left-radius: 12px;
}

.commission-table__header:last-child {
    border-top-right-radius: 12px;
}

.commission-table__header i {
    margin-right: 0.5rem;
    color: #d4af37;
}

/* Table Body */
.commission-table tbody {
    background: #ffffff !important;
}

[data-theme="dark"] .commission-table tbody {
    background: transparent !important;
}

.commission-table__row {
    transition: background-color 0.2s ease;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

[data-theme="dark"] .commission-table__row {
    border-bottom-color: rgba(255, 255, 255, 0.05);
}

.commission-table__row:last-child {
    border-bottom: none;
}

.commission-table__row:hover {
    background: rgba(12, 35, 64, 0.02);
}

[data-theme="dark"] .commission-table__row:hover {
    background: rgba(255, 255, 255, 0.03);
}

.commission-table__cell {
    padding: 1rem;
    color: #64748b;
    vertical-align: middle;
    background: #ffffff !important;
}

[data-theme="dark"] .commission-table__cell {
    color: #cbd5e1;
    background: transparent !important;
}

.commission-table__cell--category {
    font-weight: 500;
    color: #1a1d20;
}

[data-theme="dark"] .commission-table__cell--category {
    color: #f1f5f9;
}

/* ============================================
   Cells Content
   ============================================ */
.commission-category {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.commission-category__icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(12, 35, 64, 0.05) 0%, rgba(212, 175, 55, 0.1) 100%);
    color: #0c2340;
    font-size: 1.25rem;
    flex-shrink: 0;
}

[data-theme="dark"] .commission-category__icon {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.15) 0%, rgba(212, 175, 55, 0.05) 100%);
    color: #d4af37;
}

.commission-category__info {
    flex: 1;
    min-width: 0;
}

.commission-category__name {
    font-weight: 600;
    color: #1a1d20;
    margin-bottom: 0.125rem;
}

[data-theme="dark"] .commission-category__name {
    color: #f1f5f9;
}

.commission-category__description {
    font-size: 0.75rem;
    color: #64748b;
    line-height: 1.4;
}

[data-theme="dark"] .commission-category__description {
    color: rgba(255, 255, 255, 0.5);
}

/* Rate Cell */
.commission-rate {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.commission-rate__percentage {
    font-size: 1.25rem;
    font-weight: 700;
    color: #0c2340;
}

[data-theme="dark"] .commission-rate__percentage {
    color: #d4af37;
}

.commission-rate__label {
    font-size: 0.75rem;
    color: #64748b;
}

[data-theme="dark"] .commission-rate__label {
    color: rgba(255, 255, 255, 0.5);
}

.commission-rate__threshold {
    font-size: 0.75rem;
    color: #64748b;
    font-style: italic;
}

/* Minimum Cell */
.commission-minimum {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.commission-minimum__value {
    font-weight: 600;
    color: #1a1d20;
}

[data-theme="dark"] .commission-minimum__value {
    color: #f1f5f9;
}

.commission-minimum__bonus {
    font-size: 0.75rem;
    color: #64748b;
}

/* Tier Cell */
.commission-tier {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.commission-tier__percentage {
    font-weight: 600;
    color: #d4af37;
}

.commission-tier__label {
    font-size: 0.75rem;
    color: #64748b;
}

.commission-tier--none {
    font-size: 0.85rem;
    color: #9ca3af;
    font-style: italic;
}

/* Cap Cell */
.commission-cap {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.commission-cap__value {
    font-weight: 600;
    color: #1a1d20;
}

[data-theme="dark"] .commission-cap__value {
    color: #f1f5f9;
}

.commission-cap__label {
    font-size: 0.75rem;
    color: #64748b;
}

/* ============================================
   Mobile Cards (Hidden on Desktop)
   ============================================ */
.commission-mobile-cards {
    display: none;
}

@media (max-width: 1024px) {
    .commission-table-wrapper {
        display: none;
    }

    .commission-mobile-cards {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 1rem;
    }
}

.commission-mobile-card {
    background: #ffffff !important;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
}

[data-theme="dark"] .commission-mobile-card {
    background: rgba(30, 41, 59, 0.6) !important;
    border-color: rgba(255, 255, 255, 0.08);
}

.commission-mobile-card__header {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

[data-theme="dark"] .commission-mobile-card__header {
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

.commission-mobile-card__icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(12, 35, 64, 0.05) 0%, rgba(212, 175, 55, 0.1) 100%);
    color: #0c2340;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

[data-theme="dark"] .commission-mobile-card__icon {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.15) 0%, rgba(212, 175, 55, 0.05) 100%);
    color: #d4af37;
}

.commission-mobile-card__title {
    font-family: var(--font-family-heading, 'Playfair Display', serif);
    font-size: 1.1rem;
    font-weight: 700;
    color: #1a1d20;
    margin: 0 0 0.25rem 0;
}

[data-theme="dark"] .commission-mobile-card__title {
    color: #f1f5f9;
}

.commission-mobile-card__description {
    font-size: 0.85rem;
    color: #64748b;
    margin: 0;
    line-height: 1.4;
}

[data-theme="dark"] .commission-mobile-card__description {
    color: rgba(255, 255, 255, 0.6);
}

.commission-mobile-card__details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.commission-mobile-card__detail {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.commission-mobile-card__detail-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.commission-mobile-card__detail-value {
    font-size: 1rem;
    font-weight: 600;
    color: #1a1d20;
}

[data-theme="dark"] .commission-mobile-card__detail-value {
    color: #f1f5f9;
}

.commission-mobile-card__detail-value--rate {
    color: #0c2340;
    font-size: 1.25rem;
}

[data-theme="dark"] .commission-mobile-card__detail-value--rate {
    color: #d4af37;
}

.commission-mobile-card__detail-value--tier {
    color: #d4af37;
}

/* ============================================
   Table Summary
   ============================================ */
.commission-table-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 16px;
    margin-top: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

[data-theme="dark"] .commission-table-summary {
    background: rgba(30, 41, 59, 0.6);
}

.commission-summary__item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.95rem;
}

.commission-summary__item i {
    color: #d4af37;
    font-size: 1.25rem;
}

.commission-summary__label {
    color: #64748b;
}

[data-theme="dark"] .commission-summary__label {
    color: rgba(255, 255, 255, 0.6);
}

.commission-summary__value {
    font-weight: 600;
    color: #1a1d20;
}

[data-theme="dark"] .commission-summary__value {
    color: #f1f5f9;
}

@media (max-width: 640px) {
    .commission-table-summary {
        flex-direction: column;
        align-items: flex-start;
    }

    .commission-mobile-card__details {
        grid-template-columns: 1fr;
    }
}
