@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap');

/* General Page Styling */
html {
  box-sizing: border-box;
}
*, *:before, *:after {
  box-sizing: inherit;
}

body {
    font-family: 'Poppins', sans-serif; /* Change to your preferred font */
    line-height: 1.6;
    margin: 0;
    padding: 0;
    background-color: #f8f9fa;
}

.container {
    max-width: 1700px;
    margin: 0 auto;
    padding: 20px;
}

.center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 60vh; /* Helps vertically center the content */
}

h1, h2, h3 {
    font-weight: 400;
}

/* Table Styling */
.wp-list-table {
    border-collapse: collapse;
    width: 100%;
    border-radius: 10px; /* Rounded corners for the table */
    overflow: hidden; /* Hide excess content from rounded corners */
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); /* Subtle shadow */
}

.wp-list-table th, .wp-list-table td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
}

.wp-list-table th {
    background-color: #f5f5f5;
}

.wp-list-table tr:nth-child(even) {
    background-color: #f9f9f9;
}

.existing-prompt tr:nth-child(even) {
    padding-bottom: 15px;
}

/* Button Styling */
.button {
    display: inline-block;
    padding: 8px 16px;
    background-color: #2596be; /* Blue background */
    font-weight: bold;
    color: white;
    text-decoration: none;
    border: none;
    border-radius: 5px; /* Rounded corners */
    cursor: pointer;
    transition: background-color 0.3s ease; /* Smooth transition on hover */
}

.button:hover {
    background-color: #0069d9; /* Darker blue on hover */
}

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

/* Flashed Messages Styling */
.flashes {
    list-style: none;
    padding: 0;
    margin: 0 0 20px 0;
}
.alert {
    padding: 15px;
    margin-bottom: 15px;
    border: 1px solid transparent;
    border-radius: 4px;
    color: #31708f;
    background-color: #d9edf7;
    border-color: #bce8f1;
}
/* Pagination Styling */
.pagination {
    list-style: none;
    padding: 0;
    margin: 20px 0;
    display: flex;
    justify-content: center;
}

.pagination li {
    margin: 0 5px;
}

.pagination a {
    display: inline-block;
    padding: 5px 10px;
    border: 1px solid #ccc;
    text-decoration: none;
    color: #333;
    border-radius: 5px; /* Rounded corners */
}

.pagination .active span {
    background-color: #eee;
    font-weight: bold;
    border-radius: 5px; /* Rounded corners */
}

/* Banner styling */
.banner {
    background-color: lightblue;
    padding: 2px;
    padding-left: 15px;
    padding-right: 15px;
    border-radius: 15px;
}

/* Header styling */
.poppins-thin {
    font-family: "Poppins", sans-serif;
    font-weight: 100;
    font-style: normal;
  }

/* --- Modern Header --- */
.main-header {
    background-color: #ffffff;
    border-bottom: 1px solid #e9ecef;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
    height: 70px; /* Set a consistent height */
}

.main-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.logo-link img {
    max-height: 40px; /* Control logo size */
    width: auto;
}

/* Desktop Navigation */
/* Use direct child selector '>' to target only the top-level ul */
.main-nav > ul {
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
}

.main-nav li {
    position: relative; /* For dropdown positioning */
    margin: 0 10px;
}

.main-nav a {
    display: block;
    padding: 15px 10px;
    color: #343a40;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease-in-out;
}

.main-nav a:hover,
.main-nav li.active > a {
    color: #007bff;
}

.main-nav li.active > a {
    font-weight: 700;
}

/* Dropdown Menu */
.dropdown-menu {
    display: block; /* Use opacity/visibility for transitions */
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #fff;
    min-width: 220px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border-radius: 5px;
    padding: 10px 0;
    list-style: none;
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}

/* Helper class to align dropdown to the right */
.dropdown-menu-right {
    left: auto;
    right: 0;
}

.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu a {
    padding: 10px 20px;
    font-weight: 400;
    white-space: nowrap;
}

.dropdown-menu a:hover {
    background-color: #f8f9fa;
}

.dropdown .fa-caret-down {
    margin-left: 5px;
    font-size: 0.8em;
}

/* Disable Bootstrap's default dropdown arrow since we use a FontAwesome icon */
.main-nav .dropdown-toggle::after {
    display: none;
}

/* Hamburger Menu Button */
#hamburger-menu {
    display: none;
    border: none;
    background-color: transparent;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 1002;
    color: #343a40;
}

/* Mobile Overlay */
.nav-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 998;
}

.nav-overlay.show {
    display: block;
}


.tile {
    text-align: center; /* Center text within the tile */
    color: #fff;
    background-color: #2596be; /* Blue background color (same as your nav) */
    border-radius: 10px; /* Adjust the value for desired roundness */
    padding: 20px; /* Add some padding for better visual spacing */
    margin: 10px; /* Add margin to separate tiles */
}

.nav-button {
    color: #fff;
}

.navigation-tiles {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
}

.quick-links-container {
    background-color: #e9ecef;
    border-radius: 10px;
    padding: 20px;
}
/* Media query for smaller screens */
@media (max-width: 992px) {
    #hamburger-menu {
        display: block;
    }

    .main-nav {
        position: fixed;
        top: 0;
        right: 0;
        width: 300px;
        height: 100vh;
        background-color: #fff;
        box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
        transform: translateX(100%);
        transition: transform 0.3s ease-in-out;
        z-index: 999;
        overflow-y: auto;
    }

    .main-nav.show {
        transform: translateX(0);
    }

    .main-nav ul {
        flex-direction: column;
        align-items: flex-start;
        padding: 20px 0;
    }

    .main-nav li {
        width: 100%;
        margin: 0;
    }

    .main-nav a {
        padding: 15px 20px;
        width: 100%;
        transition: background-color 0.2s ease-in-out;
        border-bottom: 1px solid #f1f1f1;
    }

    /* Mobile Dropdowns */
    .dropdown-menu {
        position: static;
        display: none; /* Use display none/block for mobile toggle */
        box-shadow: none;
        border-radius: 0;
        border-bottom: 1px solid #f1f1f1;
        width: 100%;
        transform: none;
        opacity: 1;
        visibility: visible;
        padding: 0;
        background-color: #f8f9fa;
    }

    /* Show dropdown menu when parent has .open class */
    .dropdown.open > .dropdown-menu {
        display: block;
    }

    /* Style the open dropdown toggle for better feedback */
    .dropdown.open > a {
        background-color: #e9ecef;
    }

    /* Animate the caret icon on open/close */
    .dropdown.open > a .fa-caret-down {
        transform: rotate(180deg);
    }
}

/* form styling */
input[type="text"],
input[type="password"],
input[type="url"],
textarea {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-sizing: border-box;
    font-size: 16px;
}

/* --- Login Form --- */
.login {
    background: #fff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
    margin-top: 1rem;
    text-align: left;
}

.login .button {
    width: 100%;
    padding: 12px;
    font-size: 16px;
}

#metabase-modal {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place over the content */
    z-index: 1001; /* Sit on top */
    left: 0;
    top: 0;
    width: 100%; /* Full width */
    height: 100%; /* Full height */
    overflow: auto; /* Enable scroll if needed */
    background-color: rgba(0,0,0,0.5); /* Semi-transparent black background */
    padding-top: 60px;
}

#metabase-modal .modal-content {
    width: 95vw; /* 95% of the viewport width */
    max-width: 2000px; /* Optional maximum width */
    margin: 10vh auto; /* Center vertically */
    padding: 20px;
    /* border: 1px solid #ccc; */
    border-radius: 5px;
    background-color: lightblue; 
}

.metabase-reports-container {
    display: flex; /* Enable flexbox layout */
}

.metabase-reports-container iframe {
    width: 100%; 
    height: 600px; /* Adjust height as needed */
    border: none; /* Remove default iframe border */
}

/* --- Product Details Page --- */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #dee2e6;
}

.page-header h2 {
    margin: 0;
}

.page-header a {
    text-decoration: none;
    color: #007bff;
}
.page-header a:hover {
    text-decoration: underline;
}
.page-header .fa-external-link-alt {
    font-size: 0.8em;
    margin-left: 5px;
}

.product-detail-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 30px;
    align-items: start; /* Aligns items at the start of the grid area */
}

.product-gallery {
    position: sticky;
    top: 90px; /* 70px header + 20px padding */
    min-width: 0; /* Prevents the slick carousel from overflowing its grid container */
    overflow: hidden; /* Clips the carousel content, forcing it to scroll internally */
}

@media (max-width: 1200px) {
    .product-detail-grid {
        grid-template-columns: 1fr;
    }
    .product-gallery {
        position: static; /* Disable sticky on mobile */
        padding-right: 0; /* Remove padding on mobile */
    }
}

.product-gallery .main-product-image img {
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    margin-bottom: 15px;
}

.thumbnail-carousel {
    /* This prevents the carousel from expanding its container, fixing the responsive issue on mobile */
    max-width: 100%;
}

.thumbnail-carousel .thumbnail {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 5px;
    cursor: pointer;
    margin: 0 5px;
    border: 2px solid transparent;
    transition: border-color 0.2s;
}

.thumbnail-carousel .thumbnail:hover,
.thumbnail-carousel .slick-current .thumbnail {
    border-color: #007bff;
}

.card {
    background-color: #fff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.03);
}

.detail-heading {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.2rem;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.editable-field {
    border: 1px solid #ced4da;
    padding: 10px;
    border-radius: 5px;
    min-height: 40px;
    margin-bottom: 10px;
    background-color: #fdfdff;
}
.editable-field:focus {
    outline: none;
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,.25);
}
.scrollable-field {
    max-height: 200px; /* Approx 8 lines */
    overflow-y: auto;
    resize: vertical;
}

.form-section {
    background-color: #fff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}
.form-section legend {
    font-weight: 600;
    padding: 0 10px;
    font-size: 1.2rem;
}
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 10px;
}
.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}
.form-group select, .form-group input {
    width: 100%;
    padding: 8px;
    border-radius: 5px;
    border: 1px solid #ced4da;
}
.checkbox-group label {
    margin-right: 10px;
    font-weight: normal;
    display: inline-flex;
    align-items: center;
}

.checkbox-group input[type="checkbox"] {
    margin-right: 5px; /* Add space between checkbox and text */
}
.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
}
.table-container {
    overflow-x: auto;
}
.action-column {
    width: 100px;
    text-align: center;
}

/* --- Bid Adjustment Rules --- */
.rule-item .action-increase {
    color: #28a745; /* A nice green */
    font-weight: bold;
}
.rule-item .action-decrease {
    color: #dc3545; /* A nice red */
    font-weight: bold;
}

/* --- General Layout Helpers --- */
.flex-container {
    display: flex;
    gap: 30px; /* Space between columns */
}
.flex-container > .column {
    flex: 1; /* Each column takes equal space */
}
@media (max-width: 768px) {
    .flex-container {
        flex-direction: column;
    }
}

/* --- Filter Forms --- */
.filter-form {
    background-color: #e9ecef;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}
.filter-form label {
    font-weight: 500;
}
.filter-form input[type="date"] {
    padding: 8px;
    border-radius: 5px;
    border: 1px solid #ced4da;
}

/* --- Simple Forms (like bulk rescrape) --- */
.simple-form {
    background-color: #fff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    max-width: 600px;
}

.simple-form .form-group {
    margin-bottom: 1.5rem;
}

.simple-form label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.simple-form select,
.simple-form textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 16px;
}

/* Settings Page - AI Endpoints Table */
.card .table {
    margin-bottom: 0; /* Remove default bottom margin from Bootstrap table inside a card */
}

.card .table th {
    background-color: #f8f9fa; /* Lighter header background */
    border-bottom-width: 2px;
    font-weight: 600; /* Bolder headers */
    color: #495057;
}

.card .table-hover tbody tr:hover {
    background-color: #e9ecef; /* Subtle hover effect */
}

.card .table td, .card .table th {
    vertical-align: middle; /* Center content vertically */
}

.card .table .badge {
    font-size: 0.85em;
    padding: 0.4em 0.7em;
}

.card .table .btn-sm {
    margin-right: 5px;
}