#home h2 {
    margin-bottom: 20px; /* Add margin-bottom to the h2 element */
    color: var(--primary-light);
    font-weight: 1000;
}

.home-subtitle {
    text-align: center;
    color: var(--primary-dark);
    font-size: 2rem;
    margin: 30px 0 20px;
    font-weight: 1000;
}

.home-description {
    text-align: center;
    color: var(--text-color);
    font-size: 0.95rem;
    max-width: 800px;
    margin: 0 auto 40px;
    line-height: 1.5;
}



/* Home Tabs Navigation */
.home-tabs {
    display: flex;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 25px;
}

.home-tab-btn {
    background: none;
    border: none;
    padding: 12px 20px;
    font-size: 16px;
    color: #718096;
    font-weight: 500;
    cursor: pointer;
    position: relative;
    transition: color 0.2s;
}

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

.home-tab-btn.active {
    color: var(--primary-color);
}

.home-tab-btn.active::after {
    content: "";
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: var(--primary-color);
}

.home-tab-content {
    display: none;
}

.home-tab-content.active {
    display: block;
    animation: fadeIn 0.3s;
}

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

/* Analytics Section */
.analytics-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 25px;
}

.period-selector {
    display: flex;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    overflow: hidden;
}

.period-btn {
    background: none;
    border: none;
    padding: 8px 15px;
    cursor: pointer;
    font-size: 14px;
    color: #718096;
    transition: all 0.2s;
}

.period-btn:not(:last-child) {
    border-right: 1px solid #e2e8f0;
}

.period-btn:hover {
    background-color: #f7fafc;
}

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

/* Date Range Picker */
.date-range-picker {
    position: relative;
}

.date-range-toggle {
    display: flex;
    align-items: center;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 8px 15px;
    font-size: 14px;
    color: #718096;
    cursor: pointer;
}

.date-range-toggle i {
    margin-right: 8px;
    color: var(--primary-color);
}

.date-range-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 5px);
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 15px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    z-index: 100;
    width: 320px;
}

.date-range-dropdown.hidden {
    display: none;
}

.date-inputs {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.date-input-group {
    flex: 1;
    min-width: 130px;
}

.date-input-group label {
    display: block;
    font-size: 12px;
    color: #718096;
    margin-bottom: 5px;
}

.date-input-group input {
    width: 100%;
    padding: 8px;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
}

.apply-date-range {
    width: 100%;
    padding: 8px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.2s;
}

.apply-date-range:hover {
    background-color: var(--primary-dark);
}

/* Stats Cards */
.stats-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 25px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    position: relative;
}

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.stat-header h4 {
    margin: 0;
    color: #718096;
    font-size: 0.9rem;
    font-weight: 500;
}

.stat-trend {
    font-size: 0.8rem;
    font-weight: 500;
    display: flex;
    align-items: center;
}

.stat-trend i {
    font-size: 0.7rem;
    margin-right: 3px;
}

.stat-trend.positive {
    color: #48bb78;
}

.stat-trend.negative {
    color: #e53e3e;
}

.stat-trend.neutral {
    color: #718096;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.8rem;
    color: #a0aec0;
}

.trend-section {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    position: absolute;
    top: 20px;
    right: 20px;
}

/* Chart Container */
.chart-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    padding: 20px;
    padding-bottom: 50px;
    margin-bottom: 25px;
    height: 350px;
    width: 100%;
    box-sizing: border-box;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.chart-header h4 {
    margin: 0;
    color: #2d3748;
    font-size: 1.1rem;
    font-weight: 600;
}

.chart-options {
    display: flex;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
}

.chart-option {
    background: none;
    border: none;
    padding: 6px 12px;
    font-size: 13px;
    color: #718096;
    cursor: pointer;
    transition: all 0.2s;
}

.chart-option:not(:last-child) {
    border-right: 1px solid #e2e8f0;
}

.chart-option:hover {
    background-color: #f7fafc;
}

.chart-option.active {
    background-color: var(--primary-color);
    color: white;
}

/* Analytics Grid for Smaller Charts */
.analytics-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    box-sizing: border-box;
    padding-bottom: 100px;
}

.payment-methods-chart,
.payment-source-chart {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    padding: 20px;
    min-height: 300px;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.payment-methods-chart h4,
.payment-source-chart h4 {
    margin: 0 0 15px 0;
    color: #2d3748;
    font-size: 1.1rem;
    font-weight: 600;
}

.chart-wrapper {
    height: 180px;
    margin-bottom: 15px;
    width: 100%;
}

.chart-legend {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.legend-item {
    display: flex;
    align-items: center;
}

.color-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 8px;
}

.legend-label {
    font-size: 0.85rem;
    color: #4a5568;
}

/* Transactions Section */
.transactions-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
}

.search-container {
    position: relative;
    width: 300px;
}

.search-container input {
    width: 100%;
    padding: 10px 15px;
    padding-right: 40px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 14px;
}

.search-container .fa-search {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #a0aec0;
}

.filter-container {
    display: flex;
    gap: 10px;
}

.filter-container select {
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background-color: white;
    font-size: 14px;
    color: #4a5568;
}

/* Transactions Table */
.transactions-table-container {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    margin-bottom: 20px;
    position: relative;
    min-height: 300px;
}

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

.transactions-table thead {
    background-color: #f8f9fa;
    border-bottom: 1px solid #e2e8f0;
}

.transactions-table th {
    padding: 15px 20px;
    text-align: left;
    font-weight: 600;
    color: #4a5568;
    font-size: 14px;
}

.transactions-table tbody tr {
    border-bottom: 1px solid #e2e8f0;
    transition: background-color 0.2s;
    cursor: pointer;
}

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

.transactions-table tbody tr:hover {
    background-color: #f8fafc;
}

.transactions-table td {
    padding: 15px 20px;
    font-size: 14px;
    color: #4a5568;
}

.payment-id-cell {
    font-family: 'Consolas', monospace;
    color: var(--primary-dark);
    font-weight: 500;
}

/* Transaction Status Badges */
.status-badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.status-completed {
    background-color: rgba(72, 187, 120, 0.1);
    color: #2F855A;
}

.status-pending {
    background-color: rgba(237, 137, 54, 0.1);
    color: #C05621;
}

.status-expired {
    background-color: rgba(229, 62, 62, 0.1);
    color: #C53030;
}

/* Source Badges */
.source-badge {
    display: inline-flex;
    align-items: center;
    font-size: 12px;
    font-weight: 500;
    color: #4a5568;
}

.source-badge i {
    margin-right: 5px;
}

/* Loading & Empty States */
.loading-indicator {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: rgba(255, 255, 255, 0.9);
    z-index: 2;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(77, 187, 154, 0.1);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 10px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-indicator p {
    color: #4a5568;
    font-size: 14px;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 50px 20px;
    text-align: center;
}

.empty-state.hidden {
    display: none;
}

.empty-icon {
    font-size: 40px;
    color: #cbd5e0;
    margin-bottom: 15px;
}

.empty-state h3 {
    margin: 0 0 10px 0;
    color: #4a5568;
}

.empty-state p {
    margin: 0;
    color: #718096;
    max-width: 300px;
}

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

.pagination button {
    padding: 8px 15px;
    background-color: white;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    font-size: 14px;
    color: #4a5568;
    cursor: pointer;
    transition: all 0.2s;
}

.pagination button:hover:not(:disabled) {
    background-color: #f7fafc;
    color: var(--primary-color);
    border-color: #cbd5e0;
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination span {
    margin: 0 15px;
    font-size: 14px;
    color: #718096;
}

/* Transaction Details Modal */
.transaction-modal {
    max-width: 600px;
}

.transaction-details {
    padding: 0;
}

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

.transaction-id {
    font-family: 'Consolas', monospace;
    font-size: 1rem;
    color: var(--primary-dark);
    font-weight: 600;
}

.transaction-status {
    margin-top: 0;
}

.transaction-amount {
    font-size: 1.6rem;
    font-weight: 600;
    color: #2d3748;
    margin: 15px 0;
}

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

.transaction-section h4 {
    font-size: 1rem;
    color: #4a5568;
    margin: 0 0 10px 0;
    font-weight: 500;
}

.detail-row {
    display: flex;
    padding: 8px 0;
    border-bottom: 1px solid #f7fafc;
}

.detail-label {
    flex: 0 0 120px;
    color: #718096;
}

.detail-value {
    flex: 1;
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.transaction-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e2e8f0;
}

  
.transaction-detail-header h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #2d3748;
}
  
.transaction-detail-body {
    display: flex;
    flex-direction: column;
    gap: 0; /* Remove gap to let border-bottom handle spacing */
}

.modal-body {
    padding: 20px;
    max-height: 80vh;
    overflow-y: auto; /* Add scroll if content is too long */
}

.transaction-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.transaction-link:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.modal-container-tx {
    max-width: 550px;
}
  
.detail-value .copy-btn-wallet {
    min-width: 30px; /* Give button a minimum width */
    flex-shrink: 0;  /* Keep button from shrinking */
    margin-left: 8px;
    background: none;
    border: none;
    color: #a0aec0;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
  }

.detail-value .copy-btn-wallet:hover {
    color: var(--primary-color);
    background-color: #f7fafc;
}

/* Hidden class */
.hidden {
    display: none !important;
}

/* Responsive Adjustments */
@media (max-width: 1200px) {
    .stats-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 992px) {
    .analytics-grid {
        grid-template-columns: 1fr;
    }
    
    .analytics-header,
    .transactions-header {
        flex-direction: column;
        gap: 15px;
    }
    
    .search-container,
    .period-selector {
        width: 100%;
    }
    
    .filter-container {
        width: 100%;
    }
    
    .filter-container select {
        flex: 1;
    }
}

@media (max-width: 768px) {
    .stats-cards {
        grid-template-columns: 1fr;
    }
    
    .chart-container {
        height: 300px;
    }
    
    .transactions-table th:nth-child(3),
    .transactions-table td:nth-child(3),
    .transactions-table th:nth-child(4),
    .transactions-table td:nth-child(4) {
        display: none;
    }
}

/* Better responsiveness for stats cards */
@media (max-width: 1200px) {
    .stats-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
}

@media (max-width: 768px) {
    .stats-cards {
        grid-template-columns: 1fr;
    }
    
    .home-tabs {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .home-tab-btn {
        padding: 10px 15px;
        font-size: 14px;
    }
    
    .analytics-header {
        flex-direction: column;
        gap: 10px;
    }

    .date-range-picker, 
    .period-filters, 
    .refresh-btn {
        width: 100%;
    }
    
    .period-filters {
        display: flex;
        justify-content: space-between;
    }
    
    .period-btn {
        flex: 1;
        font-size: 12px;
        padding: 6px 8px;
    }
    
    .date-range-toggle {
        width: 100%;
        justify-content: center;
    }
    
    .refresh-btn {
        text-align: center;
        justify-content: center;
    }
    
    .transactions-header {
        flex-direction: column;
        gap: 10px;
    }
    
    .search-container {
        width: 100%;
    }
    
    .filter-container {
        flex-wrap: wrap;
        width: 100%;
    }
    
    .filter-container select {
        flex: 1;
        min-width: 120px;
        font-size: 13px;
    }
    
    .transactions-table {
        font-size: 0.85rem;
    }
    
    /* Make tables scrollable horizontally */
    .transactions-table-container {
        overflow-x: auto;
    }
}

@media (max-width: 480px) {
    .chart-container {
        height: 250px;
        padding: 15px;
        margin-bottom: 15px;
    }
    
    .analytics-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .payment-methods-chart,
    .payment-source-chart {
        min-height: 250px;
        padding: 15px;
    }
    
    .chart-wrapper {
        height: 160px;
    }
    
    .transactions-table th,
    .transactions-table td {
        padding: 10px;
        font-size: 12px;
    }
    
    /* Simplify tables for very small screens */
    .transactions-table th:nth-child(2),
    .transactions-table td:nth-child(2),
    .transactions-table th:nth-child(4),
    .transactions-table td:nth-child(4) {
        display: none;
    }
    
    .home-subtitle {
        font-size: 1.5rem;
        margin: 20px 0 15px;
    }
    
    .home-description {
        font-size: 0.9rem;
        margin-bottom: 25px;
    }
}

@media (max-width: 576px) {
    .transactions-table th:nth-child(5),
    .transactions-table td:nth-child(5) {
        display: none;
    }
}

/* Refresh Button */
.refresh-btn {
    background-color: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 8px 12px;
    color: #4a5568;
    font-size: 14px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.refresh-btn:hover {
    background-color: #edf2f7;
    color: #2d3748;
    border-color: #cbd5e0;
}

.refresh-btn:active {
    transform: translateY(1px);
}

.refresh-btn i {
    font-size: 12px;
}

/* Add a spinning animation for when data is refreshing */
body.refreshing .refresh-btn i {
    animation: spin 1s linear infinite;
}

/* Position the refresh button in the analytics header */
.analytics-header .refresh-btn {
    margin-left: auto; /* Push it to the right */
}

/* Style for toast notifications */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #2d3748;
    color: white;
    padding: 12px 20px;
    border-radius: 6px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transform: translateY(30px);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1000;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast-success {
    background: #4dbb9a;
    color: white;
}

.toast-error {
    background: #e53e3e;
    color: white;
}

/* Add these missing modal styles */

/* Modal Overlay - covers the entire screen */
.modal-overlay-tx {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

/* Modal Container - the white box */
.modal-container-tx {
  background-color: rgb(255, 255, 255);
  border-radius: 8px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  width: 100%;
  max-width: 500px;
  overflow: hidden;
  position: relative;
}

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

.modal-header h3 {
  margin: 0;
  color: #2d3748;
  font-size: 1.2rem;
}

/* Close button */
.modal-close-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #a0aec0;
}

.modal-close-btn:hover {
  color: #4a5568;
}


.detail-group {
  display: flex;
  padding: 8px 0;
  border-bottom: 1px solid #f7fafc;
}