/* Import heart icons styles */
@import url('heart-icons.css');

/* --- Banner Size Variables --- */
:root {
    /* Banner Sizes (Large) */
    --banner-profile-large-width: calc(2 * var(--card-width) + var(--product-col-gap));
    --banner-main-large-width: calc(6 * var(--card-width) + 5 * var(--product-col-gap));
    --banner-group-height-large: 200px;

    /* Banner Sizes (Small) */
    --banner-profile-small-width: var(--card-width);
    --banner-main-small-width: calc(3 * var(--card-width) + 2 * var(--product-col-gap));
    --banner-group-height-small: 100px;
    
    /* Banner Colors */
    --banner-bg-light: #e9ecef;       /* Neutral Light Gray Banner BG */
    --banner-bg-dark: #4a4a4a;        /* Neutral Dark Gray Banner BG */
}

/* Apply theme variables */
body {
    --banner-bg: var(--banner-bg-light);
}

body.dark-mode {
    --banner-bg: var(--banner-bg-dark);
}

/* --- Banner Group --- */
.banner-group {
    display: grid;
    grid-template-columns: var(--banner-profile-large-width) var(--banner-main-large-width);
    grid-template-areas: "profile main";
    row-gap: var(--gap);
    column-gap: var(--product-col-gap);
    height: var(--banner-group-height-large);
    margin-bottom: var(--gap);
    max-width: var(--grid-max-width); /* Match the product grid max width */
    margin-left: auto;
    margin-right: auto;
}

/* Removed specific styling for banner products to use product.css styles instead */

.banner-creator-profile,
.banner-main {
    border: 1px solid var(--border-color);
    box-sizing: border-box;
    background-color: var(--banner-bg); /* Use neutral banner background */
    box-shadow: var(--shadow);
    transition: background-color 0.3s ease, border-color 0.3s ease, width 0.3s ease, height 0.3s ease;
    background-size: cover;
    background-position: center;
    border-radius: var(--border-radius);
    overflow: hidden;
}

/* Banner creator profile layout using grid structure */
.banner-creator-profile {
    grid-area: profile;
    height: auto;
    min-height: 180px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background-color: var(--card-bg);
    box-shadow: var(--shadow);
    display: grid;
    grid-template-columns: 80px 1fr;
    grid-template-rows: auto auto 1fr;
    grid-template-areas:
        "profile title"
        "profile social"
        "likes likes";
    padding: 0;
    overflow: hidden;
}

.banner-creator-info {
    grid-area: title;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: var(--text-color);
    font-family: var(--font-family);
    padding-left: var(--small-gap);
    padding-right: var(--small-gap);
    line-height: 1.1;
}

.banner-creator-info h1 {
    margin: 0;
    background: linear-gradient(45deg, var(--header-grad-1), var(--header-grad-2), var(--header-grad-1));
    background-size: 200% 200%;
    color: transparent;
    -webkit-background-clip: text;
    background-clip: text;
    animation: gradient-animation 5s ease infinite;
    font-size: 28px;
    font-weight: 700;
    text-align: center;
    font-family: var(--font-family);
    letter-spacing: 0;
    text-transform: uppercase;
}

.banner-creator-info h2 {
    margin: 0;
    color: var(--text-color);
    font-size: 14px;
    font-weight: normal;
    line-height: 1.4;
    text-align: center;
    font-family: var(--font-family);
}

.banner-creator-avatar {
    grid-area: profile;
    overflow: hidden;
    aspect-ratio: 160/220;
    border: 1px solid var(--border-color);
    background-color: var(--card-bg);
    margin: 0;
    width: 80px;
    height: 110px;
    aspect-ratio: 160/220;
}

.banner-creator-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.banner-creator-social {
    grid-area: social;
    padding: 0 var(--small-gap);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: var(--small-gap);
}

.social-icons {
    display: flex;
    gap: var(--small-gap);
    justify-content: center;
    flex-wrap: wrap;
}

.social-icons a {
    display: block;
}

.social-icons img {
    width: 18px;
    height: 18px;
}


/* Light theme (default) - black icons */
.social-icon {
    filter: brightness(0) saturate(0);
}

/* Dark theme - white icons */
.dark-mode .social-icon {
    filter: brightness(0) saturate(0) invert(1);
}

.banner-creator-stats {
    grid-area: likes;
    padding: var(--small-gap);
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    margin-top: auto;
    gap: 3px;
    height: 80px; /* Set defined height based on layout calculation */
}

.banner-creator-stats .heart-icon {
    color: var(--text-color);
    font-size: 25px;
    cursor: pointer;
    font-weight: normal;
    display: flex;
    align-items: center;
    margin-bottom: 5px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.banner-creator-stats .banner-stat {
    font-size: 14px;
    line-height: 1.3;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text-color);
    margin-bottom: 2px;
}

/* Both product count and total likes now use the same font size (14px) */

.banner-creator-stats .banner-likes-count {
    display: inline-block;
    color: #000000; /* Black text on yellow background */
    font-weight: bold;
}

.banner-main {
    grid-area: main;
    height: var(--banner-group-height-large);
}

.banner-main img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Ensure image covers the entire container */
    display: block;
}

#bannerList {
    margin-bottom: calc(10 * var(--gap));
}

.banner-tag-cloud {
    max-height: 70px;
    position: relative; /* Establishes a containing block for the absolutely positioned trigger */
    overflow: clip; 
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: var(--gap);
    padding: var(--gap);
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    transition: max-height 0.3s ease-out;
}

.banner-tag-cloud.collapsed {
    max-height: 70px;
    overflow: hidden; 
}

.banner-tag-cloud.expanded {
    max-height: 1000px; 
    overflow: visible;
}

.show-more-tags-trigger {
    position: absolute;
    bottom: 0; 
    left: 0;
    width: 100%;
    height: 25px; 
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85em;
    font-weight: bold;
    cursor: pointer;
    z-index: 10; 
    border-top: 1px solid transparent; 
    box-sizing: border-box;
    transition: opacity 0.3s ease-in-out;
    -webkit-font-smoothing: antialiased; 
    -moz-osx-font-smoothing: grayscale;
}

.show-more-tags-trigger {
    backdrop-filter: blur(5px); 
    -webkit-backdrop-filter: blur(5px);
    color: #2c3e50; 
    border-top-color: rgba(0, 0, 0, 0.15); 
}

body.dark-mode .show-more-tags-trigger {
    backdrop-filter: blur(5px); 
    -webkit-backdrop-filter: blur(5px);
    color: #f8f8f2; 
    border-top-color: rgba(255, 255, 255, 0.18); 
}

.banner-tag-cloud.expanded .show-more-tags-trigger {
    opacity: 0;
    pointer-events: none; 
}

.show-more-tags-trigger:focus-visible {
    outline: 2px solid var(--primary-accent-color, #007bff);
    outline-offset: 2px;
}

.banner-tag-cloud .product-tag {
    background-color: var(--highlight);
    color: var(--text-color);
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    white-space: nowrap;
    display: inline-block;
    margin: 2px;
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.banner-tag-cloud .product-tag:hover {
    transform: scale(1.05);
    background-color: var(--primary);
    color: white;
    cursor: pointer;
}

.banner-top-section {
    display: contents; /* Allow children to be placed by grid */
}

.banner-content-wrapper {
    margin-bottom: var(--card-width);
}

/* Media Query for Small Banner Layout */
@media (max-width: 900px) { /* Match the grid-max-width breakpoint */
    .banner-group {
        height: var(--banner-group-height-small);
        grid-template-columns: repeat(auto-fill, minmax(var(--card-width), var(--card-width)));
        justify-content: center;
        grid-template-areas: "profile main";
    }
    
    .banner-creator-profile {
        height: var(--banner-group-height-small);
        min-height: var(--banner-group-height-small);
        max-height: var(--banner-group-height-small);
        min-width: var(--banner-group-height-small);
        max-width: var(--banner-group-height-small);
        display: flex;
        justify-content: center;
        align-items: center;
        padding: 0;
        overflow: hidden; /* Hide any overflow content */
    }
    
    /* Hide all elements except heart icon in mobile view */
    .banner-creator-profile .banner-creator-avatar,
    .banner-creator-profile .banner-creator-info,
    .banner-creator-profile .banner-creator-social,
    .banner-creator-profile .banner-creator-stats > :not(.heart-icon) {
        display: none;
    }
    
    .banner-creator-stats {
        border-top: none;
        width: 100%;
        height: 100%;
        display: flex;
        justify-content: center;
        align-items: center;
        margin: 0;
        padding: 0;
    }
    
    .banner-creator-stats .heart-icon {
        margin: 0;
        font-size: 30px;
        display: flex;
        justify-content: center;
        align-items: center;
        width: 100%;
    }
    
    .banner-main {
        width: var(--banner-main-small-width);
        height: var(--banner-group-height-small);
    }
    
    .banner-main img {
        object-fit: cover; /* Ensure image covers the entire container */
    }
    
    /* Hide tag cloud on smaller screens */
    .banner-tag-cloud {
        display: none !important;
    }
}

/* Extra small screens */
@media (max-width: 480px) {
    .banner-creator-profile {
        min-height: var(--banner-group-height-small);
    }
    

    .banner-group {
        height: var(--banner-group-height-small);
        grid-template-areas: "profile main main main";
    }
    
    .banner-creator-profile {
        min-height: var(--banner-group-height-small);
    }
    
    .banner-main {
        height: var(--banner-group-height-small) !important;
    }
}
