/* ============================================================================
   DATA TABLES - Purchases & Licenses
   ============================================================================ */

/* Table Container */
.table-container {
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

/* Data Table */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.data-table thead {
    background: var(--bg-secondary);
    border-bottom: 2px solid var(--border-color);
}

.data-table th {
    padding: 1.2rem 1.5rem;
    text-align: left;
    font-weight: 700;
    color: var(--text-color);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: background 0.2s;
}

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

.data-table tbody tr:hover {
    background: var(--bg-secondary);
}

.data-table td {
    padding: 1.2rem 1.5rem;
    color: var(--text-color);
    vertical-align: middle;
}

/* Plugin Cell with Image */
.plugin-cell {
    min-width: 250px;
}

.plugin-info-cell {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.plugin-thumb {
    width: 60px;
    height: 45px;
    object-fit: cover;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
}

.plugin-info-cell strong {
    display: block;
    color: var(--text-color);
    font-weight: 600;
    font-size: 1rem;
}

.promo-code {
    display: block;
    color: var(--primary-color);
    font-size: 0.85rem;
    margin-top: 0.2rem;
}

/* Amount Cell */
.amount-cell {
    text-align: right;
    min-width: 120px;
}

.amount-cell strong {
    display: block;
    font-size: 1.1rem;
    color: var(--primary-color);
    font-weight: 700;
}

.original-amount {
    display: block;
    font-size: 0.85rem;
    color: var(--text-light);
    text-decoration: line-through;
    margin-top: 0.2rem;
}

/* Discount Cell */
.discount-cell {
    text-align: center;
    min-width: 100px;
}

.discount-badge {
    display: inline-block;
    background: #10b981;
    color: var(--white);
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    text-align: center;
    min-width: 90px;
}

.status-success {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
    border: 1px solid #10b981;
}

.status-warning {
    background: rgba(251, 191, 36, 0.2);
    color: #fbbf24;
    border: 1px solid #fbbf24;
}

.status-error {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border: 1px solid #ef4444;
}

.status-refunded {
    background: rgba(156, 163, 175, 0.2);
    color: #9ca3af;
    border: 1px solid #9ca3af;
}

/* License Key Cell */
.license-key-cell {
    max-width: 300px;
}

.license-key-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-secondary);
    padding: 0.6rem 1rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.license-key-code {
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    color: var(--primary-color);
    letter-spacing: 0.5px;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.btn-copy {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0.2rem 0.5rem;
    transition: transform 0.2s;
    flex-shrink: 0;
}

.btn-copy:hover {
    transform: scale(1.2);
}

.btn-copy:active {
    transform: scale(0.9);
}

/* Activations Cell */
.activations-cell {
    min-width: 150px;
}

.activations-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.activations-count {
    font-size: 0.9rem;
    color: var(--text-color);
    font-weight: 600;
}

.activations-bar {
    width: 100%;
    height: 6px;
    background: var(--bg-secondary);
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.activations-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    transition: width 0.3s ease;
    border-radius: 10px;
}

/* Loading & Empty States */
.loading {
    text-align: center;
    padding: 4rem 2rem;
}

.loading .spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(0, 217, 255, 0.2);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    margin: 0 auto 1rem;
    animation: spin 1s linear infinite;
}

.loading p {
    color: var(--text-light);
    font-size: 1rem;
}

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
}

.empty-state p {
    color: var(--text-light);
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
}

/* Responsive Tables */
@media (max-width: 1024px) {
    .data-table {
        font-size: 0.85rem;
    }

    .data-table th,
    .data-table td {
        padding: 1rem;
    }

    .plugin-thumb {
        width: 50px;
        height: 38px;
    }
}

@media (max-width: 768px) {
    .table-container {
        overflow-x: auto;
    }

    .data-table {
        min-width: 700px;
        font-size: 0.8rem;
    }

    .data-table th,
    .data-table td {
        padding: 0.8rem;
    }

    .plugin-cell {
        min-width: 200px;
    }

    .plugin-thumb {
        width: 40px;
        height: 30px;
    }

    .license-key-code {
        font-size: 0.75rem;
    }
}

/* Btn Owned Style */
.btn-owned {
    background: var(--bg-secondary);
    color: var(--text-light);
    cursor: not-allowed;
    opacity: 0.7;
}

.btn-owned:hover {
    transform: none;
    box-shadow: none;
}
