:root {
    /* Light mode colors */
    --bg-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --bg-card: white;
    --bg-secondary: #f8f9fa;
    --text-primary: #333;
    --text-secondary: #666;
    --text-inverse: white;
    --border-color: #e0e0e0;
    --shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 5px 20px rgba(0, 0, 0, 0.15);
}

[data-theme="dark"] {
    /* Dark mode colors */
    --bg-primary: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    --bg-card: #1e1e2e;
    --bg-secondary: #252535;
    --text-primary: #e0e0e0;
    --text-secondary: #b0b0b0;
    --text-inverse: #1e1e2e;
    --border-color: #3a3a4a;
    --shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    --shadow-hover: 0 5px 20px rgba(0, 0, 0, 0.7);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--bg-primary);
    min-height: 100vh;
    padding: 20px;
    color: var(--text-primary);
    transition: background 0.3s ease, color 0.3s ease;
}

.container {
    max-width: 800px;
    margin: 0 auto;
}

header {
    margin-bottom: 30px;
}

.header-content {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 20px;
    color: white;
}

.header-left {
    display: flex;
    justify-content: flex-start;
    align-items: center;
}

.header-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    margin: 0;
}

.header-right {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    flex-wrap: nowrap;
}

.header-controls {
    margin-top: 12px;
    display: flex;
    gap: 12px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.header-group {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-secondary);
    padding: 8px 12px;
    border-radius: 10px;
}

.group-label {
    font-size: 0.85rem;
    color: var(--text-primary);
    font-weight: 600;
}

.header-controls .search-mode-btn,
.header-controls .mode-btn {
    max-width: initial;
    /* Make all header buttons equal size */
    flex: 0 0 180px; /* equal width */
    min-height: 48px; /* equal height */
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    line-height: 1.1;
    white-space: normal; /* allow wrapping without changing height */
}


.about-link {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.25);
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.about-link:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
}

.dark-mode-toggle {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    flex-shrink: 0;
}

.dark-mode-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

[data-theme="dark"] .dark-mode-toggle {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin: 0;
}

.logo-image {
    height: 60px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.2));
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.95;
}

.calculator-card,
.results-card,
.comparison-card,
.cumulative-card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 30px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    color: var(--text-primary);
    transition: background 0.3s ease, color 0.3s ease;
}

/* Mode Toggle */
.mode-toggle-container {
    margin-bottom: 30px;
    padding: 20px;
    background: var(--bg-secondary);
    border-radius: 12px;
    text-align: center;
    transition: background 0.3s ease;
}

.mode-label {
    display: block;
    font-weight: 600;
    margin-bottom: 12px;
    color: #333;
    font-size: 0.95rem;
}

.mode-toggle {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 8px;
}

.mode-btn {
    flex: 1;
    max-width: 180px;
    padding: 12px 20px;
    border: 2px solid #667eea;
    border-radius: 8px;
    background: white;
    color: #667eea;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.mode-btn:hover {
    background: #f0f0ff;
    transform: translateY(-2px);
}

.mode-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.mode-btn.active:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

.mode-description {
    display: block;
    color: #666;
    font-size: 0.85rem;
    margin-top: 8px;
}

/* Advanced Options */
.advanced-option {
    display: block;
    transition: opacity 0.3s ease, max-height 0.3s ease;
}

.advanced-option.hidden {
    display: none;
}

/* Simple Mode Options */
.simple-option {
    display: block;
}

.simple-option.hidden {
    display: none;
}

/* Simple options are hidden by default, shown when in simple mode */

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper .currency {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-weight: 600;
    color: #666;
    z-index: 1;
    pointer-events: none;
}

.input-wrapper input {
    padding-left: 48px !important; /* extra room for the $ sign - increased to prevent overlap */
    padding-right: 15px !important;
}

input[type="number"],
input[type="text"],
select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: var(--bg-card);
    color: var(--text-primary);
}

input[type="number"]:focus,
select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

small {
    display: block;
    margin-top: 5px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.4;
}

.calculate-btn,
.reset-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    margin-top: 10px;
}

.calculate-btn:hover,
.reset-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.calculate-btn:active,
.reset-btn:active {
    transform: translateY(0);
}

.reset-btn {
    background: #6c757d;
    margin-top: 20px;
}

.reset-btn:hover {
    box-shadow: 0 5px 20px rgba(108, 117, 125, 0.4);
}

#results {
    animation: slideIn 0.5s ease;
}

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

.results-card h2 {
    color: #333;
    margin-bottom: 25px;
    font-size: 1.8rem;
}

.result-item {
    padding: 20px;
    background: var(--bg-secondary);
    border-radius: 12px;
    margin-bottom: 15px;
    text-align: center;
    transition: background 0.3s ease;
}

.result-item.highlight {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    margin-bottom: 25px;
}

.result-item.highlight .result-label {
    font-size: 1rem;
    opacity: 0.9;
    margin-bottom: 10px;
}

.result-item.highlight .result-value {
    font-size: 2.5rem;
    font-weight: 700;
}

.result-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.highlight .result-label {
    color: rgba(255, 255, 255, 0.9);
}

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

.highlight .result-value {
    color: white;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 25px;
}

.breakdown-section,
.insights-section,
.comparisons-section,
.visual-breakdown {
    background: var(--bg-secondary);
    padding: 20px;
    border-radius: 12px;
    margin-top: 20px;
    transition: background 0.3s ease;
}

.breakdown-section h3,
.insights-section h3,
.comparisons-section h3,
.visual-breakdown h3 {
    margin-bottom: 15px;
    color: var(--text-primary);
    font-size: 1.2rem;
}

.breakdown-section p {
    color: var(--text-secondary);
    line-height: 1.6;
    font-size: 0.95rem;
}

footer {
    text-align: center;
    color: white;
    padding: 20px;
    font-size: 0.85rem;
    opacity: 0.9;
}

footer p {
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.5;
}

.footer-link {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.footer-link a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 0.8rem;
    transition: color 0.3s ease;
}

.footer-link a:hover {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: underline;
}

/* Example Scenarios */
.example-scenarios {
    margin: 25px 0;
    padding: 20px;
    background: var(--bg-secondary);
    border-radius: 12px;
    transition: background 0.3s ease;
}

.example-scenarios label {
    display: block;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.example-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.example-btn {
    flex: 1;
    min-width: 120px;
    padding: 10px 15px;
    background: white;
    border: 2px solid #667eea;
    border-radius: 8px;
    color: #667eea;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.example-btn:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.example-btn:active {
    transform: translateY(0);
}

/* Comparisons Section */
.comparisons-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    margin-top: 20px;
}

.comparisons-section h3 {
    margin-bottom: 15px;
    color: #333;
    font-size: 1.2rem;
}

#comparisons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.comparison-item {
    background: white;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    border: 2px solid #e0e0e0;
    transition: all 0.2s ease;
}

.comparison-item:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.comparison-icon {
    font-size: 2rem;
    margin-bottom: 8px;
}

.comparison-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 5px;
}

.comparison-label {
    font-size: 0.85rem;
    color: #666;
}

/* Visual Breakdown */
.visual-breakdown {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    margin-top: 20px;
}

.visual-breakdown h3 {
    margin-bottom: 15px;
    color: #333;
    font-size: 1.2rem;
}

.visual-bar-container {
    margin-top: 15px;
}

.visual-bar {
    width: 100%;
    height: 40px;
    background: #e0e0e0;
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.visual-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    transition: width 1s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
}

.visual-bar-label {
    margin-top: 10px;
    text-align: center;
    color: #666;
    font-size: 0.9rem;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.share-btn,
.print-btn {
    flex: 1;
    min-width: 140px;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.share-btn {
    background: #28a745;
    color: white;
}

.share-btn:hover {
    background: #218838;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(40, 167, 69, 0.4);
}

.print-btn {
    background: #17a2b8;
    color: white;
}

.print-btn:hover {
    background: #138496;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(23, 162, 184, 0.4);
}

.action-buttons .reset-btn,
.action-buttons .compare-btn,
.action-buttons .cumulative-btn {
    flex: 1;
    min-width: 140px;
    margin-top: 0;
}

.compare-btn {
    background: #ff9800;
    color: white;
}

.compare-btn:hover {
    background: #f57c00;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 152, 0, 0.4);
}

.cumulative-btn {
    background: #9c27b0;
    color: white;
}

.cumulative-btn:hover {
    background: #7b1fa2;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(156, 39, 176, 0.4);
}

/* Insights Section */
.insights-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-top: 15px;
}

.insight-item {
    background: var(--bg-card);
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    border: 2px solid var(--border-color);
    transition: all 0.2s ease;
}

.insight-item:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.insight-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.insight-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.insight-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: #667eea;
}

/* Comparison Tool */
.comparison-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 20px 0;
}

.comparison-side {
    padding: 20px;
    background: var(--bg-secondary);
    border-radius: 12px;
    transition: background 0.3s ease;
}

.comparison-side h3 {
    margin-bottom: 15px;
    color: var(--text-primary);
    text-align: center;
}

.comparison-form {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.comparison-form input {
    flex: 1;
    padding: 10px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-card);
    color: var(--text-primary);
}

.calculate-comparison-btn,
.use-current-btn {
    padding: 10px 15px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
}

.calculate-comparison-btn:hover,
.use-current-btn:hover {
    background: #5568d3;
    transform: translateY(-2px);
}

.comparison-results {
    min-height: 150px;
    padding: 15px;
    background: var(--bg-card);
    border-radius: 8px;
    border: 2px solid var(--border-color);
}

.comparison-placeholder {
    color: var(--text-secondary);
    text-align: center;
    font-style: italic;
    padding: 20px;
}

.comparison-summary {
    margin-top: 20px;
    padding: 20px;
    background: var(--bg-secondary);
    border-radius: 12px;
    text-align: center;
}

.close-comparison-btn,
.close-cumulative-btn {
    width: 100%;
    padding: 12px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 8px;
    margin-top: 15px;
    cursor: pointer;
    font-weight: 600;
}

/* Cumulative Tool */
.cumulative-description {
    color: var(--text-secondary);
    margin-bottom: 20px;
    text-align: center;
}

.cumulative-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.cumulative-controls input {
    flex: 1;
}

.add-bill-btn,
.clear-cumulative-btn {
    padding: 12px 20px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
}

.clear-cumulative-btn {
    background: #dc3545;
    width: 100%;
    margin-bottom: 10px;
}

.add-bill-btn:hover {
    background: #5568d3;
    transform: translateY(-2px);
}

.clear-cumulative-btn:hover {
    background: #c82333;
}

.cumulative-bills-list {
    margin: 20px 0;
}

.bill-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    margin-bottom: 10px;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 8px;
}

.bill-list-item-name {
    font-weight: 600;
    color: var(--text-primary);
}

.bill-list-item-cost {
    color: #667eea;
    font-weight: 700;
}

.bill-list-item-remove {
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 5px 10px;
    cursor: pointer;
    font-size: 0.85rem;
}

.empty-state {
    text-align: center;
    color: var(--text-secondary);
    font-style: italic;
    padding: 40px 20px;
}

.cumulative-total {
    margin-top: 30px;
    padding: 25px;
    background: var(--bg-secondary);
    border-radius: 12px;
}

.cumulative-results-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-top: 20px;
}

/* Print Styles */
@media print {
    body {
        background: white;
        padding: 0;
    }
    
    header {
        color: #333;
    }
    
    .calculate-btn,
    .action-buttons,
    .example-scenarios {
        display: none;
    }
    
    .calculator-card {
        display: none;
    }
    
    .results-card {
        box-shadow: none;
        page-break-inside: avoid;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
        flex-direction: column;
        gap: 10px;
    }
    
    .logo-image {
        height: 50px;
    }

    .calculator-card,
    .results-card {
        padding: 20px;
    }

    .results-grid {
        grid-template-columns: 1fr;
    }

    .result-item.highlight .result-value {
        font-size: 2rem;
    }
    
    .example-buttons {
        flex-direction: column;
    }
    
    .example-btn {
        width: 100%;
    }
    
    #comparisons-grid {
        grid-template-columns: 1fr;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .share-btn,
    .print-btn,
    .action-buttons .reset-btn {
        width: 100%;
    }
    
    .mode-toggle {
        flex-direction: column;
    }
    
    .mode-btn {
        max-width: 100%;
    }
    
    /* Prevent header buttons from spilling outside on mobile */
    .header-controls {
        padding: 0 4px;
    }
    .header-group {
        flex-wrap: wrap;
        justify-content: center;
    }
    .header-controls .search-mode-btn,
    .header-controls .mode-btn {
        flex: 1 1 48%;
        min-height: 44px;
        max-width: 100%;
    }
    
    .header-content {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .header-left {
        display: none;
    }
    
    .header-center {
        order: 1;
    }
    
    .header-right {
        justify-content: center;
        order: 2;
    }
    
    .insights-grid,
    .comparison-container,
    .cumulative-results-grid {
        grid-template-columns: 1fr;
    }
    
    .compare-btn,
    .cumulative-btn {
        width: 100%;
    }
}

/* Persistent Bill Tracker Panel */
.bill-tracker-panel {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 320px;
    max-height: 500px;
    background: var(--bg-card);
    border-radius: 16px;
    box-shadow: var(--shadow);
    border: 2px solid var(--border-color);
    z-index: 1000;
    transition: all 0.3s ease;
    overflow: hidden;
}

.bill-tracker-panel.collapsed {
    height: auto;
}

.bill-tracker-panel.collapsed .bill-tracker-content {
    display: none;
}

.bill-tracker-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: var(--bg-secondary);
    border-bottom: 2px solid var(--border-color);
    cursor: pointer;
}

.bill-tracker-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.bill-tracker-toggle {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: var(--text-primary);
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bill-tracker-content {
    padding: 15px 20px;
    max-height: 420px;
    overflow-y: auto;
}

.tracker-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-color);
}

.tracker-stat {
    text-align: center;
}

.tracker-stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
}

.tracker-stat-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: #667eea;
}

.tracker-bills-list {
    max-height: 300px;
    overflow-y: auto;
}

.tracker-bill-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    margin-bottom: 8px;
    background: var(--bg-secondary);
    border-radius: 8px;
    font-size: 0.9rem;
}

.tracker-bill-name {
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tracker-bill-cost {
    color: #667eea;
    font-weight: 700;
    margin-left: 10px;
    font-size: 0.85rem;
}

.tracker-empty {
    text-align: center;
    color: var(--text-secondary);
    font-style: italic;
    padding: 20px;
    font-size: 0.9rem;
}

/* Bill Search Interface */
.bill-search-card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 30px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    color: var(--text-primary);
}

.search-toggle-container {
    margin-bottom: 25px;
    padding: 20px;
    background: var(--bg-secondary);
    border-radius: 12px;
    text-align: center;
}

.search-toggle-label {
    display: block;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.search-toggle-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.search-mode-btn {
    flex: 1;
    max-width: 200px;
    padding: 12px 20px;
    border: 2px solid #667eea;
    border-radius: 8px;
    background: white;
    color: #667eea;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-mode-btn:hover {
    background: #f0f0ff;
    transform: translateY(-2px);
}

.search-mode-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.bill-search-interface h3 {
    margin-bottom: 20px;
    color: var(--text-primary);
}

.search-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.search-select {
    flex: 0 0 200px;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-card);
    color: var(--text-primary);
}

.search-input {
    flex: 1;
    min-width: 200px;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 1rem;
}

.search-btn {
    padding: 12px 24px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.search-btn:hover {
    background: #5568d3;
    transform: translateY(-2px);
}

.bill-search-results {
    margin-top: 20px;
    padding: 20px;
    background: var(--bg-secondary);
    border-radius: 12px;
}

.bill-search-results h4 {
    margin-bottom: 15px;
    color: var(--text-primary);
}

.bill-result-item {
    padding: 15px;
    margin-bottom: 10px;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.bill-result-item:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.bill-result-title {
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    font-size: 1.1rem;
}

.bill-result-meta {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.bill-result-description {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-top: 10px;
}

.bill-result-cost {
    color: #667eea;
    font-weight: 700;
    margin-top: 10px;
    font-size: 1rem;
}

.loading-state {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
}

.spinner {
    border: 3px solid var(--bg-secondary);
    border-top: 3px solid #667eea;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@media (max-width: 768px) {
    .bill-tracker-panel {
        width: calc(100% - 40px);
        right: 20px;
        left: 20px;
        bottom: 20px;
    }
    
    .tracker-summary {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .search-controls {
        flex-direction: column;
    }
    
    .search-select,
    .search-input,
    .search-btn {
        width: 100%;
    }
}

