/* ============================================
   NEW FEATURES STYLES
   Recurring Expenses, Budget, Analytics
   ============================================ */

/* Quick Actions - Compact Design */
.quick-actions-compact {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.quick-action-btn-compact {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.9rem;
}

.quick-action-btn-compact:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(102, 126, 234, 0.5);
    color: white;
    transform: translateY(-1px);
}

.quick-icon {
    font-size: 1.1rem;
    line-height: 1;
}

.quick-label {
    font-weight: 500;
}

/* Badge Count */
.badge-count {
    background: #667eea;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: bold;
}

/* Recurring Expenses List */
.recurring-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.recurring-card {
    background: rgba(102, 126, 234, 0.1);
    border-left: 3px solid #667eea;
    padding: 1rem;
    border-radius: 8px;
    transition: background 0.2s ease;
}

.recurring-card:hover {
    background: rgba(102, 126, 234, 0.15);
}

.btn-icon-small {
    background: rgba(255,255,255,0.1);
    border: none;
    padding: 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.2s ease;
}

.btn-icon-small:hover {
    background: rgba(255,255,255,0.2);
}

/* Timeframe Selector */
.timeframe-selector {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-timeframe {
    padding: 0.5rem 1.25rem;
    border: 2px solid rgba(255,255,255,0.2);
    background: transparent;
    color: rgba(255,255,255,0.7);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn-timeframe:hover {
    border-color: rgba(255,255,255,0.4);
    color: rgba(255,255,255,0.9);
}

.btn-timeframe.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
    color: white;
}

/* Analytics Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    padding: 1.5rem;
    border-radius: 12px;
    text-align: center;
}

/* Chart Containers */
.chart-container {
    background: rgba(255,255,255,0.05);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.1);
}

.chart-container h3 {
    margin: 0 0 1rem 0;
    font-size: 1.1rem;
    color: rgba(255,255,255,0.9);
}

/* Budget Info Box */
.budget-info-box {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
}

.budget-info-box h3 {
    color: white;
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
}

.budget-info-box p {
    color: rgba(255,255,255,0.9);
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0;
}

/* Modal Large */
.modal-large {
    max-width: 900px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

/* Checkbox Labels */
.checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(255,255,255,0.05);
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.checkbox-label:hover {
    background: rgba(255,255,255,0.1);
}

.checkbox-label input[type="checkbox"] {
    cursor: pointer;
}

/* Export Section */
.export-section {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 1.5rem;
}

.export-section h3 {
    margin: 0 0 1rem 0;
    font-size: 1.1rem;
    color: rgba(255,255,255,0.9);
}

/* Analytics Container */
.analytics-container {
    padding: 1rem 0;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .modal-large {
        width: 95%;
        max-height: 85vh;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .quick-actions-grid {
        grid-template-columns: 1fr;
    }
    
    .analytics-container > div[style*="grid-template-columns: 1fr 1fr"] {
        grid-template-columns: 1fr !important;
    }
    
    .timeframe-selector {
        gap: 0.25rem;
    }
    
    .btn-timeframe {
        padding: 0.4rem 0.8rem;
        font-size: 0.85rem;
    }
    
    .quick-actions-compact {
        gap: 0.4rem;
    }
    
    .quick-action-btn-compact {
        padding: 0.5rem 0.8rem;
        font-size: 0.85rem;
    }
    
    .quick-icon {
        font-size: 1rem;
    }
}

/* Member Checkbox List */
.member-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: rgba(255,255,255,0.05);
    border-radius: 8px;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: background 0.2s ease;
}

.member-checkbox:hover {
    background: rgba(255,255,255,0.1);
}

.member-checkbox input[type="checkbox"] {
    cursor: pointer;
    width: 18px;
    height: 18px;
}

.member-checkbox span {
    flex: 1;
    color: rgba(255,255,255,0.9);
}

/* Field Hint */
.field-hint {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: rgba(255,255,255,0.6);
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
}

.status-active {
    background: rgba(46, 213, 115, 0.2);
    color: #2ed573;
    border: 1px solid rgba(46, 213, 115, 0.3);
}

.status-paused {
    background: rgba(255, 165, 0, 0.2);
    color: #ffa502;
    border: 1px solid rgba(255, 165, 0, 0.3);
}

/* Recurring Card for Manage View */
.recurring-card-manage {
    background: rgba(255,255,255,0.05);
    border-radius: 12px;
    padding: 1.25rem;
    transition: all 0.3s ease;
    border: 1px solid rgba(255,255,255,0.1);
}

.recurring-card-manage:hover {
    background: rgba(255,255,255,0.08);
    border-color: rgba(102, 126, 234, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

/* Modal Medium Size */
.modal-medium {
    max-width: 600px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

/* Recurring Expense Modal Specific Styles */
#recurringExpenseModal .modal-content {
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

#recurringExpenseModal .modal-header {
    flex-shrink: 0;
}

#recurringExpenseModal .expense-form-clean {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex: 1;
    min-height: 0;
}

#recurringExpenseModal .form-header-clean {
    flex-shrink: 0;
    padding: 1.5rem 1.5rem 0;
}

#recurringExpenseModal .form-grid {
    overflow-y: auto;
    padding: 1rem 1.5rem 1.5rem;
    flex: 1;
}

#recurringExpenseModal .modal-footer {
    flex-shrink: 0;
    position: sticky;
    bottom: 0;
    background: #111827;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1rem 1.5rem;
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

/* Budget Modal - Similar Fix */
#budgetModal .modal-content {
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

#budgetModal form {
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

#budgetModal .modal-footer {
    flex-shrink: 0;
}

/* Analytics Modal - Already large, ensure it works */
#analyticsModal .modal-content {
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

/* Button Small */
.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

/* Icon Button Small */
.btn-icon-small {
    background: rgba(255,255,255,0.1);
    border: none;
    padding: 0.5rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1.1rem;
}

.btn-icon-small:hover {
    background: rgba(255,255,255,0.2);
    transform: scale(1.1);
}

/* Collapsible Sections */
.collapsible-header:hover {
    background: rgba(255,255,255,0.08) !important;
}

.collapsible-content {
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Receipt Scan Button */
.btn-scan-receipt {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-scan-receipt:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-scan-receipt:active {
    transform: translateY(0);
}

/* Spinner Small */
.spinner-small {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(102, 126, 234, 0.2);
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}
/* ============================================
   LIGHT MODE IMPROVEMENTS
   ============================================ */

[data-theme="light"] .quick-action-btn-compact {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    color: #475569;
}

[data-theme="light"] .quick-action-btn-compact:hover {
    background: #eff6ff;
    border-color: #667eea;
    color: #667eea;
}

[data-theme="light"] .quick-label {
    color: #475569;
}

[data-theme="light"] .quick-action-btn-compact:hover .quick-label {
    color: #667eea;
}

[data-theme="light"] .collapsible-header {
    background: #f8fafc !important;
    border: 2px solid #e2e8f0;
}

[data-theme="light"] .collapsible-header:hover {
    background: #eff6ff !important;
    border-color: #cbd5e1;
}

[data-theme="light"] .collapsible-header strong {
    color: #0f172a;
}

[data-theme="light"] .collapsible-header span {
    color: #475569;
}

[data-theme="light"] .recurring-card {
    background: #eff6ff;
    border-left-color: #667eea;
}

[data-theme="light"] .recurring-card:hover {
    background: #dbeafe;
}

[data-theme="light"] .recurring-card strong {
    color: #0f172a;
}

[data-theme="light"] .recurring-card span,
[data-theme="light"] .recurring-card p {
    color: #475569;
}

[data-theme="light"] .btn-icon-small {
    background: #f1f5f9;
    color: #64748b;
}

[data-theme="light"] .btn-icon-small:hover {
    background: #e2e8f0;
    color: #475569;
}

[data-theme="light"] .chart-container {
    background: white;
    border: 2px solid #e2e8f0;
}

[data-theme="light"] .chart-container h3 {
    color: #0f172a;
}

[data-theme="light"] .stat-card {
    background: white;
    border: 2px solid #e2e8f0;
}

[data-theme="light"] .stat-card h4 {
    color: #0f172a;
}

[data-theme="light"] .stat-card p {
    color: #64748b;
}

[data-theme="light"] .btn-timeframe {
    border-color: #cbd5e1;
    color: #475569;
}

[data-theme="light"] .btn-timeframe:hover {
    border-color: #667eea;
    color: #667eea;
}

[data-theme="light"] .btn-timeframe.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
    color: white;
}

[data-theme="light"] .checkbox-label {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

[data-theme="light"] .checkbox-label:hover {
    background: #f1f5f9;
}

[data-theme="light"] .checkbox-label span {
    color: #475569;
}

[data-theme="light"] .export-section {
    border-top-color: #e2e8f0;
}

[data-theme="light"] .export-section h3 {
    color: #0f172a;
}

[data-theme="light"] .btn-scan-receipt {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
}

[data-theme="light"] .recurring-card-manage {
    background: white;
    border: 2px solid #e2e8f0;
}

[data-theme="light"] .recurring-card-manage:hover {
    border-color: #667eea;
}

[data-theme="light"] .recurring-card-manage strong {
    color: #0f172a;
}

[data-theme="light"] .recurring-card-manage span,
[data-theme="light"] .recurring-card-manage p {
    color: #64748b;
}