/* ================================================
   BILLING HISTORY PAGE - Modern Billing Dashboard
   ================================================ */

/* ================================================
   1. BILLING CONTENT & CONTAINER
   ================================================ */

.billing-content {
    flex: 1;
    padding: 32px 24px;
    overflow-y: auto;
    background: linear-gradient(135deg, #0f1419 0%, #1a1f2e 100%);
}



.billing-container h1 {
    font-size: 38px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #00d084 0%, #0099cc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.billing-subtitle {
    color: #9ca3af;
    font-size: 16px;
    margin-bottom: 32px;
    margin-top: 0;
}

/* ================================================
   2. BILLING HEADER
   ================================================ */

.billing-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.billing-title-group {
    flex: 1;
    min-width: 250px;
}

.download-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: linear-gradient(135deg, #14b8a6 0%, #06b6d4 100%);
    border: none;
    border-radius: 10px;
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(20, 184, 166, 0.3);
}

.download-btn .icon {
    width: 18px;
    height: 18px;
    stroke-width: 2;
}

/* ================================================
   3. BILLING SUMMARY CARDS
   ================================================ */

.billing-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.summary-card {
    background: linear-gradient(135deg, #1a1f2e 0%, #2d3748 100%);
    border: 1px solid rgba(20, 184, 166, 0.15);
    border-radius: 14px;
    padding: 24px;
    display: flex;
    gap: 18px;
    transition: all 0.3s ease;
    animation: slideInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    opacity: 0;
}

.summary-card:nth-child(1) {
    animation-delay: 0.1s;
}

.summary-card:nth-child(2) {
    animation-delay: 0.15s;
}

.summary-card:nth-child(3) {
    animation-delay: 0.2s;
}

.summary-card:nth-child(4) {
    animation-delay: 0.25s;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.summary-card:hover {
    border-color: rgba(20, 184, 166, 0.3);
    box-shadow: 0 12px 24px rgba(20, 184, 166, 0.1);
    transform: translateY(-4px);
}

.summary-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(20, 184, 166, 0.2), rgba(6, 182, 212, 0.2));
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #14b8a6;
    border: 1px solid rgba(20, 184, 166, 0.3);
}

.summary-icon svg {
    width: 28px;
    height: 28px;
    stroke-width: 2;
}

.summary-icon.success {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(20, 184, 166, 0.2));
    color: #10b981;
    border-color: rgba(16, 185, 129, 0.3);
}

.summary-icon.warning {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(234, 179, 8, 0.2));
    color: #f59e0b;
    border-color: rgba(245, 158, 11, 0.3);
}

.summary-icon.info {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(6, 182, 212, 0.2));
    color: #3b82f6;
    border-color: rgba(59, 130, 246, 0.3);
}

.summary-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.summary-content h3 {
    font-size: 13px;
    font-weight: 600;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0;
}

.summary-value {
    font-size: 24px;
    font-weight: 700;
    color: #ffffff;
    font-variant-numeric: tabular-nums;
}

.summary-meta {
    font-size: 12px;
    color: #6b7280;
    margin: 0;
}

/* ================================================
   4. BILLING SECTION - Invoices
   ================================================ */

.billing-section {
    margin-bottom: 40px;
    animation: fadeInScale 0.6s ease-out forwards;
    opacity: 0;
    animation-delay: 0.3s;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.98);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.section-header {
    margin-bottom: 24px;
}

.section-header h2 {
    font-size: 22px;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 4px 0;
}

.section-subtext {
    font-size: 14px;
    color: #9ca3af;
    margin: 0;
}

.invoices-container {
    background: linear-gradient(135deg, #1a1f2e 0%, #2d3748 100%);
    border: 1px solid rgba(20, 184, 166, 0.15);
    border-radius: 14px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.invoices-container:hover {
    border-color: rgba(20, 184, 166, 0.25);
    box-shadow: 0 8px 16px rgba(20, 184, 166, 0.08);
}

.table-wrapper {
    overflow-x: auto;
}

.invoices-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.invoices-table thead {
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(20, 184, 166, 0.2);
}

.invoices-table th {
    padding: 16px 20px;
    text-align: left;
    font-weight: 600;
    color: #9ca3af;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.invoices-table td {
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: #d1d5db;
    transition: all 0.3s ease;
}

.invoices-table tbody tr {
    transition: all 0.3s ease;
}

.invoices-table tbody tr:hover {
    background: rgba(20, 184, 166, 0.05);
}

.invoices-table tbody tr:hover td {
    color: #ffffff;
}

.invoice-id {
    font-weight: 600;
    color: #14b8a6;
}

.amount {
    font-weight: 700;
    color: #ffffff;
    font-variant-numeric: tabular-nums;
}

.status-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    width: fit-content;
}

.status-badge.paid {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-badge.pending {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.status-badge.failed {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, rgba(20, 184, 166, 0.1), rgba(6, 182, 212, 0.1));
    border: 1px solid rgba(20, 184, 166, 0.2);
    border-radius: 8px;
    color: #14b8a6;
    cursor: pointer;
    transition: all 0.3s ease;
}

.action-btn:hover {
    background: linear-gradient(135deg, rgba(20, 184, 166, 0.2), rgba(6, 182, 212, 0.2));
    border-color: rgba(20, 184, 166, 0.4);
    transform: translateY(-2px);
}

.action-btn svg {
    width: 18px;
    height: 18px;
    stroke-width: 2;
}

/* ================================================
   5. BILLING GRID - Cards Layout
   ================================================ */

.billing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
}

.billing-card {
    background: linear-gradient(135deg, #1a1f2e 0%, #2d3748 100%);
    border: 1px solid rgba(20, 184, 166, 0.15);
    border-radius: 14px;
    padding: 28px;
    transition: all 0.3s ease;
    animation: slideInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    opacity: 0;
}

.billing-card:nth-child(1) {
    animation-delay: 0.35s;
}

.billing-card:nth-child(2) {
    animation-delay: 0.4s;
}

.billing-card:nth-child(3) {
    animation-delay: 0.45s;
}

.billing-card:nth-child(4) {
    animation-delay: 0.5s;
}

.billing-card:hover {
    border-color: rgba(20, 184, 166, 0.3);
    box-shadow: 0 12px 24px rgba(20, 184, 166, 0.1);
    transform: translateY(-4px);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    gap: 16px;
}

.card-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: #ffffff;
    margin: 0;
}

.add-btn,
.edit-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, rgba(20, 184, 166, 0.1), rgba(6, 182, 212, 0.1));
    border: 1px solid rgba(20, 184, 166, 0.2);
    border-radius: 8px;
    color: #14b8a6;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 600;
    padding: 0;
}

.add-btn:hover,
.edit-btn:hover {
    background: linear-gradient(135deg, rgba(20, 184, 166, 0.2), rgba(6, 182, 212, 0.2));
    border-color: rgba(20, 184, 166, 0.4);
    transform: translateY(-2px);
}

.add-btn svg,
.edit-btn svg {
    width: 18px;
    height: 18px;
    stroke-width: 2;
}

/* ================================================
   6. PAYMENT METHODS
   ================================================ */

.payment-methods-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 20px;
}

.payment-method {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    transition: all 0.3s ease;
}

.payment-method.active {
    background: rgba(20, 184, 166, 0.1);
    border-color: rgba(20, 184, 166, 0.3);
}

.payment-method:hover {
    background: rgba(20, 184, 166, 0.15);
    border-color: rgba(20, 184, 166, 0.4);
}

.payment-icon {
    width: 48px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(59, 130, 246, 0.15);
    border-radius: 6px;
    color: #3b82f6;
    flex-shrink: 0;
}

.payment-icon svg {
    width: 28px;
    height: 20px;
}

.payment-icon.visa {
    background: rgba(20, 184, 166, 0.15);
    color: #14b8a6;
}

.payment-icon.mastercard {
    background: rgba(236, 72, 153, 0.15);
    color: #ec4899;
}

.payment-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.payment-name {
    font-weight: 600;
    color: #ffffff;
    font-size: 14px;
}

.payment-meta {
    font-size: 12px;
    color: #9ca3af;
}

.default-badge {
    padding: 4px 10px;
    background: rgba(20, 184, 166, 0.2);
    color: #14b8a6;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.2px;
}

.remove-btn {
    padding: 6px 12px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 6px;
    color: #ef4444;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.remove-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.5);
}

/* ================================================
   7. SUBSCRIPTION DETAILS
   ================================================ */

.subscription-details {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.detail-row:last-of-type {
    border-bottom: none;
}

.detail-label {
    font-size: 14px;
    color: #9ca3af;
    font-weight: 500;
}

.detail-value {
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
}

.detail-value.price {
    color: #14b8a6;
    font-size: 16px;
}

.detail-value.status {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #10b981;
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.subscription-actions {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

.action-btn-primary,
.action-btn-secondary {
    flex: 1;
    padding: 12px 16px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.action-btn-primary {
    background: linear-gradient(135deg, #14b8a6 0%, #06b6d4 100%);
    color: #ffffff;
}

.action-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(20, 184, 166, 0.3);
}

.action-btn-secondary {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.action-btn-secondary:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.3);
}

/* ================================================
   8. BILLING ADDRESS
   ================================================ */

.billing-address {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.address-line {
    font-size: 14px;
    color: #d1d5db;
    line-height: 1.6;
}

.address-line.phone {
    margin-top: 8px;
    color: #14b8a6;
    font-weight: 600;
}

/* ================================================
   9. PROMOTIONS & DISCOUNTS
   ================================================ */

.promotions-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.promotion-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    transition: all 0.3s ease;
    opacity: 1;
}

.promotion-item.expired {
    opacity: 0.6;
}

.promotion-item:hover {
    background: rgba(20, 184, 166, 0.08);
    border-color: rgba(20, 184, 166, 0.2);
}

.promo-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(20, 184, 166, 0.15), rgba(6, 182, 212, 0.15));
    border-radius: 8px;
    color: #14b8a6;
    flex-shrink: 0;
}

.promo-icon svg {
    width: 20px;
    height: 20px;
    stroke-width: 2;
}

.promo-content {
    flex: 1;
}

.promo-code {
    font-weight: 700;
    color: #ffffff;
    font-size: 13px;
    letter-spacing: 1px;
}

.promo-desc {
    font-size: 12px;
    color: #9ca3af;
}

.promo-status {
    padding: 4px 10px;
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.2px;
}

.promotion-item.expired .promo-status {
    background: rgba(107, 114, 128, 0.15);
    color: #9ca3af;
}

.promo-input-group {
    display: flex;
    gap: 8px;
}

.promo-input {
    flex: 1;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(20, 184, 166, 0.2);
    border-radius: 8px;
    color: #ffffff;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.3s ease;
}

.promo-input:focus {
    outline: none;
    border-color: rgba(20, 184, 166, 0.5);
    background: rgba(255, 255, 255, 0.08);
}

.promo-input::placeholder {
    color: #6b7280;
}

.apply-btn {
    padding: 10px 18px;
    background: linear-gradient(135deg, #14b8a6 0%, #06b6d4 100%);
    border: none;
    border-radius: 8px;
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.apply-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(20, 184, 166, 0.3);
}

/* ================================================
   RESPONSIVE DESIGN
   ================================================ */

@media (max-width: 1024px) {
    .billing-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .billing-content {
        padding: 24px 16px;
    }

    .billing-container h1 {
        font-size: 28px;
    }

    .billing-header {
        flex-direction: column;
        align-items: stretch;
    }

    .billing-title-group {
        min-width: auto;
    }

    .download-btn {
        width: 100%;
        justify-content: center;
    }

    .billing-summary {
        grid-template-columns: 1fr;
    }

    .summary-card {
        flex-direction: column;
        text-align: center;
    }

    .summary-icon {
        margin: 0 auto;
    }

    .summary-content {
        align-items: center;
    }

    .section-header {
        margin-bottom: 16px;
    }

    .invoices-table {
        font-size: 13px;
    }

    .invoices-table th,
    .invoices-table td {
        padding: 12px 8px;
    }

    .billing-grid {
        grid-template-columns: 1fr;
    }

    .subscription-actions {
        flex-direction: column;
    }

    .payment-method {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .billing-container h1 {
        font-size: 24px;
    }

    .billing-subtitle {
        font-size: 14px;
        margin-bottom: 24px;
    }

    .billing-card,
    .summary-card {
        padding: 18px;
    }

    .card-header {
        flex-direction: column;
        align-items: stretch;
    }

    .add-btn,
    .edit-btn {
        width: 100%;
    }

    .section-header h2 {
        font-size: 18px;
    }

    .payment-methods-list,
    .promotions-list {
        gap: 10px;
    }

    .detail-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .promo-input-group {
        flex-direction: column;
    }

    .apply-btn {
        width: 100%;
    }
}

/* ================================================
   ANIMATIONS & TRANSITIONS
   ================================================ */

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
