/* main.css */

/* =========================================
   1. VARIABLES & RESET
   ========================================= */
:root {
    --primary-color: #FFC107;       /* Goldish/Amber */
    --primary-hover-color: #E0A800; /* Darker Gold for hover */
    --nav-bg-color: #ffffff;        /* White background for navigation */
    --nav-text-color: #343a40;      /* Dark Charcoal for navigation text */
    --nav-link-active-bg: #fff3e0;  /* Lightest Gold for active link */
    --text-color: #212529;
    --background-color: #f8f9fa;
    --expense-color: #dc3545;       /* Red */
    --income-color: #28a745;        /* Green */
    --secondary-color: #6c757d;     /* Standard Gray */
    --danger-color: #dc3545;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    /* Prevent horizontal scroll on mobile if something overflows slightly */
    overflow-x: hidden;
}

/* =========================================
   2. TYPOGRAPHY
   ========================================= */
h1, h2, h3 {
    font-weight: 600;
    color: var(--nav-text-color);
}

h1 { font-size: 28px; }
h2 { font-size: 22px; }
h3 { font-size: 18px; }

/* =========================================
   3. COMPONENTS
   ========================================= */

/* --- Buttons (Standard) --- */
.btn {
    padding: 10px 18px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: all 0.2s ease-in-out;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    text-align: center;
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--nav-text-color);
    font-weight: 700;
}

.btn-primary:hover {
    background-color: var(--primary-hover-color);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background-color: #5a6268;
    transform: translateY(-1px);
}

.btn-danger {
    background-color: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background-color: #c82333;
}

/* --- Buttons (Small & Custom) --- */
.btn-sm {
    padding: 6px 12px;
    font-size: 14px;
    line-height: 1.5;
    border-radius: 4px;
    font-weight: 500;
}

.btn-danger-custom {
    background-color: #f8d7da; /* Light Red */
    color: #721c24;            /* Dark Red text */
    border: 1px solid #f5c6cb;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 4px;
}

/* --- Buttons (Disabled State) --- */
.btn.btn-disabled,
.btn-primary.btn-disabled,
.btn-secondary.btn-disabled,
.btn-danger.btn-disabled {
    background-color: var(--secondary-color) !important;
    color: #f8f9fa !important;
    cursor: not-allowed !important;
    opacity: 0.65 !important;
    transform: none !important;
    box-shadow: none !important;
    pointer-events: none !important;
}

/* --- Hamburger Menu Icon (For Mobile Sidebar) --- */
.menu-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    margin-right: 10px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    z-index: 1001; /* Ensure above overlay */
}

.hamburger,
.hamburger::before,
.hamburger::after {
    display: block;
    width: 24px;
    height: 2px;
    background-color: var(--nav-text-color);
    transition: 0.3s;
}

.hamburger::before,
.hamburger::after {
    content: '';
    position: absolute;
}

.hamburger::before { transform: translateY(-7px); }
.hamburger::after { transform: translateY(7px); }


/* =========================================
   4. LAYOUT & UTILITIES
   ========================================= */

.container {
    width: 100%;
    margin: 0 auto;
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e9ecef;
}

/* Wrapper for content to respect Sidebar */
.main-content {
    min-height: 100vh;
    transition: margin-left 0.3s ease;
    /* Default spacing (will be overridden by media queries) */
    padding: 24px;
    padding-top: 88px;
    margin-left: 0;
}

/* Utility Classes */
.mt-5 { margin-top: 40px; }
.mt-2 { margin-top: 10px; }
.mb-3 { margin-bottom: 20px; }
.mb-5 { margin-bottom: 50px; }
.hidden { display: none !important; }


/* =========================================
   5. RESPONSIVE QUERIES
   ========================================= */

/* =========================================
   5. RESPONSIVE QUERIES
   ========================================= */

/* MOBILE ONLY (max-width: 767px) */
@media (max-width: 767px) {
    /* 1. Wrapper flush with screen edges */
    .main-content {
        padding: 0;
        padding-top: 80px;
        overflow-x: hidden;
    }

    /* 2. Container full width, no rounded corners */
    .container {
        max-width: 100%;
        width: 100%;
        margin: 0;
        border-radius: 0;
        box-shadow: none;
        border: none;
        padding: 20px 15px;
    }

    /* 3. Typography adjustments */
    h1 { font-size: 22px; }
    h2 { font-size: 18px; }
    h3 { font-size: 16px; }

    /* 4. BUTTON FIXES */
    .btn {
        /* Revert to standard or slightly smaller padding */
        padding: 8px 14px;
        /* Do NOT force full width */
        width: auto;
        /* Ensure text isn't massive */
        font-size: 14px;
        /* Keep standard margins */
        margin-bottom: 5px;
    }

    /* Exceptions: Only make the Login/Action buttons full width if desired,
       otherwise keep them auto. If you specifically want the filter buttons
       to fit in a row, this 'width: auto' fixes it. */

    /* Optional: Ensure filter buttons stack nicely if they are too wide */
    .filter-group .btn {
        flex: 1;
    }
}

/* DESKTOP / TABLET LANDSCAPE (min-width: 768px) */
@media (min-width: 768px) {
    .main-content {
        margin-left: 330px;
        padding: 30px;
    }

    .container {
        max-width: 95%;
        margin: 0 auto;
    }

    .menu-toggle {
        display: none;
    }
}