/*
=================================================================
    0. ROOT & GLOBAL STYLES
    - This is the single source of truth for your design system.
    - Change colors and fonts here to update the entire site.
=================================================================
*/

:root {
    /* Color Palette */
    --color-primary: #2c3e50;      /* Dark Charcoal for text and headers */
    --color-primary-light: #4a5568; /* A lighter gray for subtext */
    --color-accent: #28a745;       /* Vibrant Green for buttons and links */
    --color-accent-hover: #218838; /* A darker green for hover effects */
    --color-bg-light: #f4f7f9;    /* Light Gray background for the body */
    --color-white: #ffffff;
    --color-border: #dee2e6;

    /* Status Colors (for flash messages) */
    --color-success-bg: #d4edda;
    --color-success-text: #155724;
    --color-success-border: #c3e6cb;
    --color-error-bg: #f8d7da;
    --color-error-text: #721c24;
    --color-error-border: #f5c6cb;
    --color-info-bg: #cfe2ff;
    --color-info-text: #055160;
    --color-info-border: #b6d4fe;

    /* Typography */
    --font-primary: 'Rubik', sans-serif; /* For headings */
    --font-body: 'Arial', sans-serif;    /* Simple, readable body font */
    
    /* Spacing & Borders */
    --border-radius: 6px;
    --box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
}

/* Global Reset & Box Sizing */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-body);
    line-height: 1.6;
    color: var(--color-primary);
    background-color: var(--color-bg-light);
    font-size: 16px;
}

/*
=================================================================
    1. LAYOUT & CONTAINER
=================================================================
*/

.main-content {
    max-width: 1200px;
    margin: 40px auto;
    padding: 20px;
}

/*
=================================================================
    2. TYPOGRAPHY
=================================================================
*/

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-primary);
    line-height: 1.3;
    margin-bottom: 0.75rem;
    font-weight: 700;
}

h1 { font-size: 2.5em; }
h2 { font-size: 2em; }
h3 { font-size: 1.5em; }

p {
    margin-bottom: 1rem;
    color: var(--color-primary-light);
}

a {
    color: var(--color-accent);
    text-decoration: none;
    transition: color 0.2s ease-in-out;
}

a:hover {
    color: var(--color-accent-hover);
    text-decoration: underline;
}

/*
=================================================================
    3. REUSABLE COMPONENTS (Buttons, Forms, Flash Messages)
=================================================================
*/

/* --- Buttons --- */
.button {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: var(--border-radius);
    background-color: var(--color-accent);
    color: var(--color-white);
    font-family: var(--font-primary);
    font-weight: 500;
    cursor: pointer;
    text-align: center;
    transition: background-color 0.2s ease-in-out;
}

.button:hover {
    background-color: var(--color-accent-hover);
    color: var(--color-white);
    text-decoration: none;
}

.link-button-danger {
    background: none;
    border: none;
    padding: 0;
    color: #dc3545; /* Bootstrap's danger red */
    text-decoration: underline;
    cursor: pointer;
    font-family: inherit;
    font-size: inherit;
}
.link-button-danger:hover {
    color: #a71d2a; /* A darker red */
}

.cta-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
}
.button-secondary {
    background-color: transparent;
    color: var(--color-white);
    border: 2px solid var(--color-white);
}
.button-secondary:hover {
    background-color: var(--color-white);
    color: var(--color-primary);
}

/* --- Forms --- */
.form-container {
    background: var(--color-white);
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    border: 1px solid var(--color-border);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-family: var(--font-primary);
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="email"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    font-size: 1em;
}

.form-group input:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 2px rgba(40, 167, 69, 0.2);
}

/* --- Flash Messages (Your excellent styling) --- */
.flash-message {
    padding: 12px 20px;
    margin-bottom: 20px;
    border-radius: var(--border-radius);
    font-weight: 500;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.flash-message.success {
    background-color: var(--color-success-bg);
    color: var(--color-success-text);
    border: 1px solid var(--color-success-border);
}
.flash-message.error {
    background-color: var(--color-error-bg);
    color: var(--color-error-text);
    border: 1px solid var(--color-error-border);
}
.flash-message.info {
    background-color: var(--color-info-bg);
    color: var(--color-info-text);
    border: 1px solid var(--color-info-border);
}

/*
=================================================================
    4. RESPONSIVE & MOBILE STYLES
=================================================================
*/
/* 
    The styles above are MOBILE-FIRST by default.
    We now add breakpoints to adjust the layout for larger screens.
*/

/* For Tablets and larger */
@media (min-width: 768px) {
    body {
        font-size: 17px;
    }
}

/* For Desktops and larger */
@media (min-width: 1024px) {
    body {
        font-size: 18px;
    }
}

/*
=================================================================
    5. MOBILE NAVIGATION STYLES (Hamburger Menu)
=================================================================
*/

.nav-toggle {
    display: none; /* Hidden on desktop by default */
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    z-index: 1000; /* Ensure it's on top of other content */
}

.hamburger {
    display: block;
    position: relative;
    width: 24px;
    height: 2px;
    background: var(--color-primary);
    transition: all 0.2s ease-in-out;
}

.hamburger::before,
.hamburger::after {
    content: '';
    position: absolute;
    left: 0;
    width: 24px;
    height: 2px;
    background: var(--color-primary);
    transition: all 0.2s ease-in-out;
}

.hamburger::before {
    top: -8px;
}

.hamburger::after {
    bottom: -8px;
}


/* === This is the MOBILE-FIRST part === */
@media (max-width: 768px) {
    .nav-toggle {
        display: block; /* Show the button on mobile */
    }

    .main-nav {
        position: fixed;
        top: 0;
        left: -100%; /* Hide it off-screen to the left */
        width: 70%;
        height: 100vh;
        background-color: var(--color-white);
        box-shadow: 2px 0 10px rgba(0,0,0,0.1);
        flex-direction: column;
        justify-content: center;
        transition: left 0.3s ease-in-out;
    }

    /* Style for the "open" menu */
    .main-nav.is-active {
        left: 0; /* Slide it into view */
    }

    .main-nav ul {
        flex-direction: column;
        align-items: center;
        width: 100%;
    }

    .main-nav ul li {
        width: 100%;
        text-align: center;
    }

    .main-nav ul a {
        display: block;
        padding: 20px;
        font-size: 1.2em;
    }

    /* Style for the "X" close button animation */
    .nav-toggle.is-active .hamburger {
        background: transparent;
    }

    .nav-toggle.is-active .hamburger::before {
        transform: rotate(45deg) translate(5px, 6px);
    }
    
    .nav-toggle.is-active .hamburger::after {
        transform: rotate(-45deg) translate(5px, -6px);
    }
}

/* Add to end of main.css */
.main-header {
    background-color: var(--color-white);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    padding: 15px 20px;
    border-bottom: 1px solid var(--color-border);
}
.header-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.header-logo img {
    height: 40px; /* Adjust as needed */
    width: auto;
}
.main-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 25px;
}
.main-nav a {
    text-decoration: none;
    color: var(--color-primary);
    font-weight: 500;
    font-family: var(--font-primary);
    transition: color 0.2s;
}
.main-nav a:hover {
    color: var(--color-accent);
}

/* Styling for the new header links */
.admin-link a {
    color: var(--color-accent) !important;
    font-weight: 700;
}

.logout-button {
    /* Reset all default button styles */
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    
    /* Inherit font styles from parent */
    font-family: inherit;
    font-size: inherit;
    
    /* Apply styles to match the other nav links */
    color: var(--color-primary);
    font-weight: 500;
    font-family: var(--font-primary);
    cursor: pointer;
    transition: color 0.2s;
}

/* Make it look like a link on hover, just like the other nav items */
.logout-button:hover {
    color: var(--color-accent);
    text-decoration: underline;
}

/* The .logout-button style is already defined. We just add one for the footer. */
.footer-logout {
    color: var(--color-bg-light); /* Match other footer links */
}
.footer-logout:hover {
    color: var(--color-accent);
}

/* Add to end of main.css */
.hero-section {
    text-align: center;
    padding: 60px 20px;
    background-color: var(--color-white);
    border-radius: var(--border-radius);
    border: 1px solid var(--color-border);
}
.hero-content .subtitle {
    max-width: 700px;
    margin: 1rem auto 2rem;
    font-size: 1.15em;
}
.button-cta {
    padding: 12px 30px;
    font-size: 1.1em;
}

.tech-stack-section, .featured-project-section {
    margin-top: 60px;
    text-align: center;
}
.tech-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 20px;
    margin-top: 30px;
}
.tech-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    background: var(--color-white);
    padding: 20px;
    border-radius: var(--border-radius);
    border: 1px solid var(--color-border);
}
.tech-item img {
    height: 50px;
    width: 50px;
}
.tech-item span {
    font-weight: 500;
}
.project-card {
    background: var(--color-white);
    padding: 40px;
    margin-top: 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    border: 1px solid var(--color-border);
}

/* Add to end of main.css */
.main-footer {
    margin-top: 60px;
    background-color: var(--color-primary);
    color: var(--color-bg-light);
    padding: 40px 20px;
}
.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
    text-align: center;
}
.footer-column h4 {
    color: var(--color-white);
    margin-bottom: 15px;
}
.footer-column ul {
    list-style: none;
    padding: 0;
}
.footer-column li {
    margin-bottom: 8px;
}
.footer-column a {
    color: var(--color-bg-light);
    text-decoration: none;
}
.footer-column a:hover {
    color: var(--color-accent);
}
.footer-copyright {
    grid-column: 1 / -1; /* Spans full width */
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--color-primary-light);
    font-size: 0.9em;
}

/*
=================================================================
    5. PORTFOLIO & ABOUT PAGE STYLES
=================================================================
*/

.page-header {
    text-align: center;
    margin-bottom: 40px;
}

.page-header h1 {
    font-size: 2.8em;
}

.page-header .subtitle {
    font-size: 1.2em;
    max-width: 750px;
    margin: 10px auto 0;
    color: var(--color-primary-light);
}

.portfolio-card {
    background: var(--color-white);
    padding: 30px 40px;
    margin-bottom: 25px;
    border-radius: var(--border-radius);
    border: 1px solid var(--color-border);
    box-shadow: var(--box-shadow);
}

.portfolio-card h2 {
    display: flex;
    align-items: center;
    gap: 15px;
    padding-bottom: 15px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--color-border);
    color: var(--color-primary);
}

.portfolio-card h2 .fas {
    color: var(--color-accent);
}

.feature-list {
    list-style: none;
    padding-left: 0;
}

.feature-list li {
    padding-left: 30px;
    position: relative;
    margin-bottom: 15px;
}

.feature-list li::before {
    content: '✓'; /* Checkmark symbol */
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    content: '\f00c'; /* Font Awesome check icon */
    position: absolute;
    left: 0;
    top: 5px;
    color: var(--color-accent);
}

.cta-card {
    text-align: center;
    background-color: var(--color-primary);
    color: var(--color-bg-light);
}
.cta-card h2, .cta-card p {
    color: var(--color-white);
    border-bottom-color: var(--color-primary-light);
}
.cta-card h2 .fas {
    color: var(--color-white);
}

/* Add this new grid class to your css */
.philosophy-grid-four-col {
    display: grid;
    /* Create responsive columns that wrap */
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

/* You might want to adjust the original philosophy-grid to be 3-col if you keep it */
.philosophy-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

/* Styles for the About Page */

.about-grid {
    display: grid;
    grid-template-columns: 2fr 1fr; /* Text column is twice as wide as visual column */
    gap: 40px;
    align-items: start; /* Aligns items to the top of the grid cell */
}



.about-visual-column {
    position: sticky; /* Makes the mascot 'stick' as you scroll */
    top: 40px;
}

.mascot-card {
    background: var(--color-white);
    padding: 20px;
    border-radius: var(--border-radius);
    border: 1px solid var(--color-border);
    box-shadow: var(--box-shadow);
    text-align: center;
}

.mascot-card img {
    max-width: 100%;
    height: auto;
}

/* --- RESPONSIVE for About Page --- */
@media (max-width: 900px) {
    .about-grid {
        grid-template-columns: 1fr; /* Stack the columns on smaller screens */
    }

    .about-visual-column {
        position: static; /* Unstick the mascot card */
        order: -1; /* Move the visual column to the top */
        margin-bottom: 30px;
    }
}

/* --- ERROR Pages --- */
.error-page-body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: var(--color-bg-light);
}
.error-page-container {
    text-align: center;
    background-color: var(--color-white);
    padding: 40px 50px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    max-width: 600px;
}
.error-icon {
    font-size: 5em;
    margin-bottom: 20px;
}
.error-message {
    font-size: 1.1em;
    color: var(--color-primary-light);
    margin-bottom: 30px;
}

/*
=================================================================
    6. ADMIN PANEL STYLES
=================================================================
*/

.admin-header .header-logo {
    font-family: var(--font-primary);
    font-weight: 700;
    font-size: 1.2em;
    color: var(--color-primary);
    text-decoration: none;
}
.admin-container {
    background-color: var(--color-white);
    padding: 30px;
    border-radius: var(--border-radius);
    border: 1px solid var(--color-border);
}
.admin-actions-grid {
    display: flex;
    flex-wrap: wrap; /* Allows buttons to wrap on smaller screens */
    gap: 15px; /* Adds space between buttons */
    margin-top: 20px;
}
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 30px;
}
th, td {
    padding: 12px 15px;
    border: 1px solid var(--color-border);
    text-align: left;
}
th {
    background-color: var(--color-bg-light);
    font-family: var(--font-primary);
}
td .status-draft {
    background-color: #ffc107; /* A nice yellow for drafts */
    color: #333;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.8em;
    font-weight: 500;
}
td .status-published {
    background-color: var(--color-accent);
    color: var(--color-white);
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.8em;
    font-weight: 500;
}

/* Label with helper link styling */
.form-label-with-helper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}
.cheatsheet-link {
    font-size: 0.8em;
    font-weight: 400;
    text-decoration: underline;
}

/* Modal Popup Styles */
.modal-overlay {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: var(--color-white);
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    width: 90%;
    max-width: 600px;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 10px;
    right: 20px;
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}
.modal-close:hover {
    color: var(--color-primary);
}

.modal-content table {
    margin-top: 15px;
}
.modal-content code {
    background: var(--color-bg-light);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
}
.dashboard-sections {
	margin-top: 30px;
}

/* Update the .dashboard-grid to be more flexible */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)); /* Responsive columns */
    gap: 30px;
    margin-top: 30px;
}

/* This allows the last card to span the full width if there's an odd number */
.dashboard-card-full-width:last-child:nth-child(odd) {
    grid-column: 1 / -1;
}

/* === RULE for larger screens === */
@media (min-width: 1024px) {
    .dashboard-grid {
        /* On screens wider than 1024px, it becomes a 3-column grid */
        grid-template-columns: repeat(3, 1fr);
    }
}

.dashboard-card {
    background: var(--color-white); /* CHANGE: Use clean white for the cards */
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    padding: 25px;
    box-shadow: var(--box-shadow); /* ADD: Give the cards a subtle shadow */
	display: flex; /* ADD: Use flexbox for vertical alignment inside the card */
	flex-direction: column; /* ADD: Stack content vertically */
}

/* This targets the P tag to grow and fill available space,
   pushing the button to the bottom. */
.dashboard-card p {
	flex-grow: 1; 
}

.dashboard-card h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 0;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--color-border);
}

.admin-actions .button {
    margin-right: 10px;
    margin-top: auto; /* Pushes the button to the bottom of the card */
}

.admin-sub-nav {
    display: flex;
    gap: 20px;
    margin-top: -10px;
    margin-bottom: 20px;
}
.d-flex { display: flex; }
.align-items-center { align-items: center; }

/* Responsive for smaller screens - No changes here, this is correct */
@media (max-width: 900px) {
    .dashboard-grid {
        grid-template-columns: 1fr; /* Stack the columns into a single column */
    }
}

.admin-sub-nav {
    margin-top: -10px; /* Pull it up closer to the header */
    margin-bottom: 20px;
}
.admin-sub-nav a {
    font-size: 0.9em;
    font-weight: 500;
}

/*
=================================================================
    7. BLOG & COMMENT STYLES
=================================================================
*/

/* --- Blog Index Page --- */

.post-list {
    margin-top: 40px;
}
.post-card {
    background-color: var(--color-white);
    padding: 30px;
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    margin-bottom: 30px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    transition: box-shadow 0.2s ease-in-out, transform 0.2s ease-in-out;
}
.post-card:hover {
    box-shadow: var(--box-shadow);
    transform: translateY(-4px);
}
.post-card h2 {
    margin-bottom: 5px;
}
.post-card h2 a {
    color: var(--color-primary);
    text-decoration: none;
}
.post-card h2 a:hover {
    color: var(--color-accent);
}
.post-meta {
    font-size: 0.9em;
    color: var(--color-primary-light);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 5px;
}
.meta-separator {
    margin: 0 8px;
    color: var(--color-border);
}
.post-excerpt p {
    margin-bottom: 20px;
}
.read-more-button {
    font-weight: 500;
}
.read-more-button .fas {
    margin-left: 5px;
    transition: transform 0.2s ease-in-out;
}
.read-more-button:hover .fas {
    transform: translateX(4px);
}
.no-content-card {
    background: var(--color-white);
    padding: 40px;
    text-align: center;
    border-radius: var(--border-radius);
    border: 1px solid var(--color-border);
    font-style: italic;
}

/* --- Comment Section --- */
.post-divider {
    border: none;
    border-top: 1px solid var(--color-border);
    margin: 60px 0;
}
.comment-section h3 {
    text-align: center;
    font-size: 1.8em;
    margin-bottom: 30px;
}
.comment-list {
    margin-top: 30px;
}
.comment {
    display: flex;
    gap: 20px;
    margin-bottom: 25px;
    padding-bottom: 25px;
    border-bottom: 1px solid var(--color-border);
}
.comment:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}
.comment-author .fa-user-circle {
    font-size: 3em;
    color: var(--color-border);
}
.comment-author strong {
    font-family: var(--font-primary);
}
.comment-body p {
    margin: 0;
}
#comment-form {
    max-width: 100%; /* Overrides the narrower form-container width for this instance */
}
.post-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--color-border);
}
.nav-previous, .nav-next {
    flex-basis: 48%;
}
.nav-next {
    text-align: right;
}
.post-navigation a {
    display: inline-block;
    padding: 10px;
    border: 1px solid transparent;
    text-decoration: none;
    border-radius: var(--border-radius);
    color: var(--color-primary-light);
}
.post-navigation a:hover {
    color: var(--color-accent);
    border-color: var(--color-border);
}
.nav-arrow {
    font-size: 1.5em;
    font-weight: bold;
}
.nav-title-text {
    display: inline-block;
    vertical-align: middle;
    margin: 0 10px;
}
.nav-title-text small {
    display: block;
    font-size: 0.8em;
    color: var(--color-primary-light);
    margin-bottom: 4px;
}

/*
=================================================================
    8. LEDGER STYLES
=================================================================
*/

.admin-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 15px;
}
.admin-header-row h1 {
    margin: 0;
}

.admin-grid-two-col {
    display: grid;
    grid-template-columns: 1fr 2fr; /* Form is 1 part, table is 2 parts wide */
    gap: 30px;
}

/* Responsive for smaller screens */
@media (max-width: 900px) {
    .admin-grid-two-col {
        grid-template-columns: 1fr; /* Stack the columns */
    }
}

.tax-year-selector {
    display: flex;
    align-items: center;
    gap: 10px;
}
.tax-year-selector label {
    font-weight: 500;
}
.tax-year-selector select {
    padding: 5px;
    border-radius: 4px;
    border: 1px solid var(--color-border);
}

.dashboard-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}
.summary-card {
    background-color: var(--color-white);
    padding: 20px;
    border-radius: var(--border-radius);
    text-align: center;
}
.summary-card h4 {
    margin: 0 0 10px 0;
    color: var(--color-primary-light);
}
.summary-card .figure {
    font-size: 2em;
    font-weight: 700;
    font-family: var(--font-primary);
}
.figure.income, .figure.profit {
    color: var(--color-accent);
}
.figure.expense, .figure.loss {
    color: #dc3545; /* Bootstrap danger red */
}

/* Generic status tags for the transaction table */
.status-income, .status-expense {
    color: var(--color-white);
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.8em;
    font-weight: 500;
    text-transform: capitalize;
}

.status-income {
    background-color: var(--color-accent);
}

.status-expense {
    background-color: #6c757d; /* A neutral gray for expenses */
}

/* Align amounts to the right and color them */
.amount-cell {
    text-align: right;
    font-weight: bold;
    font-family: var(--font-primary);
}
.amount-cell.income {
    color: var(--color-accent);
}
.amount-cell.expense {
    color: #dc3545; /* Bootstrap danger red */
}
.report-section {
    background-color: var(--color-white);
    padding: 20px;
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    margin-top: 30px;
}
.report-item {
    display: flex;
    justify-content: space-between;
    padding: 15px;
    border-bottom: 1px solid #f0f0f0;
}
.report-item:last-child {
    border-bottom: none;
}
.report-item.total {
    border-top: 2px solid var(--color-primary);
    margin-top: 15px;
    padding-top: 15px;
    font-size: 1.1em;
}
.report-figure {
    font-family: var(--font-primary);
    font-weight: 500;
}

.status-tag {
    background-color: #e9ecef;
    color: #495057;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.8em;
    font-weight: 500;
}

.actions-cell .action-link {
    margin-right: 10px;
}

.comment-content {
    margin-bottom: 5px;
    padding: 10px;
    background-color: var(--color-bg-light);
    border-radius: 4px;
    border: 1px solid var(--color-border);
}
.comment-meta {
    font-size: 0.8em;
    color: var(--color-primary-light);
}

/* Small, colored buttons for the admin actions */
.button-small-confirm {
    padding: 5px 10px;
    font-size: 0.85em;
    background-color: var(--color-accent);
}
.button-small-confirm:hover {
    background-color: var(--color-accent-hover);
}
.button-small-danger {
    padding: 5px 10px;
    font-size: 0.85em;
    background-color: #dc3545; /* Bootstrap danger red */
}
.button-small-danger:hover {
    background-color: #c82333; /* Darker red */
}

/*
=================================================================
    9. PROJECTS STYLES
=================================================================
*/

.action-link {
    display: inline-block;
    margin: 0 5px;
    color: var(--color-primary-light);
    text-decoration: none;
}
.action-link:hover {
    color: var(--color-accent);
}

.action-link-danger {
    background: none;
    border: none;
    padding: 0;
    color: #dc3545;
    text-decoration: none;
    cursor: pointer;
    font-family: inherit;
    font-size: inherit;
    margin: 0 5px;
}
.action-link-danger:hover {
    color: #a71d2a;
}

/*
=================================================================
    9.1 PPROJECTS GALLERY STYLES
=================================================================
*/

.project-gallery-grid {
    display: grid;
    /* Create responsive columns: 
       - On small screens, it will be 1 column.
       - On medium screens, it will grow to 2.
       - On large screens, it will be 3 columns.
    */
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

a.project-card-link {
    text-decoration: none;
    color: inherit;
}

.project-card {
    background: var(--color-white);
    border-radius: var(--border-radius);
    overflow: hidden; /* This keeps the image corners rounded */
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.project-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.project-card-image {
    width: 100%;
    /* Keep a consistent aspect ratio for all images */
    aspect-ratio: 16 / 9; 
    background-color: var(--color-bg-light);
}

.project-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* This makes the image fill the box without stretching */
}

.project-card-content {
    padding: 25px;
    display: flex;
    flex-direction: column;
    flex-grow: 1; /* Allows the content to fill the remaining card height */
}

.project-card-content h3 {
    margin-top: 0;
    font-size: 1.3em;
    color: var(--color-primary);
}

.project-card-content p {
    font-size: 0.95em;
    flex-grow: 1; /* Pushes the button to the bottom */
}

.view-project-btn {
    margin-top: auto; /* Aligns to the bottom */
    color: var(--color-accent);
    font-weight: bold;
    font-family: var(--font-primary);
}

.view-project-btn .fas {
    margin-left: 5px;
    transition: transform 0.2s ease-in-out;
}

.project-card:hover .view-project-btn .fas {
    transform: translateX(5px);
}

/*
=================================================================
    8. SINGLE POST & CASE STUDY STYLES (COMBINED)
=================================================================
*/

/* Container styles for both single blog posts and single projects */
.post-view-page,
.project-view-page {
    max-width: 900px;
    margin: 0 auto;
    background-color: var(--color-white);
    padding: 40px;
    border-radius: var(--border-radius);
    border: 1px solid var(--color-border);
}

/* Header styles for both */
.post-header,
.project-header {
    text-align: center;
    border-bottom: 1px solid var(--color-border);
    margin-bottom: 40px;
    padding-bottom: 20px;
}

.post-header h1,
.project-header h1 {
    font-size: 3em;
    margin-bottom: 15px;
}

/* --- THIS IS THE KEY FIX --- */
/*
  We create ONE set of rules for the main content body.
  By listing both selectors separated by a comma, we apply these
  styles to both the blog post page and the project case study page.
  This is the DRY principle in action.
*/
.post-content,
.project-content {
    font-size: 1.1em;
    line-height: 1.7;
}

.post-content h2, .post-content h3,
.project-content h2, .project-content h3 {
    margin-top: 2em;
    margin-bottom: 1em;
}

.post-content p,
.project-content p {
    margin-bottom: 1.5em;
}

.post-content a,
.project-content a {
    text-decoration: underline;
}

.post-content blockquote,
.project-content blockquote {
    border-left: 4px solid var(--color-accent);
    padding-left: 20px;
    margin: 2em 0;
    font-style: italic;
    color: var(--color-primary-light);
}

.post-content pre[class*="language-"],
.project-content pre[class*="language-"] {
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    margin-bottom: 1.5em;
}


/* === Styles specific ONLY to the Project Case Study page === */
.project-short-desc {
    font-size: 1.2em;
    color: var(--color-primary-light);
    margin-top: 10px;
}

.project-links {
    margin-top: 30px;
    display: flex;
    justify-content: center;
    gap: 15px;
}
.project-links .button .fas, .project-links .button .fab {
    margin-right: 8px;
}
.project-gallery-slideshow {
    margin-bottom: 40px;
}
/* (You already have .gallery-image-grid and .gallery-image-item from the last step) */
.image-caption {
    text-align: center;
    font-size: 0.9em;
    font-style: italic;
    margin-top: 8px;
    color: var(--color-primary-light);
}

.button-small {
    padding: 5px 10px;
    font-size: 0.85em;
}

.button-small .fas {
    margin-right: 5px;
}

/*
=================================================================
    10. AI CHATBOT WIDGET STYLES
=================================================================
*/

#chatbot-button {
    position: fixed;
    bottom: 25px;
    right: 25px;
    width: 60px;
    height: 60px;
    background-color: var(--color-primary);
    border-radius: 50%;
    box-shadow: var(--box-shadow);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 999;
    border: 2px solid var(--color-white);
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}
#chatbot-button:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
}

/* The main tooltip bubble */
#chatbot-button::before {
    /* This text will be dynamically set by JavaScript */
    content: attr(data-tooltip);
    position: absolute;
    /* Position it to the left of the button */
    right: 80px; 
    top: 50%;
    transform: translateY(-50%);
    padding: 8px 14px;
    background-color: var(--color-primary);
    color: var(--color-white);
    border-radius: var(--border-radius);
    font-size: 0.9em;
    font-weight: 500;
    font-family: var(--font-primary);
    white-space: nowrap;
    box-shadow: var(--box-shadow);
    
    /* Animation: Make it fade in and out */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease-in-out, visibility 0.2s ease-in-out;
    pointer-events: none; /* The tooltip itself shouldn't be clickable */
}

/* The small triangular pointer */
#chatbot-button::after {
    content: '';
    position: absolute;
    /* Position it between the button and the tooltip bubble */
    right: 70px;
    top: 50%;
    transform: translateY(-50%);
    border-width: 6px;
    border-style: solid;
    border-color: transparent transparent transparent var(--color-primary);

    /* Animation */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease-in-out, visibility 0.2s ease-in-out;
    pointer-events: none;
}

/* Show the tooltip and the pointer when the user hovers over the button */
#chatbot-button:hover::before,
#chatbot-button:hover::after {
    opacity: 1;
    visibility: visible;
}

#chatbot-button img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
}
#chatbot-window {
    position: fixed;
    bottom: 100px;
    right: 25px;
    width: 370px;
    height: 500px;
    max-height: calc(100vh - 120px);
    background: var(--color-white);
    border-radius: var(--border-radius);
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    border: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 1000;
    transition: opacity 0.3s ease, transform 0.3s ease;
}
#chatbot-window.hidden {
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
}
.chatbot-header {
    background: var(--color-primary);
    color: var(--color-white);
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    font-family: var(--font-primary);
}
.chatbot-header .header-text {
    display: flex;
    align-items: center;
    gap: 10px;
}
.chatbot-header img {
    height: 30px;
    width: 30px;
    border-radius: 50%;
    border: 1px solid var(--color-white);
}
.chatbot-close {
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s;
}
.chatbot-close:hover {
    opacity: 1;
}
#chatbot-welcome-bar {
    padding: 8px 15px;
    background-color: var(--color-bg-light);
    text-align: center;
    font-size: 0.85em;
    color: var(--color-primary-light);
    border-bottom: 1px solid var(--color-border);
    flex-shrink: 0;
}
#chatbot-messages {
    flex-grow: 1;
    overflow-y: auto;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.chatbot-message {
    padding: 10px 14px;
    border-radius: 12px;
    line-height: 1.5;
    max-width: 85%;
}
.chatbot-message.model {
    background-color: var(--color-bg-light);
    align-self: flex-start;
    border-top-left-radius: 4px;
}
.chatbot-message.user {
    background-color: var(--color-accent);
    color: var(--color-white);
    align-self: flex-end;
    border-top-right-radius: 4px;
}
.chatbot-message.error {
    background-color: var(--color-error-bg);
    color: var(--color-error-text);
}

/* "Thinking..." animation */
.chatbot-message.thinking span {
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: currentColor;
    border-radius: 50%;
    opacity: 0.4;
    animation: thinking-blink 1.4s infinite both;
}
.chatbot-message.thinking span:nth-child(2) {
    animation-delay: 0.2s;
}
.chatbot-message.thinking span:nth-child(3) {
    animation-delay: 0.4s;
}
@keyframes thinking-blink {
    0%, 80%, 100% {
        transform: scale(0);
    } 40% {
        transform: scale(1.0);
    }
}


.chatbot-input-area {
    display: flex;
    border-top: 1px solid var(--color-border);
    padding: 10px;
    flex-shrink: 0;
    align-items: center;
}
#chatbot-input {
    flex-grow: 1;
    border: 1px solid transparent;
    padding: 8px;
    border-radius: var(--border-radius);
    background: transparent;
}
#chatbot-input:focus {
    outline: none;
    border-color: var(--color-border);
}
.chatbot-input-area button {
    background: var(--color-accent);
    color: var(--color-white);
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    margin-left: 10px;
    cursor: pointer;
    transition: background-color 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
}
.chatbot-input-area button:hover {
    background: var(--color-accent-hover);
}

/* --- Mobile Responsive Chatbot --- */
@media (max-width: 768px) {
    #chatbot-window {
        width: 100%;
        height: 70%;
        max-height: 70vh;
        bottom: 0;
        right: 0;
        border-radius: 12px 12px 0 0;
        transform-origin: bottom center;
    }
    #chatbot-window.hidden {
        transform: translateY(100%);
        opacity: 1;
    }
    #chatbot-button {
        bottom: 15px;
        right: 15px;
    }
}

.ai-response-box {
    background: #f8f9fa;
    border: 1px solid var(--color-border);
    padding: 15px;
    border-radius: var(--border-radius);
    white-space: pre-wrap; /* Allows text to wrap */
    word-wrap: break-word;
    font-size: 0.9em;
}

/*
=================================================================
    11. PAGINATION STYLES
=================================================================
*/
.pagination {
    margin-top: 40px;
    display: flex;
    justify-content: center;
}
.pagination ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    border-radius: var(--border-radius);
    overflow: hidden;
    border: 1px solid var(--color-border);
}
.pagination li {
    display: block;
}
.pagination a, .pagination span {
    display: block;
    padding: 10px 15px;
    text-decoration: none;
    color: var(--color-primary);
    background: var(--color-white);
    border-right: 1px solid var(--color-border);
}
.pagination li:last-child a, .pagination li:last-child span {
    border-right: none;
}
.pagination a:hover {
    background-color: var(--color-bg-light);
}
.pagination .active span {
    background-color: var(--color-accent);
    color: var(--color-white);
    font-weight: bold;
}
.pagination .disabled span {
    color: #ccc;
    background: var(--color-bg-light);
}

/*
=================================================================
    12. SWIPER SLIDESHOW STYLES
=================================================================
*/

.swiper {
    width: 100%;
    /* Set a max height to prevent huge images from breaking the layout */
    max-height: 500px; 
    border-radius: var(--border-radius);
    margin-bottom: 10px; /* Space between slider and caption */
}
.swiper-slide {
    text-align: center;
    background: var(--color-bg-light);
    display: flex;
    justify-content: center;
    align-items: center;
}
.swiper-slide img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain; /* Use 'contain' to see the whole image without cropping */
}

/* Style the navigation arrows to match our brand */
.swiper-button-next,
.swiper-button-prev {
    color: var(--color-accent) !important; /* Use !important to override Swiper's default inline styles */
}
/* Style the pagination dots */
.swiper-pagination-bullet-active {
    background: var(--color-accent) !important;
}

.current-receipt {
    font-size: 0.9em;
    margin-bottom: 8px;
}
.current-receipt a {
    font-weight: bold;
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr; /* Intro column is narrower */
    gap: 50px;
    align-items: center;
}
.profile-photo {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 20px;
    border: 3px solid var(--color-white);
    box-shadow: var(--box-shadow);
}
.social-links {
    margin-top: 25px;
    display: flex;
    gap: 20px;
}
.social-links a {
    text-decoration: none;
    font-weight: 500;
}

/* Responsive for smaller screens */
@media (max-width: 900px) {
    .contact-grid {
        grid-template-columns: 1fr; /* Stack the columns */
    }
}