/* Universal Box-Sizing */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Base Body Styles */
body {
    font-family: 'Montserrat', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f4f4f4;
}

/* Top Banner Image */
.top-banner-image {
    width: 100%;
    height: 200px; /* Adjust height as needed */
    overflow: hidden; /* Ensures image doesn't overflow */
    margin-bottom: 20px;
    background-color: #eee; /* Fallback background */
    display: flex; /* Use flexbox for centering */
    justify-content: center; /* Center horizontally */
    align-items: center; /* Center vertically */
}

.top-banner-image img {
    width: 100%;
    height: 100%; /* Make image fill the div */
    object-fit: cover; /* Cover the area, cropping if necessary */
    display: block; /* Remove extra space below image */
}

/* Main Container Layout */
.container {
    display: flex; /* This is CRUCIAL for sidebars to appear next to main content */
    max-width: 1200px; /* Max width for desktop */
    margin: 0 auto; /* Center the container */
    padding: 0 20px; /* Padding on sides for smaller desktops/larger mobiles */
    gap: 20px; /* Space between columns */
}

/* Sidebar (Desktop) container styling */
.sidebar {
    flex: 0 0 250px; /* Don't grow, don't shrink, base width 250px */
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* --- Common Styling for Sidebar Content (applies to both desktop and mobile sidebar content) --- */
/* These rules target the h3, h4, ul, li, a elements directly within the sidebar containers */

.sidebar h3,
.mobile-sidebar .sidebar-content h3,
.sidebar h4,
.mobile-sidebar .sidebar-content h4 {
    margin-top: 0; /* Ensures consistent top margin regardless of context */
    color: #0056b3;
    margin-bottom: 10px;
}

.sidebar ul,
.mobile-sidebar .sidebar-content ul {
    list-style: none; /* Remove default bullet points */
    margin-bottom: 20px;
    padding-left: 0; /* Remove default ul padding to align links */
}

.sidebar ul li,
.mobile-sidebar .sidebar-content ul li {
    margin-bottom: 8px;
}

.sidebar ul li a,
.mobile-sidebar .sidebar-content ul li a {
    text-decoration: none;
    color: #555;
    padding: 5px 10px;
    display: block; /* Make the whole link area clickable */
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.sidebar ul li a:hover,
.mobile-sidebar .sidebar-content ul li a:hover,
.sidebar ul li a.active,
.mobile-sidebar .sidebar-content ul li a.active {
    background-color: #e9ecef;
    color: #0056b3;
}


/* Main Content Area */
.main-content {
    flex-grow: 1; /* Allow content to grow and take available space */
    padding: 20px; /* Default padding */
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 20px; /* Space below the main content area */
}

.main-content h1 {
    color: #0056b3;
    margin-bottom: 20px;
}

.main-content p {
    margin-bottom: 15px;
    line-height: 1.8;
}

.main-content ul {
    margin-bottom: 15px;
    padding-left: 20px; /* Keep default ul padding for main content if needed */
}

.main-content ul li {
    margin-bottom: 8px;
}

/* Add to your styles.css */
.blog-post-summary {
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 20px;
    margin-bottom: 20px;
}

.blog-post-summary h2 {
    margin-top: 0;
    font-size: 1.8em;
}

.blog-post-summary p {
    font-size: 0.95em;
    line-height: 1.6;
}

.blog-post-summary img {
    margin-top: 15px;
    margin-bottom: 15px;
    max-width: 150px; /* Adjust as needed */
    max-height: 100px; /* Adjust as needed */
    width: auto;
    height: auto;
    object-fit: cover; /* Optional: for better thumbnail cropping */
    margin-bottom: 10px; /* Add some spacing below the thumbnail */
    display: block; /* Ensures image takes full width */
}


/* Styles for single post view */
.blog-content {
    line-height: 1.7;
    font-size: 1.1em;
    margin-top: 20px;
}

.blog-content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 20px auto; /* Center images in content */
}

/* Basic form styling for admin pages - adjust to match your site's aesthetics */
.main-content form label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.main-content form input[type="text"],
.main-content form textarea,
.main-content form select {
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1em;
}

.main-content form button {
    background-color: #4CAF50; /* Green */
    color: white;
    padding: 10px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1em;
    margin-top: 10px;
}

.main-content form button:hover {
    background-color: #45a049;
}
/* Right Sidebar */
.right-sidebar {
    flex: 0 0 250px; /* Fixed width, similar to left sidebar */
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    color: #555;
}

.right-sidebar h3 {
    color: #0056b3;
    margin-top: 0;
    margin-bottom: 15px;
}

.right-sidebar hr {
    border: none;
    border-top: 1px solid #eee;
    margin: 20px 0;
}

/* Button Link Styling */
.button-link {
    display: inline-block;
    background-color: #007bff;
    color: #fff;
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 5px;
    transition: background-color 0.3s ease;
    margin-top: 20px; /* Spacing from content above */
}

.button-link:hover {
    background-color: #0056b3;
}


/* --- Mobile Menu Styles (Hamburger Icon & Off-Canvas Sidebar) --- */

.mobile-menu-toggle {
    display: none; /* Hidden by default on desktop */
    position: fixed; /* Keep it in view */
    top: 20px;
    right: 20px;
    z-index: 1000; /* Ensure it's on top */
}

.hamburger-icon {
    width: 30px;
    height: 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
}

.hamburger-icon span {
    display: block;
    width: 100%;
    height: 3px;
    background-color: #fff; /* Color of the hamburger lines */
    border-radius: 2px;
    transition: all 0.3s ease-in-out;
}

/* Hamburger icon animation for 'open' state */
.hamburger-icon.open span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}
.hamburger-icon.open span:nth-child(2) {
    opacity: 0;
}
.hamburger-icon.open span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

.mobile-sidebar {
    position: fixed;
    top: 0;
    left: -300px; /* Start off-screen */
    width: 280px; /* Width of the mobile sidebar */
    height: 100%;
    background-color: #fff; /* Explicitly set background for mobile sidebar */
    box-shadow: 2px 0 5px rgba(0,0,0,0.2);
    z-index: 999;
    transition: left 0.3s ease-in-out;
    overflow-y: auto; /* Enable scrolling if content is long */
}

.mobile-sidebar.open {
    left: 0; /* Slide in when open */
}

.mobile-sidebar .sidebar-content {
    padding: 20px; /* Padding for the inner content of the mobile sidebar */
}

/* Add to your styles.css */
.table-responsive {
    overflow-x: auto; /* Enables horizontal scrolling */
    -webkit-overflow-scrolling: touch; /* Improves scrolling performance on iOS */
    margin-bottom: 1rem; /* Add some space below the table */
}

/* Ensure tables fill their containers and have proper spacing */
.table-responsive table {
    width: 100%;
    border-collapse: collapse; /* Ensure borders collapse properly */
    margin-top: 1rem;
    margin-bottom: 1rem;
    min-width: 768px; /* Optional: Set a minimum width for the table to prevent squishing on very small screens,
                           adjust as needed based on your content */
}

.table-responsive th,
.table-responsive td {
    padding: 8px 12px; /* Adjust padding for cells */
    border: 1px solid #ddd; /* Example border */
    text-align: left; /* Default text alignment */
    white-space: nowrap; /* Prevent text wrapping in cells, allowing horizontal scroll */
}

.table-responsive th {
    background-color: #f2f2f2; /* Header background color */
    font-weight: bold;
}

/* Specific styling for metrics.php table cells if needed */
.main-content table td.positive-return {
    color: green;
    font-weight: bold;
}

.main-content table td.negative-return {
    color: red;
    font-weight: bold;
}

/* Summary row styling */
.main-content table tr.summary-row {
    background-color: #e9ecef; /* Light gray background for summary row */
    font-weight: bold;
}

.main-content table tr.summary-row td {
    border-top: 2px solid #333; /* Stronger top border for summary */
}

.main-content table td.average-days {
    /* Specific styles for average days cell if needed */
    font-style: italic;
}
/* Pagination Styling */
.pagination {
    display: flex; /* Use flexbox for horizontal alignment */
    justify-content: center; /* Center the pagination links */
    align-items: center;
    padding: 20px 0;
    gap: 15px; /* Space between items */
    flex-wrap: wrap; /* Allow items to wrap on smaller screens */
}

.pagination a,
.pagination .page-info-button {
    display: inline-block;
    padding: 10px 18px;
    border: 1px solid #007bff; /* Primary blue border */
    border-radius: 5px;
    text-decoration: none;
    color: #007bff; /* Primary blue text */
    background-color: #fff;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
    font-weight: 600;
}

.pagination a:hover {
    background-color: #007bff;
    color: #fff;
    border-color: #007bff;
}

.pagination .page-info-button {
    background-color: #e9ecef; /* A neutral background for the info button */
    color: #333;
    cursor: default; /* Not clickable */
    border-color: #ccc;
    font-weight: normal;
}

/* Media query for smaller screens if pagination buttons become too wide */
@media (max-width: 600px) {
    .pagination {
        flex-direction: column; /* Stack buttons vertically on very small screens */
        gap: 10px;
    }

    .pagination a,
    .pagination .page-info-button {
        width: 80%; /* Make buttons take more width */
        text-align: center;
    }
}
/* Media Queries for Responsiveness */

/* For screens smaller than 1024px (Typical tablet breakpoint) */
@media (max-width: 1023px) {
    .container {
        flex-direction: column; /* Stack columns vertically */
        padding: 0 15px; /* Adjust padding */
    }

    .sidebar, .right-sidebar {
        display: none; /* Hide desktop sidebars on smaller screens */
    }

    .main-content {
        margin-top: 20px; /* Add some space if no sidebar above */
        padding: 15px; /* Slightly less padding for mobile content */
        margin-bottom: 20px; /* Space below the main content area */
    }

    .mobile-menu-toggle {
        display: block; /* Show hamburger icon on mobile */
    }

    /* Adjust banner for smaller screens if needed */
    .top-banner-image {
        height: 150px;
        margin-bottom: 10px;
    }
}

/* For very small screens (e.g., old phones, adjust as needed) */
@media (max-width: 480px) {
    .top-banner-image {
        height: 100px; /* Even smaller banner */
    }
    .main-content {
        padding: 10px;
    }
}