/* ==================== BUDGET TRACKER PRO - COMPLETE STYLES ==================== */
/* Version: 3.6.0 FINAL - Corrected RTL sidebar + Mobile responsive */

/* Base Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
    width: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    width: 100%;
}

/* ==================== BUDGET APP MAIN CONTAINER ==================== */
.budget-app {
    max-width: 1600px;
    margin: 0 auto;
    width: 100%;
    position: relative;
    z-index: 1;
}

/* ==================== BUDGET APP LAYOUT WITH RTL SUPPORT ==================== */
/* DEFAULT (LTR): Main content LEFT, Sidebar RIGHT */
.budget-app-layout {
    display: flex;
    gap: 24px;
    margin-top: 24px;
    align-items: flex-start;
}

/* Main content area */
.budget-main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 24px;
    order: 1; /* Main content first (LEFT) */
    position: relative;
    z-index: 1;
    min-width: 0; /* Prevent overflow */
}

/* Sidebar */
.budget-sidebar {
    width: 380px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 24px;
    order: 2; /* Sidebar second (RIGHT) */
    position: relative;
    z-index: 1;
}

/* RTL LAYOUT (Hebrew/Arabic): Sidebar LEFT, Main content RIGHT */
.budget-app-layout.rtl-layout .budget-main-content {
    order: 2; /* Main content moves to RIGHT */
}

.budget-app-layout.rtl-layout .budget-sidebar {
    order: 1; /* Sidebar moves to LEFT */
}

/* RTL text direction for content inside cards */
[dir="rtl"] {
    direction: rtl;
    text-align: right;
}

[dir="rtl"] .glass-card,
[dir="rtl"] .budget-card,
[dir="rtl"] .expense-item {
    direction: rtl;
}

/* ==================== BUDGET TRACKER CONTAINER ==================== */
.budget-tracker-container {
    min-height: 100vh;
    /* background: linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #4c1d95 100%);
    background-attachment: fixed;
    padding: 20px;
    width: 100%;
    overflow-x: hidden;
}

/* ==================== AUTH CONTAINER & FORMS ==================== */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.auth-form {
    width: 100%;
    max-width: 440px;
}

.auth-form .glass-card {
    padding: 40px;
}

.auth-header {
    text-align: center;
    margin-bottom: 32px;
}

.auth-title {
    font-size: 28px;
    font-weight: 700;
    color: white !important;
    margin-bottom: 8px;
}

.auth-subtitle {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7) !important;
}

.auth-form-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ==================== GLASS CARD EFFECT ==================== */
.glass-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 32px;
    margin-bottom: 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: auto;
}

/* ==================== HEADER ==================== */
.budget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 32px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    margin-bottom: 24px;
    position: relative;
    z-index: 100;
}

.header-logo {
    font-size: 24px;
    font-weight: 700;
    color: white;
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Dropdown */
.dropdown {
    position: relative;
    z-index: 1000;
}

.dropdown-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.dropdown-button:hover {
    background: rgba(255, 255, 255, 0.15);
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 200px;
    background: rgba(30, 27, 75, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 8px;
    display: none;
    z-index: 1001;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.dropdown.active .dropdown-menu {
    display: block;
}

.dropdown-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
}

.dropdown-menu-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.dropdown-menu-item.selected {
    background: rgba(139, 92, 246, 0.3);
}

/* RTL dropdown positioning */
[dir="rtl"] .dropdown-menu {
    right: auto;
    left: 0;
}

/* ==================== FORM ELEMENTS ==================== */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}

.form-label {
    font-size: 14px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9) !important;
    margin: 4px;
    display: block;
}

/* Input with icon container */
.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 16px;
    width: 20px !important;
    height: 20px !important;
    stroke-width: 2;
    opacity: 0.5;
    stroke: white;
    pointer-events: none;
    z-index: 1;
}

.input-icon svg {
    width: 20px !important;
    height: 20px !important;
}

/* RTL input icons */
[dir="rtl"] .input-icon {
    left: auto;
    right: 16px;
}

[dir="rtl"] .input-with-icon .form-input {
    padding-left: 16px !important;
    padding-right: 48px !important;
}

/* Form inputs */
.form-input,
.form-input[type="text"],
.form-input[type="email"],
.form-input[type="password"],
.form-input[type="number"],
.form-input[type="date"],
textarea.form-input,
.budget-input {
    width: 100%;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    color: white !important;
    font-size: 15px;
    transition: all 0.3s ease;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Inputs with icons need extra left padding */
.input-with-icon .form-input {
    padding-left: 48px !important;
}

.form-input:focus,
.budget-input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.15);
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}

.form-input::placeholder,
.budget-input::placeholder {
    color: rgba(255, 255, 255, 0.4) !important;
}

/* Text area specific */
textarea.form-input {
    min-height: 100px;
    resize: vertical;
    padding-left: 16px !important;
}

/* Date input styling */
input[type="date"].form-input {
    color-scheme: dark;
    padding-left: 16px !important;
}

input[type="date"].form-input::-webkit-calendar-picker-indicator {
    filter: invert(1);
    cursor: pointer;
}

/* Number input */
input[type="number"].form-input {
    padding-left: 16px !important;
}

/* ==================== BUTTON STYLES ==================== */

/* PRIMARY BUTTONS (Login, Submit) - Purple/Blue Gradient */
.btn-primary,
button[type="submit"]:not(.btn-success):not(.btn-danger) {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white !important;
    font-weight: 600;
    padding: 14px 24px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    font-size: 16px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.4);
    background: linear-gradient(135deg, #7c3aed 0%, #a78bfa 100%);
}

/* SUCCESS BUTTONS (Save, Accept, Confirm) - Green Glassy */
.btn-success,
.update-budget-btn,
button[type="submit"].btn-success {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.4) 0%, rgba(5, 150, 105, 0.5) 100%) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(16, 185, 129, 0.5) !important;
    color: white !important;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    padding: 14px 24px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 16px;
}

.btn-success:hover,
.update-budget-btn:hover {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.6) 0%, rgba(5, 150, 105, 0.7) 100%) !important;
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(16, 185, 129, 0.4);
}

/* DANGER/SECONDARY BUTTONS (Logout) - Red/Gray */
.btn-danger,
.btn-secondary,
#logout-btn {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.3) 0%, rgba(220, 38, 38, 0.4) 100%) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(239, 68, 68, 0.5) !important;
    color: white !important;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    padding: 14px 24px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 16px;
}

.btn-danger:hover,
.btn-secondary:hover,
#logout-btn:hover {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.5) 0%, rgba(220, 38, 38, 0.6) 100%) !important;
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(239, 68, 68, 0.4);
}

/* ==================== EXPENSE FORM STYLING ==================== */
.expense-form-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 20px;
    font-weight: 700;
    color: white !important;
    margin-bottom: 24px;
}

.expense-form-title span {
    font-size: 20px;
}

.expense-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}

@media (max-width: 768px) {
    .expense-form-grid {
        grid-template-columns: 1fr;
    }
}

/* Category grid */
.category-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-top: 12px;
}

@media (max-width: 768px) {
    .category-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.category-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.category-option:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.2);
}

.category-option.selected {
    background: rgba(139, 92, 246, 0.3);
    border-color: #8b5cf6;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.category-icon {
    font-size: 32px;
    line-height: 1;
}

.category-name {
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    color: rgba(255, 255, 255, 0.9) !important;
}

/* Form actions */
.expense-form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    justify-content: flex-end;
}

.expense-form-actions .btn {
    flex: 1;
    max-width: 200px;
}

/* ==================== TEXT COLORS (ALL WHITE/LIGHT) ==================== */

h1, h2, h3, h4, h5, h6 {
    color: rgba(255, 255, 255, 0.95) !important;
}

p {
    color: rgba(255, 255, 255, 0.8);
}

/* Expense amount - WHITE */
.expense-amount {
    font-size: 18px;
    font-weight: 700;
    color: white !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.expense-name {
    font-size: 15px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95) !important;
}

.expense-meta {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6) !important;
}

.expense-meta span {
    color: rgba(255, 255, 255, 0.6) !important;
}

/* Budget card amounts - WHITE */
.budget-card-amount {
    font-size: 29px;
    font-weight: 700;
    color: white !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.budget-card-title {
    font-size: 20px!important;
    color: rgba(255, 255, 255, 0.7) !important;
}
.tips-title, .templates-title, .expense-list-title, .charts-title{
    font-size: 22px!important;
}
.budget-card-subtitle {
        font-size: 14px;
        color: #FFEB3B !important;
    }

/* Section titles */
.tips-title,
.templates-title,
.expense-list-title,
.charts-title {
    font-size: 18px;
    font-weight: 700;
    color: white !important;
    margin-bottom: 20px;
}

/* ==================== EXPENSE LIST ==================== */
.expense-items {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.expense-item {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.3s ease;
}

.expense-item:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateX(4px);
    border-color: rgba(255, 255, 255, 0.2);
}

/* RTL expense item hover */
[dir="rtl"] .expense-item:hover {
    transform: translateX(-4px);
}

.expense-category-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    flex-shrink: 0;
}

.expense-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

/* ==================== DELETE BUTTON - VISIBLE RED ==================== */
.expense-delete {
    width: 38px;
    height: 38px;
    background: rgba(239, 68, 68, 0.2);
    border: 1.5px solid rgba(239, 68, 68, 0.4);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
    color: #ff6b6b;
}

.expense-delete:hover {
    background: rgba(239, 68, 68, 0.3);
    border-color: rgba(239, 68, 68, 0.6);
    transform: scale(1.1);
    color: #ff5252;
}

.expense-delete svg {
    stroke: currentColor;
    width: 18px;
    height: 18px;
    filter: drop-shadow(0 2px 3px rgba(0,0,0,0.3));
}

/* ==================== BUDGET DASHBOARD ==================== */
.budget-dashboard {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

@media (max-width: 1024px) {
    .budget-dashboard {
        grid-template-columns: 1fr;
    }
}

.budget-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 24px;
    transition: all 0.3s ease;
    position: relative;
    z-index: auto;
}

.budget-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.2);
}

.budget-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1px;
}

.budget-card-icon {
    font-size: 32px;
}

.budget-input-container {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}

.budget-input {
    flex: 1;
}

.update-budget-btn {
    width: 48px;
    height: 48px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.budget-progress {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    overflow: hidden;
    margin-top: 12px;
}

.budget-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #10b981, #14b8a6);
    border-radius: 10px;
    transition: width 0.3s ease;
}

.budget-progress-bar.over-budget {
    background: linear-gradient(90deg, #ef4444, #dc2626);
}

/* ==================== TIPS CARD - VISIBLE ARROWS ==================== */
.budget-card .budget-card-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
}

.tips-nav-buttons {
    display: flex;
    gap: 8px;
}

.tips-nav-btn {
    width: 30px;
    height: 30px;
    background: rgba(255, 255, 255, 0.2);
    border: 1.5px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: white;
}

.tips-nav-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.15);
}

.tips-nav-btn svg {
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.4));
}

.tip-content {
    flex: 1;
    display: flex;
    align-items: center;
    padding: 16px 0;
    min-height: 80px;
}

.tip-text {
    font-size: 13px;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
}
.tip-text {
    transition: opacity 0.3s ease;
}


.tip-progress-container {
    margin-top: 12px;
}

.tip-progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 8px;
}

.tip-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981, #14b8a6);
    border-radius: 10px;
    transition: width 0.1s linear;
}

.tip-indicator {
    display: flex;
    justify-content: center;
}

.tip-counter {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
}

/* ==================== LIVE RATES WIDGET ==================== */
.live-rates-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.refresh-rates-btn {
    width: 32px;
    height: 32px;
    background: rgba(255,255,255,0.1);
    border: none;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: white;
}

.refresh-rates-btn:hover {
    background: rgba(255,255,255,0.2) !important;
    transform: scale(1.1);
}

.refresh-spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ==================== CHARTS ==================== */
.charts-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 18px;
    font-weight: 700;
    color: white !important;
    margin-bottom: 20px;
}

.chart-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.chart-bar-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chart-bar-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
}

.chart-bar-icon {
    margin-right: 8px;
    font-size: 18px;
}

.chart-bar-bg {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
}

.chart-bar-fill {
    height: 100%;
    border-radius: 10px;
    transition: width 0.3s ease;
}

/* ==================== TEMPLATES ==================== */
.templates-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 18px;
    font-weight: 700;
    color: white !important;
    margin-bottom: 20px;
}

.templates-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

@media (max-width: 768px) {
    .templates-grid {
        grid-template-columns: 1fr;
    }
}

.template-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.template-card:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-4px);
    border-color: rgba(255, 255, 255, 0.2);
}

.template-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.template-name {
    font-size: 16px;
    font-weight: 600;
    color: white;
    margin-bottom: 8px;
}

.template-amount {
    font-size: 24px;
    font-weight: 700;
    color: #10b981;
    margin-bottom: 4px;
}

.template-description {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
}

/* ==================== SIGNUP FOOTER ==================== */
.signup-footer {
    text-align: center;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.signup-footer-text {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7) !important;
}

.signup-footer-link {
    color: #a78bfa !important;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.signup-footer-link:hover {
    color: #c4b5fd !important;
}

/* ==================== ALERTS ==================== */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 24px;
    font-size: 14px;
}

.alert-success {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.4);
    color: #6ee7b7 !important;
}

.alert-error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #fca5a5 !important;
}

/* ==================== LOADING SPINNER ==================== */
.budget-tracker-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 500px;
    text-align: center;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top-color: #6366f1;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

/* ==================== RESPONSIVE & MOBILE ==================== */
@media (max-width: 1024px) {
    /* Stack layout vertically on tablets/mobile */
    .budget-app-layout {
        flex-direction: column;
    }
    
    .budget-sidebar {
        width: 100%;
        order: 1 !important; /* Sidebar on top for mobile */
    }
    
    .budget-main-content {
        order: 2 !important; /* Main content below for mobile */
    }
}

@media (max-width: 768px) {
    /* Mobile optimizations */
    html, body {
        overflow-x: hidden;
        max-width: 100vw;
    }
    
    .budget-tracker-container {
        padding: 12px;
        max-width: 100vw;
    }
    
    .budget-app {
        max-width: 100%;
        padding: 0;
    }
    
    .glass-card {
        padding: 20px;
    }
    
    .budget-header {
        padding: 16px;
        flex-wrap: wrap;
    }
    
    .header-logo {
        font-size: 20px;
    }
    
    .header-controls {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .expense-form-actions {
        flex-direction: column;
    }
    
    .expense-form-actions .btn {
        max-width: 100%;
    }
    
    .budget-dashboard {
        gap: 16px;
    }
    
    .budget-card {
        padding: 20px;
    }
    
    .budget-sidebar {
        gap: 16px;
    }
    
    .budget-main-content {
        gap: 16px;
    }
}

@media (max-width: 480px) {
    .budget-tracker-container {
        padding: 8px;
    }
    
    .glass-card {
        padding: 16px;
        border-radius: 16px;
    }
    
    .budget-card {
        padding: 16px;
    }
}
/* ==================== RTL FIX - CSS ONLY ==================== */

[dir="rtl"] .expense-list-title,
[dir="rtl"] .charts-title,
[dir="rtl"] .templates-title,
[dir="rtl"] .live-rates-header {
    direction: rtl !important;
    text-align: right !important;
    unicode-bidi: embed !important;
}

[dir="rtl"] .btn-success,
[dir="rtl"] button[type="submit"] {
    direction: rtl !important;
    text-align: center !important;
}

[dir="rtl"] .glass-card {
    direction: rtl;
}

[dir="rtl"] .chart-bar-label {
    direction: rtl !important;
    text-align: right !important;
}

[dir="rtl"] .chart-bar-icon {
    margin-right: 0 !important;
    margin-left: 8px !important;
}
/* ==================== RTL FIX - WORKS WITH CURRENT HTML STRUCTURE ==================== */
/* Your widgets are rendered as plain text with emojis, not wrapped in spans */
/* This CSS forces proper RTL display */

/* Force these widgets to be RTL in RTL mode */
[dir="rtl"] .expense-list-title,
[dir="rtl"] .charts-title,
[dir="rtl"] .templates-title,
[dir="rtl"] .live-rates-header h3,
[dir="rtl"] .live-rates-header {
    direction: rtl !important;
    text-align: right !important;
    unicode-bidi: embed !important;
}

/* Save button - needs RTL */
[dir="rtl"] .btn-success,
[dir="rtl"] .update-budget-btn,
[dir="rtl"] button[type="submit"] {
    direction: rtl !important;
    text-align: center !important;
}

/* Make sure parent containers allow RTL */
[dir="rtl"] .glass-card {
    direction: rtl;
}

/* Analytics chart bars in RTL */
[dir="rtl"] .chart-bar-label {
    direction: rtl !important;
    text-align: right !important;
    flex-direction: row-reverse !important;
}

[dir="rtl"] .chart-bar-icon {
    margin-right: 0 !important;
    margin-left: 8px !important;
}

/* ==================== RMOBILE CSS FIXES MANUAL ==================== */
@media (max-width: 767px) {
    .budget-tracker-container, .e-con.e-flex>.e-con-inner, :is(.elementor-section-wrap,[data-elementor-id])>.e-con{
        padding: 0px !important;
    }
    .budget-header {
        margin-bottom: 11px;
        padding: 10px 1px!important;
        gap: 9px!important;
}
.budget-app-layout {
    margin-top: 0px!important;
    padding-top: 0px !important;
}
.budget-tracker-container {
    /* background: linear-gradient(0deg, #060334 0%, #302d83 50%, #000000 100%); */
    background-attachment: fixed;
    padding: 5px!important; 
}
.glass-card {
padding: 11px 10px !important;
}
.budget-tracker-container {
        padding: 0px !important;
}
    .btn-danger, .btn-secondary,.dropdown-button, #logout-btn {
    padding: 10px 15px!important;
    font-size: 13px!important;
}

[type=button], [type=submit], button {
    padding: unset!important;
}
.budget-sidebar {
    gap: 15px!important;
}
.budget-app-layout, .budget-app-layout.rtl-layout {
        padding: 1px!important;
    }
    .header-controls {
    gap: 11px!important;
}
.category-option {
    padding: 11px 10px!important;
}
.tip-text {
    font-size: 16px!important;
    font-weight: 600 !important;
}
.budget-input {
    font-size: 16px!important;
}
#glass-card.budget-card-title {
    font-size: 18px!important;
    color: white!important;
    font-weight: 700!important;
    margin-block-end: 1rem;
    margin-block-start: .5rem;
}
}
/* ==================== Desktops CSS FIXES MANUAL ==================== */
@media (min-width: 768px) {
.budget-tracker-container {
    min-height: 100vh;
    background: linear-gradient(357deg, #274075 0%, #2a2fcc 50%, #02000b 100%)!important;
}
[type=button], [type=submit], button {
    padding:unset!important;
}
btn-danger, .btn-secondary,.dropdown-button, #logout-btn {
    padding: 10px 15px!important;
    font-size: 14px!important;
}
.tip-text {
    font-size: 17px;
    font-weight: 600 !important;
}
.budget-card, .glass-card {
    padding: 13px!important;
}
.budget-app-layout {
    gap: 24px!important;
    padding: 1px!important;
}
img.wp-smiley, img.emoji {
    height: 1.1em !important;
    width: 1.1em !important;
}
.budget-input {
    font-size: 16px!important;
}
#glass-card.budget-card-title {
    font-size: 20px!important;
    color: white!important;
    font-weight: 700!important;
}
.expense-form-actions .btn {
    padding: 5px !important;
}
}
