/* billing.css - Styles specific to the billing page */

/* Override desktop overflow hidden for billing page */
body {
    overflow-y: auto !important;
    height: auto !important;
    max-height: none !important;
}

/* Ensure the html element also allows scrolling */
html {
    overflow-y: auto !important;
    height: auto !important;
    max-height: none !important;
}

/* Fix any potential scrollbar styling issues */
html, body {
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 255, 255, 0.3) rgba(255, 255, 255, 0.1);
}

/* Custom scrollbar for WebKit browsers */
html::-webkit-scrollbar,
body::-webkit-scrollbar {
    width: 12px;
}

html::-webkit-scrollbar-track,
body::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
}

html::-webkit-scrollbar-thumb,
body::-webkit-scrollbar-thumb {
    background: rgba(0, 255, 255, 0.3);
    border-radius: 6px;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

html::-webkit-scrollbar-thumb:hover,
body::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 255, 255, 0.5);
}

#billing-container {
    /* Inherits widget-container styles like background, padding, border */
    /* Add any specific overrides if needed */
    max-width: 1400px; /* Much wider to accommodate three containers */
    width: 95%; /* Use most of the screen width */
    padding: 30px 40px;
}

.billing-summary {
    text-align: center;
    margin-bottom: 30px;
    font-size: 1.1em;
}

.billing-summary #current-balance {
    font-weight: bold;
    color: #00ffff; /* Cyan */
}

/* Charts container wrapper for proper layout */
.charts-wrapper {
    display: flex;
    gap: 20px;
    margin-top: 30px;
    flex-wrap: wrap;
}

/* Live Connections Section */
.live-connections-wrapper {
    margin-top: 30px;
    margin-bottom: 30px;
}

.live-connections-wrapper h2 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #00ffff;
    font-size: 1.6em;
    font-weight: 700;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.3);
    letter-spacing: 0.5px;
    text-align: center;
}

.live-connections-container {
    background: linear-gradient(135deg, rgba(0, 255, 255, 0.08), rgba(0, 255, 255, 0.03));
    border-radius: 15px;
    padding: 25px;
    border: 2px solid rgba(0, 255, 255, 0.3);
    box-shadow: 0 8px 32px rgba(0, 255, 255, 0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.live-connections-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #00ffff, #0099cc, #00ffff);
    border-radius: 15px 15px 0 0;
}

.live-connections-container:hover {
    border-color: rgba(0, 255, 255, 0.5);
    box-shadow: 0 12px 40px rgba(0, 255, 255, 0.2);
    transform: translateY(-2px);
}

.live-connections-status {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(0, 255, 255, 0.2);
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.2em;
    font-weight: 600;
    color: #ffffff;
}

.pulse-dot {
    width: 12px;
    height: 12px;
    background: #00ff00;
    border-radius: 50%;
    animation: pulse 2s infinite;
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
}

@keyframes pulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(0, 255, 0, 0.7);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 10px rgba(0, 255, 0, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(0, 255, 0, 0);
    }
}

.last-updated {
    color: #aaa;
    font-size: 0.9em;
}

.last-updated span {
    color: #00ffff;
    font-weight: 500;
}

.connections-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    min-height: 120px;
}

.connection-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03));
    border-radius: 12px;
    padding: 20px;
    border: 1px solid rgba(0, 255, 255, 0.2);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.connection-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #00ffff, #00ff00, #00ffff);
}

.connection-card:hover {
    border-color: rgba(0, 255, 255, 0.4);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 255, 255, 0.15);
}

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

.connection-domain {
    font-size: 1.1em;
    font-weight: 600;
    color: #00ffff;
    margin: 0;
    word-break: break-word;
    max-width: 70%;
}

.connection-status {
    background: rgba(0, 255, 0, 0.2);
    color: #00ff00;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: 500;
    border: 1px solid rgba(0, 255, 0, 0.3);
    white-space: nowrap;
}

.connection-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.connection-detail {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9em;
}

.connection-detail-label {
    color: #aaa;
    font-weight: 500;
}

.connection-detail-value {
    color: #ffffff;
    font-weight: 600;
}

.connection-duration {
    color: #00ffff !important;
}

.connection-time {
    color: #ffa500 !important;
}

.no-connections-message {
    grid-column: 1 / -1;
    text-align: center;
    color: #aaa;
    padding: 40px 20px;
}

.no-connections-icon {
    font-size: 3em;
    margin-bottom: 15px;
    opacity: 0.7;
}

.no-connections-message p {
    font-size: 1.2em;
    margin: 0 0 10px 0;
    color: #ffffff;
}

.no-connections-message small {
    font-size: 0.9em;
    color: #aaa;
    line-height: 1.4;
    max-width: 400px;
    display: inline-block;
}

/* Responsive design for live connections */
@media (max-width: 768px) {
    .live-connections-status {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .connections-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .connection-header {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
    
    .connection-domain {
        max-width: 100%;
    }
    
    .connection-status {
        align-self: flex-start;
    }
}

@media (max-width: 480px) {
    .live-connections-wrapper h2 {
        font-size: 1.4em;
    }
    
    .live-connections-container {
        padding: 20px;
    }
    
    .status-indicator {
        font-size: 1.1em;
    }
    
    .connection-card {
        padding: 15px;
    }
    
    .no-connections-message {
        padding: 30px 15px;
    }
    
    .no-connections-icon {
        font-size: 2.5em;
    }
}

.chart-container {
    flex: 1;
    min-width: 320px;
    background: linear-gradient(135deg, rgba(0, 255, 255, 0.08), rgba(0, 255, 255, 0.03));
    border-radius: 15px;
    padding: 25px;
    border: 2px solid rgba(0, 255, 255, 0.3);
    text-align: center;
    height: 450px;
    max-height: 450px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 8px 32px rgba(0, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.legend-container {
    flex: 0 0 300px;
    min-width: 300px;
    background: linear-gradient(135deg, rgba(0, 255, 255, 0.08), rgba(0, 255, 255, 0.03));
    border-radius: 15px;
    padding: 25px;
    border: 2px solid rgba(0, 255, 255, 0.3);
    height: 450px;
    max-height: 450px;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 8px 32px rgba(0, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.chart-container:hover,
.legend-container:hover {
    border-color: rgba(0, 255, 255, 0.5);
    box-shadow: 0 12px 40px rgba(0, 255, 255, 0.2);
    transform: translateY(-2px);
}

.chart-container::before,
.legend-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #00ffff, #0099cc, #00ffff);
    border-radius: 15px 15px 0 0;
}

.chart-container h2 {
    margin-top: 0;
    margin-bottom: 25px;
    color: #00ffff;
    font-size: 1.4em;
    font-weight: 700;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.3);
    letter-spacing: 0.5px;
}

.legend-container h2 {
    margin-top: 0;
    margin-bottom: 25px;
    color: #00ffff;
    font-size: 1.4em;
    font-weight: 700;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.3);
    letter-spacing: 0.5px;
    text-align: center;
}

#consumption-legend {
    text-align: left;
}

.legend-item {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    border: 1px solid rgba(0, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.legend-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(0, 255, 255, 0.3);
    transform: translateX(5px);
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    margin-right: 12px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    flex-shrink: 0;
}

.legend-text {
    flex: 1;
    color: #ffffff;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    word-wrap: break-word;
    overflow-wrap: break-word;
    min-width: 0; /* Allow text to shrink */
}

.legend-tokens {
    color: #00ffff;
    font-weight: 600;
    font-size: 13px;
    white-space: nowrap;
    margin-left: 8px;
}

.legend-percentage {
    color: #aaa;
    font-size: 12px;
    margin-left: 4px;
    white-space: nowrap;
}

#legend-loading-status {
    color: #aaa;
    font-style: italic;
    font-size: 0.9em;
    text-align: center;
}

#token-usage-chart,
#token-breakdown-chart {
    max-width: 100%;
    height: 320px !important;
    max-height: 320px;
    background: rgba(0, 20, 40, 0.3);
    border-radius: 12px;
    border: 1px solid rgba(0, 255, 255, 0.2);
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.3);
}

#chart-loading-status,
#breakdown-chart-loading-status {
    margin-top: 15px;
    color: #aaa;
    font-style: italic;
    font-size: 0.9em;
}

#history-loading-status {
    text-align: center;
    color: #aaa;
    margin-top: 15px;
    font-style: italic;
}

.history-container {
    margin-top: 30px;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 20px;
    border: 1px solid rgba(0, 255, 255, 0.2);
}

.history-container h2 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #00ffff;
    text-align: center;
}

/* Table container with custom scrolling */
.table-container {
    overflow-x: auto;
    overflow-y: auto;
    max-height: 600px;
    border-radius: 5px;
    margin-top: 15px;
}

#transaction-history-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    min-width: 900px; /* Ensure minimum width for proper display */
}

#transaction-history-table th,
#transaction-history-table td {
    border: 1px solid rgba(0, 255, 255, 0.2);
    padding: 12px 15px;
    text-align: left;
    font-size: 0.9em;
    vertical-align: top; /* Align content to top for better multi-line display */
}

#transaction-history-table th {
    background-color: rgba(0, 255, 255, 0.1);
    color: #00ffff; /* Cyan */
    font-weight: bold;
    position: sticky;
    top: 0;
    z-index: 10;
}

/* Column width optimization */
#transaction-history-table th:nth-child(1),
#transaction-history-table td:nth-child(1) {
    width: 140px; /* Date column */
    min-width: 140px;
}

#transaction-history-table th:nth-child(2),
#transaction-history-table td:nth-child(2) {
    width: 140px; /* Type column */
    min-width: 140px;
}

#transaction-history-table th:nth-child(3),
#transaction-history-table td:nth-child(3) {
    width: 100px; /* Amount column */
    min-width: 100px;
    text-align: right;
}

#transaction-history-table th:nth-child(4),
#transaction-history-table td:nth-child(4) {
    width: auto; /* Details column - takes remaining space */
    min-width: 300px;
}

#transaction-history-table tbody tr:nth-child(odd) {
    background-color: rgba(255, 255, 255, 0.03);
}

#transaction-history-table tbody tr:hover {
    background-color: rgba(0, 255, 255, 0.08);
}

/* Enhanced styling for transaction details */
.transaction-details {
    line-height: 1.4;
    font-size: 0.85em;
}

.transaction-details strong {
    color: #00ffff;
    font-weight: 600;
}

.transaction-details small {
    color: #aaa;
    font-size: 0.9em;
}

.embed-domain {
    color: #ffcc66;
    font-weight: 500;
}

.admin-session {
    color: #66ff99;
    font-weight: 500;
}

.warning-text {
    color: #ffaa66;
    font-weight: 500;
}

.balance-change {
    font-family: 'Courier New', monospace;
    font-size: 0.8em;
}

/* Mobile Card Layout - Hidden by default, shown on mobile */
.mobile-transactions {
    display: none;
}

.transaction-card {
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(0, 255, 255, 0.2);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 12px;
    transition: all 0.3s ease;
}

.transaction-card:hover {
    background-color: rgba(0, 255, 255, 0.08);
    transform: translateY(-1px);
}

.transaction-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 8px;
}

.transaction-date {
    color: #00ffff;
    font-size: 0.9em;
    font-weight: bold;
}

.transaction-amount {
    color: #ffffff;
    font-size: 1.1em;
    font-weight: bold;
    text-align: right;
}

.transaction-type {
    color: #ffcc66;
    font-size: 0.85em;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.transaction-details-mobile {
    color: #cccccc;
    font-size: 0.85em;
    line-height: 1.4;
}

.transaction-details-mobile strong {
    color: #00ffff;
}

.transaction-details-mobile .embed-domain {
    color: #ffcc66;
}

.transaction-details-mobile .admin-session {
    color: #66ff99;
}

.transaction-details-mobile .warning-text {
    color: #ffaa66;
}

/* Navigation Link */
.navigation-links {
    text-align: center;
    margin-top: 20px;
}

.navigation-links .exit-button {
     /* Inherits some styles */
    display: inline-block;
    text-decoration: none;
    padding: 10px 30px;
    background-color: rgba(255, 100, 100, 0.7);
    border: 1px solid rgba(255, 100, 100, 0.9);
    color: #fff;
    border-radius: 5px;
    cursor: pointer;
    font-family: 'Orbitron', sans-serif;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

.navigation-links .exit-button:hover {
    background-color: rgba(255, 100, 100, 0.9);
}

/* Pagination Controls */
.pagination-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding: 15px;
    background-color: rgba(0, 255, 255, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(0, 255, 255, 0.1);
}

.rows-per-page, .filter-controls {
    margin-bottom: 10px;
    flex: 1;
}

.rows-per-page label {
    color: #00ffff;
    font-size: 0.9em;
    white-space: nowrap;
}

.rows-per-page select {
    padding: 5px 8px;
    border-radius: 4px;
    border: 1px solid rgba(0, 255, 255, 0.3);
    background-color: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    font-size: 0.9em;
}

.rows-per-page select:focus {
    outline: none;
    border-color: #00ffff;
    box-shadow: 0 0 5px rgba(0, 255, 255, 0.3);
}

.filter-controls label {
    color: #00ffff;
    font-size: 0.9em;
    white-space: nowrap;
}

.filter-controls select {
    padding: 5px 8px;
    border-radius: 4px;
    border: 1px solid rgba(0, 255, 255, 0.3);
    background-color: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    font-size: 0.9em;
}

.filter-controls select:focus {
    outline: 2px solid #00ffff;
    outline-offset: 2px;
}

.export-controls {
    margin-bottom: 10px;
    flex: 1;
}

.export-button {
    background: linear-gradient(45deg, #00ffff, #0099cc);
    color: #000;
    border: none;
    padding: 8px 16px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 600;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.export-button:hover {
    background: linear-gradient(45deg, #33ffff, #00ccff);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 255, 255, 0.3);
}

.export-button:active {
    transform: translateY(0);
}

.page-navigation {
    display: flex;
    align-items: center;
    gap: 10px;
}

.page-btn {
    padding: 6px 12px;
    border-radius: 4px;
    border: 1px solid rgba(0, 255, 255, 0.3);
    background-color: rgba(0, 255, 255, 0.1);
    color: #ffffff;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.3s ease;
}

.page-btn:hover:not(:disabled) {
    background-color: rgba(0, 255, 255, 0.2);
    border-color: #00ffff;
}

.page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

#page-info {
    color: #00ffff;
    font-size: 0.9em;
    white-space: nowrap;
}

.total-records {
    color: #aaa;
    font-size: 0.85em;
}

/* ===== MOBILE RESPONSIVE DESIGN ===== */

/* Tablet Adjustments (768px and below) */
@media (max-width: 768px) {
    #billing-container {
        max-width: 100%;
        padding: 15px;
    }
    
    .billing-summary {
        margin-bottom: 20px;
        font-size: 1em;
    }
    
    .charts-wrapper {
        flex-direction: column;
        gap: 15px;
    }
    
    .chart-container,
    .legend-container {
        min-width: 100%;
        max-width: 100%;
        height: auto;
        min-height: 300px;
    }
    
    .legend-container {
        min-height: 200px;
    }
    
    .history-container {
        padding: 15px;
    }
    
    .pagination-controls {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }
    
        .rows-per-page, .filter-controls {
        justify-content: center;
    }

    .export-controls {
        justify-content: center;
    }

    .page-navigation {
        justify-content: center;
        order: -1; /* Move page navigation to top */
    }
    
    .total-records {
        text-align: center;
        order: 1; /* Move total records to bottom */
    }
    
    /* Switch to card layout on tablet */
    .table-container {
        display: none;
    }
    
    .mobile-transactions {
        display: block;
    }
}

/* Mobile Phone Adjustments (480px and below) */
@media (max-width: 480px) {
    #billing-container {
        width: 98%;
        padding: 15px;
    }
    
    .billing-summary {
        font-size: 0.95em;
    }
    
    .charts-wrapper {
        flex-direction: column;
        gap: 10px;
    }
    
    .chart-container,
    .legend-container {
        min-width: 100%;
        max-width: 100%;
        height: auto;
        min-height: 300px;
    }
    
    .legend-container {
        min-height: 200px;
    }
    
    .history-container {
        padding: 10px;
        margin-top: 20px;
    }
    
    .history-container h2 {
        font-size: 1.2em;
        margin-bottom: 15px;
    }
    
    .pagination-controls {
        padding: 10px;
        gap: 8px;
    }
    
    .rows-per-page label,
    .filter-controls label {
        font-size: 0.85em;
    }
    
        .rows-per-page select,
    .filter-controls select {
        font-size: 0.85em;
        padding: 4px 6px;
    }

    .export-button {
        font-size: 0.85em;
        padding: 6px 12px;
    }

    .page-btn {
        padding: 5px 10px;
        font-size: 0.85em;
    }
    
    #page-info {
        font-size: 0.85em;
    }
    
    .total-records {
        font-size: 0.8em;
    }
    
    /* Optimize mobile cards */
    .transaction-card {
        padding: 12px;
        margin-bottom: 10px;
    }
    
    .transaction-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .transaction-amount {
        font-size: 1em;
        text-align: left;
    }
    
    .transaction-date {
        font-size: 0.85em;
    }
    
    .transaction-type {
        font-size: 0.8em;
        margin-bottom: 6px;
    }
    
    .transaction-details-mobile {
        font-size: 0.8em;
    }
    
    .navigation-links .exit-button {
        padding: 8px 20px;
        font-size: 0.9em;
    }
}

/* Very Small Screens (360px and below) */
@media (max-width: 360px) {
    .transaction-card {
        padding: 10px;
    }
    
    .transaction-card-header {
        gap: 3px;
    }
    
    .transaction-amount {
        font-size: 0.95em;
    }
    
    .transaction-date {
        font-size: 0.8em;
    }
    
    .transaction-type {
        font-size: 0.75em;
    }
    
    .transaction-details-mobile {
        font-size: 0.75em;
    }
}

/* Legacy responsive adjustments for table (kept for desktop/large tablet users who prefer table view) */
@media (max-width: 1200px) and (min-width: 769px) {
    #transaction-history-table {
        min-width: 700px;
    }
    
    #transaction-history-table th:nth-child(4),
    #transaction-history-table td:nth-child(4) {
        min-width: 250px;
    }
}

/* Desktop layout - three columns */
@media (min-width: 1200px) {
    .chart-container {
        flex: 0 0 calc(33.333% - 14px);
        min-width: calc(33.333% - 14px);
        max-width: calc(33.333% - 14px);
    }
    
    .legend-container {
        flex: 0 0 calc(33.333% - 14px);
        min-width: calc(33.333% - 14px);
        max-width: calc(33.333% - 14px);
    }
}

/* Tablet layout - stack legend below charts */
@media (max-width: 1199px) and (min-width: 769px) {
    .charts-wrapper {
        flex-direction: column;
    }
    
    .chart-container {
        flex: 0 0 calc(50% - 10px);
        display: inline-block;
        vertical-align: top;
        margin-right: 20px;
    }
    
    .chart-container:last-of-type {
        margin-right: 0;
    }
    
    .legend-container {
        flex: 1;
        min-width: 100%;
        max-width: 100%;
        height: auto;
        min-height: 200px;
        margin-top: 20px;
    }
}

/* Mobile layout - everything stacked */
@media (max-width: 768px) {
    .charts-wrapper {
        flex-direction: column;
        gap: 15px;
    }
    
    .chart-container,
    .legend-container {
        min-width: 100%;
        max-width: 100%;
        height: auto;
        min-height: 300px;
    }
    
    .legend-container {
        min-height: 200px;
    }
}

/* Responsive adjustments for billing container */
@media (max-width: 1440px) {
    #billing-container {
        max-width: 1200px;
        width: 90%;
    }
}

@media (max-width: 1200px) {
    #billing-container {
        max-width: 1000px;
        width: 95%;
        padding: 25px 30px;
    }
}

@media (max-width: 900px) {
    #billing-container {
        max-width: 100%;
        width: 95%;
        padding: 20px 25px;
    }
}

@media (max-width: 600px) {
    #billing-container {
        width: 95%;
        padding: 15px 20px;
    }
}

@media (max-width: 480px) {
    #billing-container {
        width: 98%;
        padding: 15px;
    }
}

/* Select element styling */
* {
    box-sizing: border-box;
}

select option {
    background-color: #2a2a2a;
    color: #ffffff;
}

select option:hover,
select option:checked {
    background-color: rgba(0, 255, 255, 0.2);
}

/* Ensure select elements have consistent styling */
select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%2300FFFF%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E');
    background-repeat: no-repeat;
    background-position: right 8px top 50%;
    background-size: 10px auto;
    padding-right: 25px;
}

select:focus {
    outline: none;
    border-color: #00ffff;
    box-shadow: 0 0 5px rgba(0, 255, 255, 0.3);
}

/* Desktop layout - three columns */
@media (min-width: 1200px) {
    .chart-container {
        flex: 0 0 calc(33.333% - 14px);
        min-width: calc(33.333% - 14px);
        max-width: calc(33.333% - 14px);
    }
    
    .legend-container {
        flex: 0 0 calc(33.333% - 14px);
        min-width: calc(33.333% - 14px);
        max-width: calc(33.333% - 14px);
    }
}

/* Tablet layout - stack legend below charts */
@media (max-width: 1199px) and (min-width: 769px) {
    .charts-wrapper {
        flex-direction: column;
    }
    
    .chart-container {
        flex: 0 0 calc(50% - 10px);
        display: inline-block;
        vertical-align: top;
        margin-right: 20px;
    }
    
    .chart-container:last-of-type {
        margin-right: 0;
    }
    
    .legend-container {
        flex: 1;
        min-width: 100%;
        max-width: 100%;
        height: auto;
        min-height: 200px;
        margin-top: 20px;
    }
}

/* Mobile layout - everything stacked */
@media (max-width: 768px) {
    .charts-wrapper {
        flex-direction: column;
        gap: 15px;
    }
    
    .chart-container,
    .legend-container {
        min-width: 100%;
        max-width: 100%;
        height: auto;
        min-height: 300px;
    }
    
    .legend-container {
        min-height: 200px;
    }
} 