/* HTMX Indicators */
.htmx-indicator {
    display: none;
}

.htmx-request .htmx-indicator {
    display: inline-block;
}

.htmx-request.htmx-indicator {
    display: inline-block;
}

/* Primary Green Gradient */
.gradient-text {
    background: linear-gradient(135deg,
            #09af79 0%,
            #04b97f 50%,
            #37efba 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Color Classes */
.bg-dark {
    background-color: #33333d;
}

.bg-surface {
    background-color: #26282f;
    transition: background-color 0.3s, border-color 0.3s;
}

.light-mode .bg-surface {
    background-color: #ffffff;
}

.bg-primary-green {
    background-color: #09af79;
}

.text-primary-green {
    color: #09af79;
}

.border-subtle {
    border-color: rgba(255, 255, 255, 0.12);
}

.light-mode .border-subtle {
    border-color: #e0e0e0;
}

/* Theme toggle switch */
.theme-toggle {
    position: relative;
    width: 48px;
    height: 24px;
    border-radius: 12px;
    background-color: rgba(255, 255, 255, 0.12);
    cursor: pointer;
    transition: background-color 0.3s;
}

.theme-toggle::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: #09af79;
    transition: transform 0.3s;
}

.light-mode .theme-toggle {
    background-color: #d1d5db;
}

.light-mode .theme-toggle::after {
    transform: translateX(24px);
    background-color: #ffac12;
}

/* Dark mode (default) */
body {
    background-color: #33333d;
    color: #ffffff;
    transition: background-color 0.3s, color 0.3s;
}

/* Light mode overrides */
body.light-mode {
    background-color: #fafafa;
    color: #1f1f1f;
}

.light-mode .card-bg {
    background-color: #ffffff;
    border-color: #e0e0e0;
    transition: background-color 0.3s, border-color 0.3s;
}

.dark-mode .card-bg {
    background-color: #26282f;
    border-color: rgba(255, 255, 255, 0.12);
    transition: background-color 0.3s, border-color 0.3s;
}

.light-mode .text-primary {
    color: #1f1f1f;
}

.dark-mode .text-primary {
    color: #ffffff;
}

.light-mode .text-secondary {
    color: #5f6368;
}

.dark-mode .text-secondary {
    color: rgba(255, 255, 255, 0.6);
}

.light-mode .text-muted {
    color: #5f6368;
}

.dark-mode .text-muted {
    color: rgba(255, 255, 255, 0.6);
}

.light-mode .input-bg {
    background-color: #ffffff;
    border-color: #e0e0e0;
    color: #1f1f1f;
}

.dark-mode .input-bg {
    background-color: #26282f;
    border-color: rgba(255, 255, 255, 0.12);
    color: #ffffff;
}

/* Info cards with Rally accent colors */
.light-mode .info-card-1 {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    border-color: #a5d6a7;
}

.light-mode .info-card-2 {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border-color: #90caf9;
}

.light-mode .info-card-3 {
    background: linear-gradient(135deg, #f3e5f5 0%, #e1bee7 100%);
    border-color: #ce93d8;
}

.dark-mode .info-card-1 {
    background: linear-gradient(135deg,
            rgba(9, 175, 121, 0.15) 0%,
            rgba(4, 185, 127, 0.1) 100%);
    border-color: rgba(9, 175, 121, 0.3);
}

.dark-mode .info-card-2 {
    background: linear-gradient(135deg,
            rgba(0, 130, 251, 0.15) 0%,
            rgba(114, 222, 255, 0.1) 100%);
    border-color: rgba(0, 130, 251, 0.3);
}

.dark-mode .info-card-3 {
    background: linear-gradient(135deg,
            rgba(177, 93, 255, 0.15) 0%,
            rgba(177, 93, 255, 0.1) 100%);
    border-color: rgba(177, 93, 255, 0.3);
}

/* Info card text colors - theme aware */
.info-text-green {
    color: #37efba;
}

.light-mode .info-text-green {
    color: #007d51;
}

.info-icon-green {
    color: #09af79;
}

.light-mode .info-icon-green {
    color: #007d51;
}

.info-text-blue {
    color: #72deff;
}

.light-mode .info-text-blue {
    color: #0056b3;
}

.info-icon-blue {
    color: #0082fb;
}

.light-mode .info-icon-blue {
    color: #0056b3;
}

.info-text-purple {
    color: #b15dff;
}

.light-mode .info-text-purple {
    color: #7b2cbf;
}

.info-icon-purple {
    color: #b15dff;
}

.light-mode .info-icon-purple {
    color: #7b2cbf;
}

.light-mode .feature-icon-1 {
    background-color: #c8e6c9;
}

.light-mode .feature-icon-2 {
    background-color: #e1bee7;
}

.light-mode .feature-icon-3 {
    background-color: #bbdefb;
}

.light-mode .feature-icon-4 {
    background-color: #ffe0b2;
}

.dark-mode .feature-icon-1,
.dark-mode .feature-icon-2,
.dark-mode .feature-icon-3,
.dark-mode .feature-icon-4 {
    background-color: rgba(255, 255, 255, 0.08);
}

/* Header theme styles */
.light-mode .header-bg {
    background-color: #ffffff;
    border-bottom: 1px solid #e0e0e0;
}

.dark-mode .header-bg {
    background-color: #26282f;
}

.light-mode .header-title {
    color: #1f1f1f;
}

.dark-mode .header-title {
    color: #ffffff;
}

.light-mode .header-subtitle {
    color: #5f6368;
    border-color: #e0e0e0;
}

.dark-mode .header-subtitle {
    color: rgba(255, 255, 255, 0.6);
    border-color: rgba(255, 255, 255, 0.12);
}

/* Footer theme styles */
.light-mode .footer-bg {
    background-color: #f5f5f5;
    border-top: 1px solid #e0e0e0;
}

.dark-mode .footer-bg {
    background-color: #26282f;
}

.light-mode .footer-title {
    color: #1f1f1f;
}

.dark-mode .footer-title {
    color: #ffffff;
}

.light-mode .footer-text {
    color: #5f6368;
}

.dark-mode .footer-text {
    color: rgba(255, 255, 255, 0.6);
}

.light-mode .footer-muted {
    color: #9aa0a6;
}

.dark-mode .footer-muted {
    color: rgba(255, 255, 255, 0.38);
}

.light-mode .footer-border {
    border-color: #e0e0e0;
}

.dark-mode .footer-border {
    border-color: rgba(255, 255, 255, 0.12);
}

/* Results section dynamic theming */
.light-mode .results-card {
    background-color: #ffffff;
    border-color: #e0e0e0;
}

.dark-mode .results-card {
    background-color: #26282f;
    border-color: rgba(255, 255, 255, 0.12);
}

.light-mode .results-text {
    color: #1f1f1f;
}

.dark-mode .results-text {
    color: #ffffff;
}

.light-mode .results-text-secondary {
    color: #5f6368;
}

.dark-mode .results-text-secondary {
    color: rgba(255, 255, 255, 0.6);
}

.light-mode .results-text-muted {
    color: #5f6368;
}

.dark-mode .results-text-muted {
    color: rgba(255, 255, 255, 0.6);
}

.light-mode .results-border {
    border-color: #e0e0e0;
}

.dark-mode .results-border {
    border-color: rgba(255, 255, 255, 0.12);
}

.light-mode .results-table-header {
    background-color: #f5f5f5;
}

.dark-mode .results-table-header {
    background-color: #33333d;
}

.light-mode .results-table-row:hover {
    background-color: #f5f5f5;
}

.dark-mode .results-table-row:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

/* Sort button theme - Rally colors */
.light-mode .sort-btn-active {
    background-color: #e8f5e9;
    color: #007d51;
}

.dark-mode .sort-btn-active {
    background-color: rgba(9, 175, 121, 0.2);
    color: #37efba;
}

.light-mode .sort-btn-inactive {
    background-color: #f5f5f5;
    color: #5f6368;
}

.dark-mode .sort-btn-inactive {
    background-color: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.6);
}

/* Metric icon backgrounds - Rally accent colors */
.light-mode .metric-icon-blue {
    background-color: #bbdefb;
}

.dark-mode .metric-icon-blue {
    background-color: rgba(0, 130, 251, 0.2);
}

.light-mode .metric-icon-green {
    background-color: #c8e6c9;
}

.dark-mode .metric-icon-green {
    background-color: rgba(9, 175, 121, 0.2);
}

.light-mode .metric-icon-purple {
    background-color: #e1bee7;
}

.dark-mode .metric-icon-purple {
    background-color: rgba(177, 93, 255, 0.2);
}

.light-mode .metric-icon-red {
    background-color: #ffcdd2;
}

.dark-mode .metric-icon-red {
    background-color: rgba(255, 105, 81, 0.2);
}

/* Mobile card backgrounds */
.light-mode .mobile-card-positive {
    background-color: #e8f5e9;
}

.dark-mode .mobile-card-positive {
    background-color: rgba(9, 175, 121, 0.1);
}

.light-mode .mobile-card-negative {
    background-color: #ffebee;
}

.dark-mode .mobile-card-negative {
    background-color: rgba(255, 105, 81, 0.1);
}

.light-mode .mobile-card-children {
    background-color: #f5f5f5;
}

.dark-mode .mobile-card-children {
    background-color: #33333d;
}

/* Button Style */
.btn-primary {
    background-color: #09af79;
    color: #ffffff;
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn-primary:hover {
    background-color: #04b97f;
}

.btn-primary:active {
    background-color: #007d51;
}

/* Positive/negative colors */
.text-positive {
    color: #09af79;
}

.text-negative {
    color: #ff6951;
}

.light-mode .text-positive {
    color: #007d51;
}

.light-mode .text-negative {
    color: #d32f2f;
}

/* Returns percentage - theme aware */
.returns-pct-positive {
    color: #37efba;
}

.light-mode .returns-pct-positive {
    color: #007d51;
}

.returns-pct-negative {
    color: #ff6951;
}

.light-mode .returns-pct-negative {
    color: #d32f2f;
}

/* Allocation badge - theme aware */
.badge-allocation {
    background-color: rgba(0, 130, 251, 0.2);
    color: #72deff;
}

.light-mode .badge-allocation {
    background-color: #e3f2fd;
    color: #1565c0;
}