/* Payment History Page Styles */
.payment-history-page {
    background: #f8fafc;
    min-height: 100vh;
}

.payment-history-page .main-content {
    padding-top: 80px;
}

/* Page Header */
.page-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 60px 0;
    text-align: center;
}

.page-header h1 {
    font-size: 3rem;
    font-weight: 700;
    margin: 0 0 16px 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.page-header p {
    font-size: 1.25rem;
    margin: 0;
    opacity: 0.9;
}

/* Payment History Content */
.payment-history-content {
    padding: 60px 0;
}

.history-container {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 40px;
    max-width: 1400px;
    margin: 0 auto;
}

/* Sidebar */
.history-sidebar {
    background: white;
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    height: fit-content;
    position: sticky;
    top: 100px;
}

.sidebar-section {
    margin-bottom: 32px;
}

.sidebar-section:last-child {
    margin-bottom: 0;
}

.sidebar-section h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #111827;
    margin: 0 0 20px 0;
    padding-bottom: 12px;
    border-bottom: 2px solid #e5e7eb;
}

.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.action-buttons .btn-primary,
.action-buttons .btn-secondary {
    width: 100%;
    justify-content: center;
    padding: 12px 16px;
}

.summary-stats {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.stat-label {
    font-size: 0.875rem;
    color: #6b7280;
    font-weight: 500;
}

.stat-value {
    font-size: 1.125rem;
    font-weight: 600;
    color: #111827;
}

.filter-options {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-group label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
}

.filter-group select {
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: white;
    font-size: 0.875rem;
    color: #111827;
    transition: border-color 0.2s;
}

.filter-group select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Main Content */
.history-main {
    background: white;
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e5e7eb;
}

.history-header h2 {
    font-size: 1.875rem;
    font-weight: 600;
    color: #111827;
    margin: 0;
}

.history-actions {
    display: flex;
    gap: 12px;
}

/* Transaction Items */
.transactions-list {
    margin-bottom: 32px;
}

.transaction-item {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
    background: white;
    transition: all 0.2s;
}

.transaction-item:hover {
    border-color: #3b82f6;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.1);
}

.transaction-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}

.transaction-info h4 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #111827;
    margin: 0 0 8px 0;
}

.transaction-date {
    font-size: 0.875rem;
    color: #6b7280;
}

.transaction-amount {
    text-align: right;
}

.transaction-amount .amount {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: #111827;
}

.transaction-amount .currency {
    font-size: 0.875rem;
    color: #6b7280;
}

.transaction-details {
    background: #f9fafb;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #e5e7eb;
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-row .label {
    font-weight: 500;
    color: #374151;
}

.detail-row .value {
    font-weight: 600;
    color: #111827;
    display: flex;
    align-items: center;
    gap: 8px;
}

.status {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-completed {
    background: #d1fae5;
    color: #065f46;
}

.status-pending {
    background: #fef3c7;
    color: #92400e;
}

.status-failed {
    background: #fee2e2;
    color: #991b1b;
}

.status-refunded {
    background: #e0e7ff;
    color: #3730a3;
}

.transaction-items {
    margin-bottom: 20px;
}

.transaction-items h5 {
    font-size: 1rem;
    font-weight: 600;
    color: #374151;
    margin: 0 0 12px 0;
}

.transaction-items ul {
    margin: 0;
    padding-left: 20px;
    color: #6b7280;
}

.transaction-items li {
    margin-bottom: 4px;
}

.transaction-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.transaction-actions .btn-secondary {
    padding: 8px 16px;
    font-size: 0.875rem;
}

/* Loading and Empty States */
.loading-state,
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6b7280;
}

.loading-state i {
    font-size: 3rem;
    color: #3b82f6;
    margin-bottom: 16px;
}

.empty-state i {
    font-size: 4rem;
    color: #d1d5db;
    margin-bottom: 16px;
}

.loading-state p,
.empty-state p {
    font-size: 1.125rem;
    margin: 0;
}

.empty-state h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #374151;
    margin: 0 0 8px 0;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    margin-top: 32px;
}

.pagination-controls {
    display: flex;
    gap: 8px;
    align-items: center;
}

.pagination-controls .btn-secondary,
.pagination-controls .btn-primary {
    padding: 8px 12px;
    min-width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pagination-controls .current-page {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

.pagination-ellipsis {
    padding: 8px 12px;
    color: #6b7280;
    font-weight: 500;
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: white;
    border-radius: 16px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    animation: slideUp 0.3s ease;
}

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

.modal-header h3 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: #111827;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #6b7280;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s;
}

.modal-close:hover {
    background: #f3f4f6;
    color: #374151;
}

.modal-body {
    padding: 24px;
}

/* Payment Methods Modal */
.saved-methods {
    margin-bottom: 32px;
}

.saved-methods h4 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #111827;
    margin: 0 0 16px 0;
}

.empty-methods {
    text-align: center;
    padding: 40px 20px;
    color: #6b7280;
    background: #f9fafb;
    border-radius: 8px;
}

.saved-method {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin-bottom: 12px;
    background: #f9fafb;
}

.method-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.method-info i {
    font-size: 1.5rem;
    color: #3b82f6;
}

.method-details {
    display: flex;
    flex-direction: column;
}

.method-name {
    font-weight: 600;
    color: #111827;
}

.method-meta {
    font-size: 0.875rem;
    color: #6b7280;
}

.method-actions {
    display: flex;
    gap: 8px;
}

.method-actions .btn-secondary {
    padding: 6px 12px;
    font-size: 0.875rem;
}

.method-actions .btn-secondary.danger {
    color: #dc2626;
    border-color: #dc2626;
}

.method-actions .btn-secondary.danger:hover {
    background: #dc2626;
    color: white;
}

.add-new-method h4 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #111827;
    margin: 0 0 16px 0;
}

.add-method-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
}

.method-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.method-option:hover {
    border-color: #3b82f6;
    background: #f0f9ff;
}

.method-option i {
    font-size: 2rem;
    color: #3b82f6;
    margin-bottom: 12px;
}

.method-option span {
    font-weight: 500;
    color: #374151;
    font-size: 0.875rem;
}

/* Add Method Modal */
.add-method-modal .modal-content {
    max-width: 500px;
}

.stripe-form,
.paypal-form,
.coinbase-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: 500;
    color: #374151;
}

.form-group input {
    padding: 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 20px;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { 
        opacity: 0;
        transform: translateY(20px);
    }
    to { 
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .history-container {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    
    .history-sidebar {
        position: static;
        order: 2;
    }
}

@media (max-width: 768px) {
    .page-header h1 {
        font-size: 2.5rem;
    }
    
    .page-header p {
        font-size: 1.125rem;
    }
    
    .payment-history-content {
        padding: 40px 0;
    }
    
    .history-container {
        padding: 0 20px;
    }
    
    .history-sidebar,
    .history-main {
        padding: 24px;
    }
    
    .history-header {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
    }
    
    .history-actions {
        width: 100%;
        justify-content: stretch;
    }
    
    .history-actions .btn-secondary {
        flex: 1;
    }
    
    .transaction-header {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
    }
    
    .transaction-amount {
        text-align: left;
    }
    
    .transaction-actions {
        flex-direction: column;
    }
    
    .transaction-actions .btn-secondary {
        width: 100%;
        justify-content: center;
    }
    
    .add-method-options {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        width: 95%;
        margin: 20px;
    }
    
    .modal-header,
    .modal-body {
        padding: 16px;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions .btn-primary,
    .form-actions .btn-secondary {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .page-header {
        padding: 40px 0;
    }
    
    .page-header h1 {
        font-size: 2rem;
    }
    
    .payment-history-content {
        padding: 20px 0;
    }
    
    .history-container {
        padding: 0 16px;
    }
    
    .history-sidebar,
    .history-main {
        padding: 20px;
    }
    
    .sidebar-section {
        margin-bottom: 24px;
    }
    
    .transaction-item {
        padding: 20px;
    }
    
    .transaction-details {
        padding: 16px;
    }
    
    .detail-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
}
