/* Billing & Invoices Page Styles */

/* Page Header */
.page-header {
    margin-bottom: 30px;
}

.page-header h2 {
    font-size: 1.8rem;
    color: var(--text-color-dark);
    margin-bottom: 5px;
}

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

/* Billing Sections */
.billing-sections {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.section {
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #eee;
}

.section-header h3 {
    font-size: 1.2rem;
    color: var(--text-color-dark);
    margin: 0;
}

/* Subscription Section */
.subscription-details {
    padding: 20px;
}

.plan-info {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.plan-badge {
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.9rem;
    font-weight: 500;
    margin-right: 20px;
}

.plan-badge.free {
    background-color: #e0e0e0;
    color: #555;
}

.plan-badge.silver {
    background-color: #c0c0c0;
    color: #333;
}

.plan-badge.premium {
    background-color: #4a6cf7;
    color: white;
}

.plan-badge.advanced {
    background-color: #9c27b0;
    color: white;
}

.plan-price h4 {
    font-size: 1.3rem;
    color: var(--text-color-dark);
    margin: 0 0 5px 0;
}

.plan-price p {
    color: var(--text-color-light);
    font-size: 0.9rem;
    margin: 0;
}

.plan-features {
    margin-bottom: 20px;
}

.plan-features ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 10px;
}

.plan-features li {
    display: flex;
    align-items: center;
    color: var(--text-color);
    font-size: 0.95rem;
}

.plan-features li i {
    color: #4CAF50;
    margin-right: 10px;
}

.plan-actions {
    display: flex;
    gap: 15px;
}

.btn {
    padding: 10px 20px;
    border-radius: 5px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    border: none;
    font-size: 0.95rem;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-color-dark);
}

.btn-outline {
    background-color: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline:hover {
    background-color: var(--primary-color);
    color: white;
}

.btn-danger {
    background-color: transparent;
    border: 1px solid #f44336;
    color: #f44336;
}

.btn-danger:hover {
    background-color: #f44336;
    color: white;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 0.85rem;
}

/* Payment Methods Section */
.payment-methods {
    padding: 20px;
}

.payment-method {
    display: flex;
    align-items: center;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 15px;
    border: 1px solid #eee;
    transition: all 0.3s;
}

.payment-method:last-child {
    margin-bottom: 0;
}

.payment-method.active {
    border-color: var(--primary-color);
    background-color: rgba(74, 108, 247, 0.05);
}

.payment-icon {
    width: 40px;
    height: 40px;
    background-color: #f5f5f5;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
}

.payment-icon i {
    font-size: 1.5rem;
}

.payment-icon .fa-cc-visa {
    color: #1a1f71;
}

.payment-icon .fa-cc-mastercard {
    color: #eb001b;
}

.payment-details {
    flex: 1;
}

.payment-details h4 {
    font-size: 1rem;
    color: var(--text-color-dark);
    margin: 0 0 5px 0;
}

.payment-details p {
    color: var(--text-color-light);
    font-size: 0.85rem;
    margin: 0;
}

.payment-actions {
    display: flex;
    align-items: center;
}

.default-badge {
    background-color: #4CAF50;
    color: white;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 0.75rem;
    margin-right: 10px;
}

.btn-icon {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: transparent;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn-icon:hover {
    background-color: #f5f5f5;
}

/* Invoices Section */
.invoices-table-container {
    padding: 20px;
    overflow-x: auto;
}

.invoices-table {
    width: 100%;
    border-collapse: collapse;
}

.invoices-table th {
    text-align: left;
    padding: 12px 15px;
    background-color: #f9f9f9;
    color: var(--text-color-dark);
    font-weight: 500;
    border-bottom: 1px solid #eee;
}

.invoices-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
    color: var(--text-color);
}

.status-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-badge.paid {
    background-color: #e8f5e9;
    color: #4CAF50;
}

.status-badge.pending {
    background-color: #fff8e1;
    color: #FFC107;
}

.status-badge.failed {
    background-color: #ffebee;
    color: #f44336;
}

/* Billing History Section */
.billing-history {
    padding: 20px;
}

.timeline {
    position: relative;
    padding-left: 30px;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 0;
    left: 15px;
    height: 100%;
    width: 2px;
    background-color: #eee;
}

.timeline-item {
    position: relative;
    margin-bottom: 30px;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-icon {
    position: absolute;
    left: -30px;
    width: 30px;
    height: 30px;
    background-color: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.9rem;
}

.timeline-content {
    background-color: #f9f9f9;
    padding: 15px;
    border-radius: 5px;
}

.timeline-content h4 {
    font-size: 1rem;
    color: var(--text-color-dark);
    margin: 0 0 5px 0;
}

.timeline-content p {
    color: var(--text-color);
    font-size: 0.9rem;
    margin: 0 0 10px 0;
}

.timeline-date {
    color: var(--text-color-light);
    font-size: 0.85rem;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background-color: white;
    border-radius: 10px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
}

.modal-header h3 {
    font-size: 1.2rem;
    color: var(--text-color-dark);
    margin: 0;
}

.close-modal {
    background-color: transparent;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--text-color-light);
}

.modal-body {
    flex: 1;
    overflow: auto;
    padding: 20px;
}

#invoiceFrame {
    width: 100%;
    height: 500px;
    border: none;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    padding: 15px 20px;
    border-top: 1px solid #eee;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .plan-features ul {
        grid-template-columns: 1fr;
    }
    
    .plan-actions {
        flex-direction: column;
    }
    
    .payment-method {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .payment-icon {
        margin-right: 0;
        margin-bottom: 10px;
    }
    
    .payment-details {
        margin-bottom: 10px;
    }
    
    .payment-actions {
        width: 100%;
        justify-content: space-between;
    }
    
    .invoices-table th:nth-child(2),
    .invoices-table td:nth-child(2) {
        display: none;
    }
    
    .modal-content {
        width: 95%;
    }
    
    #invoiceFrame {
        height: 400px;
    }
}

@media (max-width: 480px) {
    .invoices-table th:nth-child(3),
    .invoices-table td:nth-child(3) {
        display: none;
    }
    
    #invoiceFrame {
        height: 300px;
    }
}
