/**
 * myFinanceAPP - Modern Mobile-First Theme
 * Style: Warm, Clean, Accessible
 */

:root {
    /* Warm Color Palette */
    --primary: #FF8800;
    /* Warm Orange */
    --primary-light: #FFAB40;
    --primary-dark: #F57C00;

    --secondary: #FFD600;
    /* Warm Yellow */
    --accent: #2c9aff;
    /* Friendly Blue for balance/neutral */

    --success: #66BB6A;
    /* Soft Green */
    --danger: #EF5350;
    /* Soft Red */
    --warning: #FFCA28;

    /* Backgrounds - Clean & Warm */
    --bg-app: #FAFAFA;
    /* Almost white */
    --bg-card: #FFFFFF;
    --bg-header: #FFFFFF;

    /* Text */
    --text-primary: #212121;
    --text-secondary: #757575;
    --text-muted: #BDBDBD;

    /* Borders & Shadows */
    --border-light: #F5F5F5;
    --border-medium: #E0E0E0;

    --shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.05);
    --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.03);

    /* Spacing */
    --header-height: 60px;
    --bottom-nav-height: 70px;
    --safe-area-bottom: env(safe-area-inset-bottom);
}

[data-theme="dark"] {
    --bg-app: #121212;
    --bg-card: #1E1E1E;
    --bg-header: #1E1E1E;

    --text-primary: #FFFFFF;
    --text-secondary: #B0B0B0;
    --text-muted: #757575;

    --border-light: #2C2C2C;
    --border-medium: #424242;

    --shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.3);
    --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-app);
    color: var(--text-primary);
    line-height: 1.5;
    overflow-x: hidden;
    padding-top: var(--header-height);
    padding-bottom: calc(var(--bottom-nav-height) + 20px);
}

/* Header Styles */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    background: var(--bg-header);
    /* backdrop-filter: blur(10px); */
    /* background: rgba(255, 255, 255, 0.95); */
    z-index: 1000;
    display: flex;
    align-items: center;
    padding: 0 20px;
    box-shadow: 0 1px 0 var(--border-light);
}

.header-content {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.app-brand {
    font-size: 20px;
    font-weight: 700;
    background: linear-gradient(45deg, var(--primary), var(--primary-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

/* Main Content Area */
.app-main {
    padding: 20px;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Cards */
.card {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 20px;
    box-shadow: var(--shadow-card);
    margin-bottom: 20px;
    border: 1px solid var(--border-light);
}

/* Balance Cards Grid */
.balance-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 25px;
}

.balance-card {
    background: var(--bg-card);
    border-radius: 18px;
    padding: 16px;
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
}

.balance-card.highlight {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border: none;
}

.balance-card.highlight .label {
    color: rgba(255, 255, 255, 0.9);
}

.balance-card.highlight .value {
    color: white;
}

.balance-card .label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.balance-card .value {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.balance-card .sub-info {
    font-size: 11px;
    margin-top: 5px;
    opacity: 0.8;
}

/* Action Buttons - Quick Access */
.quick-actions {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
}

.action-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px;
    border-radius: 16px;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    transition: transform 0.2s;
    box-shadow: var(--shadow-soft);
}

.action-btn:active {
    transform: scale(0.96);
}

.btn-income {
    background: var(--success);
    color: white;
}

.btn-expense {
    background: var(--danger);
    color: white;
}

/* List Items (Transactions, Categories) */
.list-section {
    margin-bottom: 30px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding: 0 5px;
}

.section-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

.section-link {
    font-size: 13px;
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.transaction-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.trans-item {
    display: flex;
    align-items: center;
    padding: 12px;
    background: var(--bg-card);
    border-radius: 16px;
    border: 1px solid var(--border-light);
}

.trans-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    font-size: 18px;
    flex-shrink: 0;
}

.trans-icon.income {
    background: rgba(102, 187, 106, 0.15);
    color: var(--success);
}

.trans-icon.expense {
    background: rgba(239, 83, 80, 0.15);
    color: var(--danger);
}

.trans-info {
    flex: 1;
    overflow: hidden;
}

.trans-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.trans-meta {
    font-size: 12px;
    color: var(--text-secondary);
}

.trans-amount {
    font-weight: 700;
    font-size: 14px;
    margin-left: 10px;
    white-space: nowrap;
}

.amount-income {
    color: var(--success);
}

.amount-expense {
    color: var(--danger);
}

/* Progress Bars */
.progress-container {
    height: 8px;
    background: var(--border-light);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 8px;
}

.progress-bar {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: var(--bottom-nav-height);
    background: var(--bg-card);
    display: flex;
    justify-content: space-around;
    align-items: center;
    border-top: 1px solid var(--border-light);
    padding-bottom: var(--safe-area-bottom);
    z-index: 1000;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--text-muted);
    transition: color 0.3s;
    width: 25%;
    height: 100%;
    gap: 4px;
}

.nav-item.active {
    color: var(--primary);
}

.nav-item svg {
    width: 24px;
    height: 24px;
}

.nav-icon {
    margin-bottom: 2px;
}

.nav-item span {
    font-size: 10px;
    font-weight: 500;
}

/* Utilities */
.text-success {
    color: var(--success);
}

.text-danger {
    color: var(--danger);
}

.text-muted {
    color: var(--text-muted);
}

/* Charts (Simple CSS Bars) */
.chart-container {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    height: 150px;
    padding-top: 20px;
}

.chart-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex: 1;
}

.chart-bars-group {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 100%;
}

.bar {
    width: 8px;
    border-radius: 4px 4px 0 0;
    min-height: 4px;
}

.bar-income {
    background: var(--success);
    opacity: 0.8;
}

.bar-expense {
    background: var(--danger);
    opacity: 0.8;
}

.chart-label {
    font-size: 10px;
    color: var(--text-muted);
    font-weight: 600;
}

/* Form Inputs */
.modern-input {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-app);
    border: 1px solid var(--border-medium);
    border-radius: 12px;
    font-size: 15px;
    color: var(--text-primary);
    transition: all 0.2s ease;
    outline: none;
    /* Ensure no default browser outline clashes */
}

.modern-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(255, 136, 0, 0.15);
    background: var(--bg-card);
}

.modern-input::placeholder {
    color: var(--text-muted);
}