/* ============================================
   CSS CUSTOM PROPERTIES (VARIABLES)
   ============================================ */
:root {
    /* Colors - Primary */
    --color-brown-dark: #8b6f47;
    --color-brown-text: #5d4a2f;
    --color-text-primary: #3d2f1f;
    --color-text-dark: #2d5a3d;
    --color-text-error: #8b3d2f;
    --color-text-warning: #5d2f4a;
    
    /* Colors - Green Palette */
    --color-green-light: #a8d5ba;
    --color-green-medium: #8bc9a0;
    --color-green-dark: #6b9c7a;
    --color-green-bg-start: #b5cbad;
    --color-green-bg-end: #5f9262;
    --color-green-banner-start: #c8dcc1;
    --color-green-banner-end: #91cc95;
    --color-green-hover-start: #b8e5ca;
    --color-green-hover-end: #9bd9b0;
    
    /* Colors - Red/Pink Palette */
    --color-red-light: #d4a8a8;
    --color-red-medium: #c9968b;
    --color-red-border: #a86b9a;
    --color-red-hover-start: #e4cdb8;
    --color-red-hover-end: #d9cb9b;
    
    /* Colors - Background */
    --color-bg-gradient-start: #a8d5ba;
    --color-bg-gradient-mid: #c9a8a8;
    --color-bg-gradient-end: #d4c4a0;
    --color-canvas-bg: #143f24;
    
    /* Typography */
    --font-primary: 'Kalam', cursive;
    --font-heading: 'Caveat', cursive;
    --font-size-base: 14px;
    --font-size-small: 11px;
    --font-size-medium: 15px;
    --font-size-lg: 16px;
    --font-size-large: 20px;
    --font-size-xl: 24px;
    --font-size-xxl: 32px;
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    
    /* Spacing */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 12px;
    --spacing-lg: 16px;
    --spacing-xl: 20px;
    --spacing-xxl: 24px;
    --spacing-xxxl: 30px;
    
    /* Border & Radius */
    --border-width-thin: 2px;
    --border-width-medium: 3px;
    --border-width-thick: 4px;
    --border-style: double;
    --border-radius-sm: 8px;
    --border-radius-md: 12px;
    --border-radius-lg: 16px;
    --border-radius-circle: 50%;
    
    /* Shadows */
    --shadow-inset-light: inset 0 1px 3px rgba(139, 111, 71, 0.2);
    --shadow-inset-medium: inset 0 2px 4px rgba(139, 111, 71, 0.2);
    --shadow-outset-sm: 0 3px 6px rgba(139, 111, 71, 0.2);
    --shadow-outset-md: 0 4px 8px rgba(139, 111, 71, 0.3);
    --shadow-outset-lg: 0 6px 12px rgba(139, 111, 71, 0.4);
    --shadow-outset-xl: 0 8px 24px rgba(139, 111, 71, 0.5);
    --shadow-glow-green: 0 0 20px rgba(74, 139, 90, 0.6);
    
    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.6s ease-out;
    
    /* Z-index */
    --z-index-panel: 100;
    --z-index-modal: 1000;
    --z-index-toast: 10000;
    
    /* Gradients */
    --gradient-sidebar: linear-gradient(180deg, var(--color-green-bg-start) 0%, var(--color-green-bg-end) 100%);
    --gradient-banner: linear-gradient(180deg, var(--color-green-banner-start) 0%, var(--color-green-banner-end) 100%);
    --gradient-tool-item: linear-gradient(135deg, var(--color-green-light) 0%, var(--color-green-medium) 100%);
    --gradient-tool-hover: linear-gradient(135deg, var(--color-green-hover-start) 0%, var(--color-green-hover-end) 100%);
    --gradient-tool-active: linear-gradient(135deg, #a8aad4 0%, #8bbac9 100%);
    --gradient-body: linear-gradient(135deg, var(--color-bg-gradient-start) 0%, var(--color-bg-gradient-mid) 50%, var(--color-bg-gradient-end) 100%);
}

/* ============================================
   RESET & BASE STYLES
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-primary);
    background: var(--gradient-body);
    color: var(--color-text-primary);
    overflow: hidden;
}

/* ============================================
   LAYOUT COMPONENTS
   ============================================ */
.game-container {
    position: relative;
    height: 100vh;
    width: 100vw;
}

.sidebar {
    position: absolute;
    top: 15px;
    left: 15px;
    bottom: 15px;
    width: 280px;
    background: var(--gradient-sidebar);
    padding: var(--spacing-xl);
    overflow-y: auto;
    border-radius: var(--border-radius-md);
    border: var(--border-width-medium) solid var(--color-brown-dark);
    border-style: var(--border-style);
    box-shadow: 
        var(--shadow-inset-medium),
        var(--shadow-outset-lg);
    z-index: var(--z-index-panel);
    transition: opacity var(--transition-fast);
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
    backdrop-filter: blur(4px);
}

.sidebar::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.sidebar.tool-selected {
    pointer-events: none;
}

.sidebar.tool-selected .tool-item {
    pointer-events: auto;
}

.canvas-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--color-canvas-bg);
    overflow: hidden;
    transition: background-color 0.5s ease;
}

#gameCanvas {
    display: block;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    cursor: crosshair;
}

/* ============================================
   BANNERS & HEADERS
   ============================================ */
.sidebar-banner {
    background: var(--gradient-banner);
    padding: 15px var(--spacing-xl);
    border-radius: var(--border-radius-md);
    border: var(--border-width-medium) solid var(--color-brown-dark);
    border-style: var(--border-style);
    box-shadow: 
        var(--shadow-inset-medium),
        var(--shadow-outset-md);
    text-align: center;
    margin-bottom: 25px;
    position: relative;
}

.banner-ornament {
    position: absolute;
    top: var(--spacing-sm);
    left: 50%;
    transform: translateX(-50%);
    font-size: 18px;
    color: var(--color-brown-dark);
    opacity: 0.6;
}

.banner-ornament-small {
    position: absolute;
    top: var(--spacing-xs);
    left: 50%;
    transform: translateX(-50%);
    font-size: var(--font-size-base);
    color: var(--color-brown-dark);
    opacity: 0.5;
}

.sidebar h2 {
    color: var(--color-brown-text);
    margin: 0;
    text-align: center;
    font-size: var(--font-size-xxl);
    font-weight: var(--font-weight-bold);
    font-family: var(--font-heading);
    text-shadow: 2px 2px 0px rgba(255, 255, 255, 0.8), -1px -1px 0px rgba(139, 111, 71, 0.3);
    letter-spacing: 2px;
}

.section-banner {
    padding: var(--spacing-sm) var(--spacing-md);
    margin-bottom: var(--spacing-md);
    text-align: center;
}

.tool-section {
    margin-bottom: 25px;
}

.tool-section h3 {
    color: var(--color-brown-text);
    margin: 0;
    font-size: var(--font-size-large);
    font-weight: var(--font-weight-semibold);
    font-family: var(--font-heading);
    text-shadow: 1px 1px 0px rgba(255, 255, 255, 0.8);
    letter-spacing: 1px;
}

/* ============================================
   STATS PANEL
   ============================================ */
.stats-panel {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--gradient-sidebar);
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: var(--border-radius-md);
    border: var(--border-width-medium) solid var(--color-brown-dark);
    border-style: var(--border-style);
    box-shadow: 
        var(--shadow-inset-medium),
        var(--shadow-outset-lg);
    z-index: var(--z-index-panel);
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 200px;
    backdrop-filter: blur(4px);
}

.stats-banner {
    text-align: center;
    padding: var(--spacing-sm);
    border-bottom: var(--border-width-thin) solid var(--color-brown-dark);
    margin-bottom: var(--spacing-sm);
    position: relative;
    font-family: var(--font-heading);
    font-size: var(--font-size-large);
    font-weight: var(--font-weight-semibold);
    color: var(--color-brown-text);
}

.stat-item {
    text-align: center;
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-normal);
    transition: all var(--transition-normal);
    font-family: var(--font-primary);
    color: var(--color-brown-text);
}

.stat-group {
    display: flex;
    flex-direction: column;
    gap: var(--border-width-thin);
    background: linear-gradient(135deg, rgba(139, 111, 71, 0.15) 0%, rgba(139, 111, 71, 0.1) 100%);
    padding: 10px;
    border-radius: var(--border-radius-sm);
    border: var(--border-width-thin) solid rgba(139, 111, 71, 0.3);
    box-shadow: inset 0 2px 4px rgba(139, 111, 71, 0.1);
}

.stat-group .stat-item {
    margin: 0;
    background: none;
    border: none;
    box-shadow: none;
}

.budget-display {
    background: linear-gradient(135deg, rgba(168, 213, 186, 0.4) 0%, rgba(139, 201, 160, 0.4) 100%);
    padding: 10px;
    margin-bottom: 0;
    text-align: center;
    font-size: 17px;
    font-weight: var(--font-weight-semibold);
    color: var(--color-text-dark);
    border: var(--border-width-thin) solid var(--color-green-dark);
    border-radius: var(--border-radius-sm);
    box-shadow: inset 0 2px 4px rgba(107, 156, 122, 0.2);
    position: relative;
    transition: all var(--transition-normal);
}

.population-display {
    background: linear-gradient(135deg, rgba(200, 220, 255, 0.4) 0%, rgba(170, 200, 255, 0.4) 100%);
    color: #3d4a6b;
    border: var(--border-width-thin) solid #7a8bb3;
    box-shadow: inset 0 2px 4px rgba(122, 139, 179, 0.2);
}

.unemployed-display {
    background: linear-gradient(135deg, rgba(255, 220, 200, 0.4) 0%, rgba(255, 200, 170, 0.4) 100%);
    color: #6b4a3d;
    border: var(--border-width-thin) solid #b37a6b;
    box-shadow: inset 0 2px 4px rgba(179, 122, 107, 0.2);
}

.production-display {
    background: linear-gradient(135deg, rgba(220, 255, 200, 0.4) 0%, rgba(200, 255, 170, 0.4) 100%);
    color: #4a6b3d;
    border: var(--border-width-thin) solid #7ab36b;
    box-shadow: inset 0 2px 4px rgba(122, 179, 107, 0.2);
}

.production-warning {
    text-align: center;
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-semibold);
    font-family: var(--font-primary);
    color: var(--color-text-error);
}

.income-display {
    background: linear-gradient(135deg, rgba(255, 240, 200, 0.4) 0%, rgba(255, 220, 170, 0.4) 100%);
    color: #3d4a6b;
    border: var(--border-width-thin) solid #b3a07a;
    box-shadow: inset 0 2px 4px rgba(179, 160, 122, 0.2);
}

.expenses-display {
    background: linear-gradient(135deg, rgba(255, 200, 200, 0.4) 0%, rgba(255, 170, 170, 0.4) 100%);
    color: #6b4a3d;
    border: var(--border-width-thin) solid #b37a6b;
    box-shadow: inset 0 2px 4px rgba(179, 122, 107, 0.2);
}

/* ============================================
   TIME GAUGE
   ============================================ */
.time-gauge-container {
    background: linear-gradient(135deg, rgba(139, 111, 71, 0.15) 0%, rgba(139, 111, 71, 0.1) 100%);
    padding: 10px;
    border-radius: var(--border-radius-sm);
    border: var(--border-width-thin) solid rgba(139, 111, 71, 0.3);
    box-shadow: inset 0 2px 4px rgba(139, 111, 71, 0.1);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.time-gauge-label {
    text-align: center;
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-semibold);
    font-family: var(--font-primary);
    color: var(--color-brown-text);
}

.time-gauge {
    position: relative;
    width: 100%;
    height: 24px;
    background: rgba(139, 111, 71, 0.2);
    border: var(--border-width-thin) solid var(--color-brown-dark);
    border-radius: var(--border-radius-sm);
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(139, 111, 71, 0.2);
}

.time-gauge-day {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: calc(24 / 36 * 100%); /* DAY_LENGTH / (DAY_LENGTH + NIGHT_LENGTH) = 16/22 ≈ 72.73% */
    background: linear-gradient(90deg, #ffd89b 0%, #fdb44b 50%, #ffa726 100%);
    transition: width var(--transition-normal);
}

.time-gauge-night {
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    width: calc(12 / 36 * 100%); /* NIGHT_LENGTH / (DAY_LENGTH + NIGHT_LENGTH) = 6/22 ≈ 27.27% */
    background: linear-gradient(90deg, #2c3e50 0%, #1a1a2e 50%, #0f0f1e 100%);
    transition: width var(--transition-normal);
}

.time-gauge-indicator {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 3px;
    background: #fff;
    box-shadow: 0 0 4px rgba(255, 255, 255, 0.8), 0 0 8px rgba(255, 255, 255, 0.4);
    border-left: 1px solid rgba(255, 255, 255, 0.5);
    border-right: 1px solid rgba(255, 255, 255, 0.5);
    transform: translateX(-50%);
    transition: left var(--transition-normal);
    z-index: 10;
    pointer-events: none;
}

.time-gauge-status {
    text-align: center;
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-semibold);
    font-family: var(--font-primary);
    color: var(--color-brown-text);
}

.budget-display.low-budget {
    color: var(--color-text-error);
    border-color: #b36b5a;
    background: linear-gradient(135deg, rgba(255, 200, 200, 0.5) 0%, rgba(255, 170, 170, 0.5) 100%);
    animation: pulse 1s infinite;
}

.budget-display.income-update {
    background: linear-gradient(135deg, rgba(139, 201, 160, 0.8) 0%, rgba(107, 156, 122, 0.8) 100%);
    border: var(--border-width-medium) solid #4a8b5a;
    box-shadow: 0 0 20px rgba(74, 139, 90, 0.6), inset 0 2px 4px rgba(74, 139, 90, 0.3);
    transform: scale(1.05);
    animation: budgetPulse var(--transition-slow) ease-out;
}

.income-indicator {
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--color-text-dark);
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-bold);
    white-space: nowrap;
    pointer-events: none;
    animation: incomeFloat 1s ease-out forwards;
    text-shadow: 0 0 8px rgba(45, 90, 61, 0.8), 2px 2px 0px rgba(255, 255, 255, 0.9);
    z-index: 101;
    font-family: var(--font-heading);
}

/* ============================================
   TOOL SELECTOR
   ============================================ */
.tool-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-md);
    justify-items: center;
}

.tool-item {
    background: var(--gradient-tool-item);
    border: var(--border-width-medium) solid var(--color-green-dark);
    border-style: var(--border-style);
    padding: var(--spacing-md);
    cursor: pointer;
    text-align: center;
    transition: all var(--transition-normal);
    border-radius: 20px;
    box-shadow: 
        inset 0 2px 4px rgba(107, 156, 122, 0.2),
        var(--shadow-outset-sm);
    width: 100%;
    max-width: 110px;
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.tool-item.circular {
    border-radius: var(--border-radius-circle);
    width: 80px;
    height: 80px;
    padding: var(--spacing-sm);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    max-width: 80px;
}

.tool-item:hover {
    background: var(--gradient-tool-hover);
    border-color: #5d8a6a;
    transform: scale(1.08);
    box-shadow: 
        inset 0 2px 4px rgba(107, 156, 122, 0.3),
        0 5px 10px rgba(139, 111, 71, 0.4);
}

.tool-item.active {
    background: var(--gradient-tool-active);
    border-color: #6b8fa8;
    border-width: var(--border-width-thick);
    box-shadow: 
        0 0 15px rgba(168, 107, 154, 0.6),
        inset 0 2px 4px rgba(168, 107, 154, 0.3);
    transform: scale(1.05);
}

.tool-item span {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    color: var(--color-text-primary);
    font-weight: var(--font-weight-medium);
    font-family: var(--font-primary);
}

.tool-item.circular span {
    font-size: var(--font-size-small);
    margin-top: var(--spacing-xs);
}

.tool-item .tool-cost {
    display: block;
    margin-top: var(--spacing-xs);
    font-size: var(--font-size-small);
    color: var(--color-text-dark);
    font-weight: var(--font-weight-semibold);
    font-family: var(--font-primary);
}

.tool-item.active .tool-cost {
    color: var(--color-text-warning);
}

.tool-preview {
    width: 40px;
    height: 40px;
    margin: 0 auto;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

.tool-preview-canvas {
    width: 40px;
    height: 40px;
    margin: 0 auto;
    display: block;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

.tool-buttons-container {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    width: 100%;
}

.demolition-btn {
    width: 100%;
    max-width: none;
    aspect-ratio: auto;
    height: auto;
    min-height: 60px;
    border-radius: var(--border-radius-sm);
}

/* ============================================
   BUTTONS
   ============================================ */
.add-budget-btn {
    width: 100%;
    padding: var(--spacing-md);
    background: var(--gradient-tool-item);
    color: var(--color-text-dark);
    border: var(--border-width-medium) solid var(--color-green-dark);
    border-style: var(--border-style);
    border-radius: var(--border-radius-circle);
    cursor: pointer;
    font-family: var(--font-primary);
    font-size: var(--font-size-medium);
    font-weight: var(--font-weight-semibold);
    transition: all var(--transition-normal);
    margin-bottom: 10px;
    box-shadow: 
        inset 0 2px 4px rgba(107, 156, 122, 0.2),
        var(--shadow-outset-sm);
}

.add-budget-btn:hover {
    background: var(--gradient-tool-hover);
    transform: scale(1.05);
    box-shadow: 
        inset 0 2px 4px rgba(107, 156, 122, 0.3),
        0 5px 10px rgba(139, 111, 71, 0.4);
}

.add-budget-btn:active {
    transform: scale(0.95);
}

.clear-btn {
    width: 100%;
    padding: var(--spacing-md);
    background: linear-gradient(135deg, var(--color-red-light) 0%, var(--color-red-medium) 100%);
    color: var(--color-text-warning);
    border: var(--border-width-medium) solid var(--color-red-border);
    border-style: var(--border-style);
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    font-family: var(--font-primary);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-semibold);
    transition: all var(--transition-normal);
    box-shadow: 
        inset 0 2px 4px rgba(168, 107, 154, 0.2),
        var(--shadow-outset-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    line-height: 1.2;
}

.clear-btn:hover {
    background: linear-gradient(135deg, var(--color-red-hover-start) 0%, var(--color-red-hover-end) 100%);
    transform: scale(1.05);
    box-shadow: 
        inset 0 2px 4px rgba(168, 107, 154, 0.3),
        0 5px 10px rgba(139, 111, 71, 0.4);
}

.clear-btn:active {
    transform: scale(0.95);
}

/* ============================================
   INFO PANEL
   ============================================ */
.item-info-panel {
    position: fixed;
    background: var(--gradient-sidebar);
    padding: var(--spacing-lg) var(--spacing-xl);
    border-radius: var(--border-radius-md);
    border: var(--border-width-medium) solid var(--color-brown-dark);
    border-style: var(--border-style);
    box-shadow: 
        var(--shadow-inset-medium),
        var(--shadow-outset-lg);
    z-index: var(--z-index-modal);
    min-width: 220px;
    max-width: 300px;
    font-family: var(--font-primary);
    color: var(--color-text-primary);
    pointer-events: auto;
    backdrop-filter: blur(4px);
}

.info-panel-title {
    font-family: var(--font-heading);
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-bold);
    color: var(--color-brown-text);
    text-align: center;
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-sm);
    text-shadow: 1px 1px 0px rgba(255, 255, 255, 0.8);
}

.info-panel-divider-light {
    height: 1px;
    background: rgba(139, 111, 71, 0.2);
    margin: 6px 0;
    border-radius: 1px;
}

.info-panel-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    font-size: var(--font-size-base);
}

.info-panel-requirement-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-xs) 0;
    font-size: var(--font-size-base);
}

.info-label {
    font-weight: var(--font-weight-semibold);
    color: var(--color-brown-text);
    flex: 1;
}

.info-value {
    font-weight: var(--font-weight-medium);
    color: var(--color-text-primary);
    text-align: right;
    flex: 1;
}

.info-value-description {
    font-weight: var(--font-weight-medium);
    color: var(--color-text-primary);
    text-align: left;
    flex: 1;
}

.info-value.income {
    color: var(--color-text-dark);
    font-weight: var(--font-weight-semibold);
}

.info-value.expense {
    color: var(--color-text-error);
    font-weight: var(--font-weight-semibold);
}

.info-value.requirement-not-met {
    color: var(--color-text-error);
    font-weight: var(--font-weight-semibold);
}

/* ============================================
   MODAL DIALOG
   ============================================ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(61, 47, 31, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: var(--z-index-modal);
    animation: fadeIn var(--transition-fast) ease;
}

.modal-dialog {
    background: var(--gradient-sidebar);
    border: var(--border-width-thick) solid var(--color-brown-dark);
    border-style: var(--border-style);
    border-radius: var(--border-radius-lg);
    box-shadow: 
        var(--shadow-inset-medium),
        var(--shadow-outset-xl);
    min-width: 400px;
    max-width: 500px;
    padding: 0;
    animation: slideIn var(--transition-normal) ease;
    position: relative;
}

.modal-header {
    background: var(--gradient-banner);
    padding: var(--spacing-xl) var(--spacing-xxl);
    border-bottom: var(--border-width-medium) solid var(--color-brown-dark);
    border-radius: var(--border-radius-md) var(--border-radius-md) 0 0;
    text-align: center;
    position: relative;
}

.modal-header .banner-ornament {
    position: absolute;
    top: var(--spacing-md);
    left: 50%;
    transform: translateX(-50%);
    font-size: var(--font-size-large);
    color: var(--color-brown-dark);
    opacity: 0.6;
}

.modal-header h3 {
    color: var(--color-brown-text);
    margin: var(--spacing-sm) 0 0 0;
    font-size: 28px;
    font-weight: var(--font-weight-bold);
    font-family: var(--font-heading);
    text-shadow: 2px 2px 0px rgba(255, 255, 255, 0.8), -1px -1px 0px rgba(139, 111, 71, 0.3);
    letter-spacing: 1px;
}

.modal-content {
    padding: var(--spacing-xxl);
    color: var(--color-text-primary);
    font-family: var(--font-primary);
    font-size: var(--font-size-medium);
    line-height: 1.6;
}

.modal-content p {
    margin: 0 0 var(--spacing-md) 0;
    font-weight: var(--font-weight-medium);
}

.modal-content ul {
    margin: var(--spacing-md) 0;
    padding-left: var(--spacing-xxl);
    list-style-type: none;
}

.modal-content ul li {
    margin: var(--spacing-sm) 0;
    position: relative;
    padding-left: var(--spacing-xl);
}

.modal-content ul li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--color-brown-dark);
    font-weight: bold;
    font-size: 18px;
}

.modal-warning {
    margin-top: var(--spacing-lg) !important;
    font-weight: var(--font-weight-semibold) !important;
    color: var(--color-text-error) !important;
    text-align: left;
    font-size: var(--font-size-lg);
}

.modal-actions {
    display: flex;
    gap: var(--spacing-lg);
    padding: var(--spacing-lg) var(--spacing-xxl) var(--spacing-xxl) var(--spacing-xxl);
    justify-content: space-between;
}

.dialog-btn {
    padding: var(--spacing-md) var(--spacing-xxl);
    border: var(--border-width-medium) solid;
    border-style: var(--border-style);
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    font-family: var(--font-primary);
    font-size: var(--font-size-medium);
    font-weight: var(--font-weight-semibold);
    transition: all var(--transition-normal);
    box-shadow: 
        var(--shadow-inset-medium),
        var(--shadow-outset-sm);
    min-width: 120px;
    flex: 1;
}

.dialog-btn-cancel {
    background: var(--gradient-tool-item);
    color: var(--color-text-primary);
    border-color: var(--color-green-dark);
}

.dialog-btn-cancel:hover {
    background: var(--gradient-tool-hover);
    transform: scale(1.05);
    box-shadow: 
        inset 0 2px 4px rgba(107, 156, 122, 0.3),
        0 5px 10px rgba(139, 111, 71, 0.4);
}

.dialog-btn-confirm {
    background: linear-gradient(135deg, var(--color-red-light) 0%, var(--color-red-medium) 100%);
    color: var(--color-text-warning);
    border-color: var(--color-red-border);
}

.dialog-btn-confirm:hover {
    background: linear-gradient(135deg, #e4b8b8 0%, #d9a69b 100%);
    transform: scale(1.05);
    box-shadow: 
        inset 0 2px 4px rgba(168, 107, 154, 0.3),
        0 5px 10px rgba(139, 111, 71, 0.4);
}

.dialog-btn:active {
    transform: scale(0.95);
}

/* ============================================
   TOAST MESSAGES
   ============================================ */
.toast-container {
    position: fixed;
    bottom: var(--spacing-xxxl);
    left: 50%;
    transform: translateX(-50%);
    z-index: var(--z-index-toast);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    pointer-events: none;
}

.toast {
    padding: 14px var(--spacing-xxl);
    border-radius: var(--border-radius-sm);
    font-family: var(--font-primary);
    font-size: var(--font-size-medium);
    font-weight: var(--font-weight-semibold);
    text-align: center;
    min-width: 250px;
    max-width: 500px;
    box-shadow: 
        inset 0 2px 4px rgba(0, 0, 0, 0.1),
        0 4px 12px rgba(0, 0, 0, 0.3);
    border: var(--border-width-medium) solid;
    border-style: var(--border-style);
    opacity: 0;
    transform: translateY(100px) scale(0.8);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.toast-neutral {
    background: linear-gradient(180deg, #f5f5f5 0%, #e8e8e8 100%);
    color: var(--color-text-primary);
    border-color: #8b8b8b;
}

.toast-success {
    background: var(--gradient-tool-hover);
    color: var(--color-text-dark);
    border-color: var(--color-green-dark);
}

.toast-warning {
    background: linear-gradient(180deg, #e8b8b8 0%, #d4968b 100%);
    color: #5d2f1f;
    border-color: #a86b5a;
}

.toast-enter {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.toast-exit {
    opacity: 0;
    transform: translateY(100px) scale(0.8);
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

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

@keyframes budgetPulse {
    0% {
        transform: scale(1);
        box-shadow: var(--shadow-outset-sm);
    }
    50% {
        transform: scale(1.08);
        box-shadow: var(--shadow-glow-green), inset 0 2px 4px rgba(74, 139, 90, 0.3);
    }
    100% {
        transform: scale(1.05);
        box-shadow: 0 0 20px rgba(74, 139, 90, 0.6), inset 0 2px 4px rgba(74, 139, 90, 0.3);
    }
}

@keyframes incomeFloat {
    0% {
        opacity: 0;
        transform: translateX(-50%) translateY(0);
    }
    20% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: translateX(-50%) translateY(-30px);
    }
}
