:root{
    --primary-color: #0095ff;
    --primary-color-text: rgb(255, 255, 255);
    --primary-color-text-secondary: #ffffffa3;
    
    --background-color-sidebar: #ffffff;
    
    --background-color-content: #f8f9fa;
    --card-header-background: #eeeeee;
    --card-text-color-dark: #555555;
    --card-text-color-light: #999999;
}

body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--background-color-content);
    min-width: 390px;
}
.banner {
    background-color: var(--primary-color);
    color: var(--primary-color-text);
    text-align: left;
    padding: 20px;
    margin-bottom: 0px;
    display: flex; 
    overflow: hidden;
    align-items: center; /* Vertically center items */
    justify-content: space-between; /* Push title and web-info to ends */
}

.banner h1 {
    margin: 0;
    font-size: 2.3rem;
}

.banner p {
    margin: 5px 0 0 0;
    font-size: 1.1rem;
    color: var(--primary-color-text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%; /* Ensure it respects container width */
}

.fa-github{
    color: var(--primary-color-text);
    text-decoration: none;
    font-size: 3rem;
    padding-bottom: 10px;
}

.contact-email{
    margin-bottom: 5px;
}

.contact-email a{
    color: var(--primary-color-text);
}

.web-copyright{
    color: var(--primary-color-text-secondary);
    font-size: 0.7rem;
    margin-bottom: 5px; /* Add small space above icon */
    text-align: right;
    text-decoration: none;
}
.web-copyright a{
    color: var(--primary-color-text-secondary);
}

.container {
    display: flex;
}

.sidebar {
    min-width: 240px;
    max-width: 250px;
    background-color: var(--background-color-sidebar);
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.sidebar-filters {
    padding: 0px 20px;
    overflow-y: auto;
    flex-grow: 1;
}

.sidebar h2 {
    padding: 0px 20px;
    margin-top: 10px;
    margin-bottom: 5px;
}

.search-container {
    margin: 15px 20px;
    position: relative;
}

#searchInput {
    padding: 12px 20px;
    font-size: 16px;
    border: 2px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
    width: 100%;
}

#searchInput:focus {
    outline: none;
    border-color: var(--primary-color);
}

#product-counter {
    margin-left: 20px;
    top: 50%;
    color: #aaa;
    font-size: 14px;
    text-align: left;
    pointer-events: none;
}

.product-card.hidden {
    display: none !important;
}

.search-highlight {
    background-color: #ffeb3b;
    font-weight: bold;
    padding: 2px 0;
}

.filter {
    margin-bottom: 20px;
    padding-right: 30px;
    min-width: 43%;
    display: inline-table;
}

.filter label {
    display: block;
    font-weight: bold;
    margin-bottom: 10px;
}

.filter input[type="checkbox"],
.filter input[type="radio"] {
    margin-right: 10px;
}

.content {
    flex: 1;
    padding: 20px;
}

.products {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.product-card {
    perspective: 1000px;
    margin-bottom: 20px;
    min-height: 440px;
    max-width: 370px;
    min-width: 300px;
}

.product-card .card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition-property: transform;
    transition-duration: 0.5s;
    transition-delay: 0.1s;
    transition-timing-function: ease-in-out;
}

.product-card .card-inner:hover {
    transform: rotateY(180deg);
}

.card-front,
.card-back {
    border-radius: 8px;
    background-color: var(--background-color-sidebar);
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
    position: absolute;
    overflow: hidden;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    box-sizing: border-box;
}

.card-back {
    transform: rotateY(180deg);
}

.card-header {
    width: 100%;
    text-align: center;
    background-color: var(--card-header-background);
    display: flex;
    flex-direction: column;
    padding-top: 10px
}

.card-front .card-header {
    max-height: 80px;
} 

.card-header h3{
    font-size: 1.2rem;
    font-weight: bold;
    margin: 10px 5px 5px 5px;
    text-align: center;
}

.card-front .card-header h3{
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.card-header .card-subheading{
    font-size: 1rem;
    color: var(--card-text-color-light);
    margin-bottom: 10px;
}
.card-image {
    padding: 10px 10px;
    display: flex;
    flex: 1;
    height: 170px;
    justify-content: center;
    align-items: center;
}

.card-image img {
    max-width: 100%;
    max-height: 170px;
}

.card-links,
.card-attributes {
    display: flex;
    flex-wrap: wrap-reverse;
    align-content: flex-end;
    align-items: flex-end;
    gap: 4px;
    font-size: smaller;
    color: var(--card-text-color-dark);
    padding-top: 10px;
    padding-bottom: 5px;
    padding-left: 8px;
    padding-right: 8px;
}

.card-back .card-links{
    text-align: center;
    margin-right: auto;
    margin-top: auto;
}

.card-link,
.card-attr {
    margin: 0;
    float: left;
    margin-right: 10px;
    margin-bottom: 2px;
}

.card-link a {
    text-decoration: none;
    color: var(--primary-color);
}

.card-summary {
    font-size: 0.9rem;
    flex: 1;
    margin: 5px 30px 0px 30px;
    color: var(--card-text-color-dark);
    overflow: hidden;
}

.card-data-access{
    margin-top: 10px;
    font-size: 0.9rem;
    text-align: left;
    color: var(--card-text-color-dark);
    font-weight: bold;
}

.card-details{
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow-y: auto;
    padding: 10px 10px;
    row-gap: 15px;
}

.card-detail{
    font-size: 0.9rem;
    text-align: left;
    color: var(--card-text-color-dark);
}

.card-detail-title{
    font-weight: bold;
    font-size: 1rem;
}

.footer {
    position: relative; /* Change from sticky */
    bottom: 0;
    left: 0; /* Add this */
    width: 100%;
    min-height: 130px;
    background-color: var(--primary-color);
    color: var(--primary-color-text);
    padding-top: 10px;
    padding-bottom: 10px;
    font-size: 0.8rem;
    margin-top: 0px;
    z-index: 10;
    display: flex;
    flex-direction: column; /* Stack child elements vertically */
    align-items: center;
    justify-content: center;
}

.footer .submit{
    color: var(--primary-color-text);
    text-decoration: underline;
    font-size: 1.1rem;
    margin-bottom: 20px;
    margin-top: 10px
}

/* Hide toggle button on desktop by default */
.sidebar-toggle-wrapper {
    display: none;
}
.web-spacer {
    flex-grow: 1; /* This will push the copyright to the bottom */
}

@media (max-width: 680px) {
    .container {
        flex-direction: column;
    }

    /* Show toggle button on mobile */
    .sidebar-toggle-wrapper {
        display: block;
        width: 100%;
        padding: 15px;
        background-color: #f1f1f1;
        box-sizing: border-box;
    }

    #toggle-filters-btn {
        width: 100%;
        padding: 12px;
        background-color: var(--primary-color);
        color: var(--primary-color-text);
        border: none;
        border-radius: 4px;
        font-size: 1rem;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
    }

    #toggle-filters-btn:hover {
        background-color: var(--primary-color);
    }

    /* Hide sidebar by default on mobile */
    .sidebar {
        display: none;
        width: 100%;
        max-width: 100%;
        height: auto;
        position: relative;
    }
    
    /* Show sidebar when active */
    .sidebar.active {
        display: flex;
    }
}