/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #6b7280;
    --success-color: #10b981;
    --error-color: #ef4444;
    --warning-color: #f59e0b;
    --background: #f9fafb;
    --card-background: #ffffff;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --border-color: #e5e7eb;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --header-height: 70px;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
}

.container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding-top: var(--header-height);
}

/* Header Styles */
.header {
    background-color: var(--card-background);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    height: var(--header-height);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.network-stats-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, #1d4ed8 100%);
    border-radius: 9999px;
    box-shadow: var(--shadow);
}

.network-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
}

.network-value {
    font-size: 0.875rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.025em;
}

.nav {
    display: flex;
    align-items: center;
    gap: 2rem;
}

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

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color);
    position: relative;
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    right: 0;
    height: 2px;
    background-color: var(--primary-color);
}

/* Main Content */
.main {
    flex: 1;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 2rem;
    padding-top: calc(var(--header-height) + 2rem);
}

/* Welcome Section */
.welcome-section {
    margin-bottom: 2rem;
    scroll-margin-top: calc(var(--header-height) + 1rem);
}

.welcome-section h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.user-email {
    color: var(--text-secondary);
    font-size: 1.125rem;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .header-content {
        padding: 1rem;
        flex-wrap: wrap;
        gap: 0.75rem;
    }

    .header-right {
        width: 100%;
        justify-content: space-between;
    }

    .network-stats-badge {
        padding: 0.375rem 0.75rem;
    }

    .network-label,
    .network-value {
        font-size: 0.75rem;
    }

    .nav {
        gap: 1rem;
        font-size: 0.875rem;
    }
}

.stat-card {
    background-color: var(--card-background);
    padding: 1rem;
    border-radius: 0.5rem;
    box-shadow: var(--shadow);
    text-align: center;
}

.stat-card h3 {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.25rem;
}

/* Style for pending amount in brackets */
.stat-value {
    line-height: 1.2;
}

.stat-value span {
    font-size: 0.875rem;
    font-weight: 400;
    color: var(--text-secondary);
    white-space: nowrap;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    word-wrap: break-word;
    word-break: break-all;
    line-height: 1.2;
}

.stat-details {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-top: 0.25rem;
    font-size: 0.7rem;
    color: var(--text-secondary);
}

.stat-detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stat-detail-item span {
    color: var(--text-primary);
    font-weight: 500;
}

/* Card Styles */
.card {
    background-color: var(--card-background);
    padding: 2rem;
    border-radius: 0.5rem;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
    scroll-margin-top: calc(var(--header-height) + 1rem);
}

.card h3 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
}

/* Section styling */
section[id] {
    scroll-margin-top: calc(var(--header-height) + 1rem);
}

/* Address Section */
.address-display {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    background-color: var(--background);
    border-radius: 0.375rem;
    border: 1px solid var(--border-color);
    gap: 1rem;
}

.address-display .btn {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.current-address {
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    color: var(--text-primary);
    word-break: break-all;
    margin: 0;
}

.address-form {
    margin-top: 1.5rem;
}

/* Form Styles */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    transition: border-color 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-hint {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

.form-actions {
    display: flex;
    gap: 1rem;
}

/* Button Styles */
.btn {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    border: none;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
}

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

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

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

.btn-secondary:hover {
    background-color: #4b5563;
}

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

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

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

/* Loading States */
.loading {
    color: var(--text-secondary);
    font-style: italic;
}

/* Tier Info */
.tier-info {
    margin: 1rem 0;
    padding: 0.75rem;
    background-color: rgba(132, 204, 22, 0.15);
    border-radius: 8px;
    border: 1px solid rgba(132, 204, 22, 0.3);
}

.tier-info .active-count {
    margin: 0 0 0.5rem 0;
    color: #65a30d;
    font-size: 0.9rem;
}

.tier-info .nearest-due {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0.5rem 0;
}

.subscription-ids {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.subscription-id-link {
    text-decoration: none;
    transition: opacity 0.2s;
    display: inline-block;
}

.subscription-id-link:hover {
    opacity: 0.8;
}

.subscription-id-link:hover .subscription-id {
    background-color: #e0e0e0;
}

.subscription-id {
    font-family: monospace;
    font-size: 0.8rem;
    color: #444;
    background-color: #f0f0f0;
    padding: 3px 8px;
    border-radius: 3px;
    transition: background-color 0.2s;
    display: inline-block;
}

.subscription-id-link.canceling .subscription-id {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.more-subscriptions-container {
    margin-top: 0.5rem;
    text-align: left;
}

.more-subscriptions-link {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    display: inline-block;
    transition: color 0.2s;
    cursor: pointer;
}

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


.more-payments-container {
    margin-top: 1rem;
    text-align: center;
}

.more-payments-link {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    display: inline-block;
    transition: color 0.2s;
    cursor: pointer;
}

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

/* Message Container */
.message-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 1000;
}

.message {
    padding: 1rem 1.5rem;
    border-radius: 0.375rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.3s ease-out;
}

.message-success {
    background-color: var(--success-color);
    color: white;
}

.message-error {
    background-color: var(--error-color);
    color: white;
}

.message-warning {
    background-color: var(--warning-color);
    color: white;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Footer */
.footer {
    background-color: var(--card-background);
    border-top: 1px solid var(--border-color);
    padding: 2rem;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.footer a {
    color: var(--primary-color);
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

/* Subscription Plans */
.subscription-plans {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.plan-card {
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.2s;
}

.plan-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-lg);
}

.plan-card.active {
    border-color: var(--success-color);
    background-color: rgba(16, 185, 129, 0.05);
}

.plan-name {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.plan-price {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.plan-features {
    list-style: none;
    margin-bottom: 1.5rem;
}

.plan-features li {
    padding: 0.5rem 0;
    color: var(--text-secondary);
}

/* Payment History Table */
.payment-history-table {
    width: 100%;
    overflow-x: auto;
}

.payment-history-table table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.payment-history-table th {
    text-align: left;
    padding: 0.75rem;
    border-bottom: 2px solid var(--border-color);
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.875rem;
    background-color: var(--background);
}

.payment-history-table td {
    padding: 1rem 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.payment-history-table tr:last-child td {
    border-bottom: none;
}

.payment-history-table .payment-status {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.payment-history-table .payment-status.paid {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
}

.payment-history-table .payment-status.open {
    background-color: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
}

.payment-history-table .doc-link {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: color 0.2s;
}

.payment-history-table .doc-link:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* Payout Controls */
.payout-controls {
    margin-top: 1rem;
}

.payout-controls h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    margin-top: 1.25rem;
    color: var(--text-primary);
}

.payout-controls h4:first-child {
    margin-top: 0;
}

.manual-payout-form {
    margin-bottom: 1.5rem;
}

.payout-input-group {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 0.5rem;
}

.payout-input-group .form-input {
    flex: 1;
    max-width: 200px;
}

.payout-input-group .btn {
    flex-shrink: 0;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.payout-info {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

.payout-info span {
    font-weight: 600;
    color: var(--primary-color);
}

/* Auto Payout Settings */
.auto-payout-settings {
    background-color: var(--background);
    padding: 0.75rem;
    border-radius: 0.375rem;
    border: 1px solid var(--border-color);
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
}

.toggle-label input[type="checkbox"] {
    width: 1.25rem;
    height: 1.25rem;
    cursor: pointer;
}

.threshold-setting {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.threshold-setting label {
    font-weight: 500;
    flex-shrink: 0;
}

.threshold-input-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.threshold-input-group .form-input {
    width: 80px;
    padding: 0.375rem 0.5rem;
    font-size: 0.875rem;
}

.threshold-input-group span {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.875rem;
}

.threshold-input-group .btn {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
}

/* Payout History */
.payout-history {
    background-color: var(--background);
    padding: 0.75rem;
    border-radius: 0.375rem;
    border: 1px solid var(--border-color);
    max-height: 250px;
    overflow-y: auto;
}

.payout-item {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.payout-item:last-child {
    border-bottom: none;
}

.payout-item-info {
    flex: 1;
}

.payout-amount {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.875rem;
}

.payout-date {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.125rem;
}

.payout-status {
    padding: 0.125rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 500;
}

.payout-status.pending {
    background-color: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
}

.payout-status.processing {
    background-color: rgba(37, 99, 235, 0.1);
    color: var(--primary-color);
}

.payout-status.completed {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
}

.payout-status.failed {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--error-color);
}

.no-payouts {
    text-align: center;
    color: var(--text-secondary);
    padding: 2rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
        padding: 0.75rem 1rem;
    }
    
    .nav {
        width: 100%;
        justify-content: center;
        gap: 1rem;
        flex-wrap: wrap;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .main {
        padding: 1rem;
    }
    
    .card {
        padding: 1.5rem;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
    
    .payment-history-table {
        font-size: 0.875rem;
    }
    
    .payment-history-table th,
    .payment-history-table td {
        padding: 0.5rem;
    }
}

/* Payout Table Styles */
.payout-table-container {
    overflow-x: auto;
    margin-bottom: 1rem;
}

.payout-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.payout-table th {
    text-align: left;
    padding: 0.75rem;
    border-bottom: 2px solid #e5e7eb;
    font-weight: 600;
    color: #6b7280;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background-color: #f9fafb;
}

.payout-table td {
    padding: 0.75rem;
    border-bottom: 1px solid #e5e7eb;
    vertical-align: middle;
}

.payout-table tr:last-child td {
    border-bottom: none;
}

.payout-table tbody tr:hover {
    background-color: #f9fafb;
}

.payout-date {
    color: #6b7280;
    font-size: 0.875rem;
    white-space: nowrap;
}

.payout-amount {
    font-weight: 600;
    color: #111827;
}

.payout-empty {
    text-align: center;
    padding: 3rem 1rem;
}

.no-payouts {
    color: #6b7280;
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
}

.no-payouts-hint {
    color: #9ca3af;
    font-size: 0.875rem;
}

/* Transaction and Address Links */
.tx-link, .address-link {
    text-decoration: none;
    color: inherit;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    transition: all 0.2s ease;
}

.tx-id, .address-code {
    font-family: 'Courier New', monospace;
    font-size: 0.75rem;
    background-color: #f3f4f6;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    transition: all 0.2s ease;
}

.tx-link:hover .tx-id,
.address-link:hover .address-code {
    background-color: #667eea;
    color: white;
}

.tx-link::after,
.address-link::after {
    content: '↗';
    font-size: 0.65rem;
    color: #9ca3af;
    transition: transform 0.2s ease;
}

.tx-link:hover::after,
.address-link:hover::after {
    transform: translate(2px, -2px);
    color: #667eea;
}

.tx-list {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.tx-failed {
    color: #ef4444;
    font-size: 0.75rem;
    font-style: italic;
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.status-pending {
    background-color: #fbbf24;
    color: #78350f;
}

.status-broadcasting {
    background-color: #60a5fa;
    color: #1e3a8a;
}

.status-confirming {
    background-color: #60a5fa;
    color: #1e3a8a;
}

.status-confirmed,
.status-completed {
    background-color: #34d399;
    color: #064e3b;
}

.status-failed,
.status-dropped {
    background-color: #f87171;
    color: #7f1d1d;
}

/* Pagination Styles */
.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e5e7eb;
}

.pagination-pages {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.pagination-btn {
    padding: 0.5rem 0.75rem;
    background-color: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.375rem;
    color: #374151;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pagination-btn:hover:not([disabled]) {
    background-color: #f9fafb;
    border-color: #667eea;
    color: #667eea;
}

.pagination-btn[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
    color: #9ca3af;
}

.pagination-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: transparent;
}

.pagination-number {
    min-width: 2.5rem;
    text-align: center;
}

.pagination-ellipsis {
    padding: 0 0.5rem;
    color: #9ca3af;
    user-select: none;
}

.pagination-info {
    font-size: 0.875rem;
    color: #6b7280;
}

/* Autopayout Status */
.autopayout-status {
    display: inline-block;
    margin-left: 1rem;
    padding: 0.25rem 0.75rem;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
}

.auto-payout-settings.autopayout-enabled {
    background-color: #f0fdf4;
    border: 1px solid #86efac;
    border-radius: 0.5rem;
    padding: 1rem;
    margin: 1rem 0;
}

.auto-payout-settings.autopayout-enabled .toggle-label {
    font-weight: 600;
    color: #059669;
}

.threshold-setting {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #d1fae5;
}

/* Refresh Indicator */
.refresh-indicator {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
    pointer-events: none;
    z-index: 1000;
}

.refresh-indicator.visible {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 768px) {
    .refresh-indicator {
        bottom: 10px;
        right: 10px;
        font-size: 12px;
        padding: 6px 12px;
    }
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-pending {
    background-color: #fbbf24;
    color: #78350f;
}

.status-broadcasting {
    background-color: #60a5fa;
    color: #1e3a8a;
}

.status-confirming {
    background-color: #60a5fa;
    color: #1e3a8a;
}

.status-confirmed,
.status-completed {
    background-color: #34d399;
    color: #064e3b;
}

.status-failed,
.status-dropped {
    background-color: #f87171;
    color: #7f1d1d;
}

.status-cancelled {
    background-color: #9ca3af;
    color: #1f2937;
}

/* Event indicator */
.event-indicator {
    color: var(--warning-color);
    font-size: 1.1rem;
    cursor: pointer;
    margin-right: 0.5rem;
    display: inline-block;
    animation: pulse 2s ease-in-out infinite;
    text-decoration: none;
    transition: transform 0.2s ease;
}

.event-indicator:hover {
    animation: none;
    transform: scale(1.3);
    color: var(--warning-color);
    text-decoration: none;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Links in payout table */
.error-link {
    color: var(--error-color);
    text-decoration: none;
    font-weight: 500;
    border-bottom: 1px dotted var(--error-color);
}

.error-link:hover {
    text-decoration: underline;
}

.cancelled-link {
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: 500;
    border-bottom: 1px dotted var(--secondary-color);
}

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

/* Row highlighting */
tr.has-events {
    background-color: rgba(245, 158, 11, 0.05);
}

tr.has-events:hover {
    background-color: rgba(245, 158, 11, 0.1);
}

/* Popup Overlay */
.popup-overlay {
    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: 2000;
    padding: 2rem;
}

.popup-content {
    background-color: var(--card-background);
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    border-radius: 0.5rem;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
}

.popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.popup-header h3 {
    margin: 0;
    font-size: 1.5rem;
}

.close-btn {
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.25rem;
    transition: background-color 0.2s;
}

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

.popup-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.payout-info,
.error-info,
.cancellation-info,
.history-section {
    margin-bottom: 2rem;
}

.payout-info h4,
.error-info h4,
.cancellation-info h4,
.history-section h4 {
    margin-bottom: 1rem;
    font-size: 1.125rem;
    color: var(--text-primary);
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.info-item label {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.info-item span {
    color: var(--text-primary);
}

.error-summary {
    background-color: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 0.375rem;
    padding: 1rem;
    margin-bottom: 1rem;
    color: var(--error-color);
    font-weight: 500;
}

.cancellation-info {
    background-color: rgba(107, 114, 128, 0.1);
    border: 1px solid rgba(107, 114, 128, 0.3);
    border-radius: 0.375rem;
    padding: 1rem;
    margin-bottom: 1rem;
}

.cancellation-summary {
    background-color: var(--background);
    padding: 1rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
}

.cancellation-summary p {
    margin: 0.5rem 0;
}

.cancellation-summary p strong {
    color: var(--text-primary);
}

.history-table {
    width: 100%;
    font-size: 0.875rem;
    border-collapse: collapse;
}

.history-table th {
    background-color: var(--background);
    font-weight: 600;
    color: var(--text-secondary);
    padding: 0.75rem;
    text-align: left;
    border-bottom: 2px solid var(--border-color);
}

.history-table td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.history-table tr.extraordinary-event {
    background-color: rgba(245, 158, 11, 0.05);
    font-weight: 500;
}

.history-table tr.extraordinary-event:hover {
    background-color: rgba(245, 158, 11, 0.1);
}

@media (max-width: 768px) {
    .popup-overlay {
        padding: 1rem;
    }
    
    .popup-content {
        max-height: 100vh;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
}