/* Library Styles */

.brand-library-container {
    font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
    color: #0B1220;
}

/* Grid - Matching platform responsive grid */
.brand-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 16px;
    padding: 16px 0;
}

@media (max-width: 1400px) {
    .brand-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}

@media (max-width: 1200px) {
    .brand-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .brand-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 600px) {
    .brand-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Masonry Item / Card - Matching platform card style */
.brand-masonry-item {
    background: #fff;
    border: 1px solid #E2E4EA;
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 2px 8px rgba(17,24,39,0.06);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.brand-masonry-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(17,24,39,0.12);
}

.brand-img-wrap {
    position: relative;
    width: 100%;
    background: #F3F4F6;
    overflow: hidden;
    aspect-ratio: 1;
}

/* Scope height to Pexels/Pixabay/MyMedia only, avoiding AI Image section issues */
#pexels .brand-img-wrap,
#pixabay .brand-img-wrap,
#media-library-images .brand-img-wrap {
    height: 160px;
}

#media-library-images .brand-img-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
}

.brand-img-wrap img {
    width: 90%;
    height: 90%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

.brand-masonry-item:hover .brand-img-wrap img {
    transform: scale(1.05);
}

.brand-masonry-item-desc {
    padding: 12px 14px;
    font-size: 13px;
    font-weight: 500;
    color: #0B1220;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    background: #fff;
    border-top: 1px solid #E2E4EA;
}

/* Search Box & Controls */
.brand-search-box {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* Form Fields - Matching platform .input */
 

/* Selects */
.brand-select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235F6A7A' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 32px;
}
 

.brand-btn:hover {
    background: #F6F8FF;
}

.brand-btn.primary {
    background: linear-gradient(90deg, #3E5BFF, #4C6FFF);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 8px 18px rgba(76,111,255,0.28);
}

.brand-btn.primary:hover {
    box-shadow: 0 14px 28px rgba(76,111,255,0.34);
    transform: translateY(-1px);
}

.brand-btn.primary:active {
    transform: translateY(0);
}

/* Section Spacing */
.teams-section {
    margin-top: 0px;
}

/* Card Headers */
.teams-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding-bottom: 0px;
    border-bottom: 1px solid #E2E4EA;
    margin-bottom: 0px;
}

.teams-card-title h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #0B1220;
}

/* Pexels/Pixabay Overlays */
#pexels-search-options, #pixabay-search-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.pexels-url, .pixabay-url {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
    color: white;
    background: rgba(11, 18, 32, 0.6);
    backdrop-filter: blur(4px);
    border-radius: 50%;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    opacity: 0;
    transition: opacity 0.2s, background 0.2s;
}

.pexels-url:hover, .pixabay-url:hover {
    background: rgba(11, 18, 32, 0.8);
}

.brand-masonry-item:hover .pexels-url, 
.brand-masonry-item:hover .pixabay-url {
    opacity: 1;
}

.pexels-url .material-icons, .pixabay-url .material-icons {
    font-size: 16px;
}

/* Tabs */
.brand-tabs-menu {
    display: flex;
    gap: 8px;
    list-style: none;
    padding: 0;
    margin: 0 0 20px 0;
}

.brand-tabs-menu li {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 999px;
    color: #5F6A7A;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    font-weight: 500;
}

.brand-tabs-menu li:hover {
    background: #F2F5FF;
    color: #4C6FFF;
}

.brand-tabs-menu li.active {
    background: linear-gradient(90deg, #EEF2FF 0%, #E9EDFF 100%);
    color: #4C6FFF;
    font-weight: 600;
    box-shadow: 0 6px 14px rgba(76,111,255,0.18);
}

.brand-tab {
    display: none;
    animation: fadeIn 0.3s ease;
}

.brand-tab.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Hero Styles - Adapted from templates.php */
.templates-hero-root .templates-hero-card {
    padding: 0;
    overflow: hidden;
    max-height: 400px;
    border-radius: 16px; /* Ensure rounded corners */
}

.templates-hero-root .templates-hero-inner {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0,1.05fr) minmax(0,.95fr);
    gap: 22px;
    padding: 22px 22px;
    background: linear-gradient(135deg, rgba(124,58,237,.14), rgba(59,130,246,.12), rgba(6,182,212,.10));
    border: 1px solid rgba(15, 23, 42, .06);
    max-height: 400px;
}

.templates-hero-root .templates-hero-inner::before {
    content: "";
    position: absolute;
    inset: -120px -80px auto auto;
    width: 420px;
    height: 420px;
    background: radial-gradient(circle at 30% 30%, rgba(124,58,237,.24), rgba(124,58,237,0) 60%);
    filter: blur(4px);
    pointer-events: none;
}

.templates-hero-root .templates-hero-inner::after {
    content: "";
    position: absolute;
    inset: auto auto -160px -120px;
    width: 520px;
    height: 520px;
    background: radial-gradient(circle at 40% 40%, rgba(6,182,212,.20), rgba(6,182,212,0) 62%);
    filter: blur(6px);
    pointer-events: none;
}

.templates-hero-root .templates-hero-left {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    min-width: 0;
}

.templates-hero-root .templates-hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(255,255,255,.75);
    border: 1px solid rgba(15, 23, 42, .06);
    backdrop-filter: blur(10px);
    font-weight: 900;
    letter-spacing: .02em;
    font-size: .78rem;
    color: rgba(15, 23, 42, .75);
    max-width: 68ch;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.templates-hero-root .templates-hero-title {
    margin: 0;
    font-weight: 950;
    letter-spacing: -.03em;
    line-height: 1.08;
    font-size: clamp(1.55rem, 2.1vw + 1rem, 2.05rem);
    color: rgba(15, 23, 42, .92);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.templates-hero-root .templates-hero-subtitle {
    font-weight: 750;
    color: rgba(15, 23, 42, .68);
    font-size: clamp(.95rem, .7vw + .78rem, 1.02rem);
    line-height: 1.45;
    max-width: 58ch;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.templates-hero-root .templates-hero-ctas {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 6px;
}

.templates-hero-root .templates-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 12px;
    font-weight: 950;
    letter-spacing: .01em;
    text-decoration: none;
    user-select: none;
    transition: transform .16s ease, box-shadow .16s ease, background .16s ease, border-color .16s ease;
}

.templates-hero-root .templates-cta:focus-visible {
    outline: 0;
    box-shadow: 0 0 0 3px rgba(92, 144, 255, .35), 0 18px 50px rgba(10, 20, 30, .14);
}

.templates-hero-root .templates-cta-primary {
    color: #fff;
    background: linear-gradient(135deg, #7c3aed, #3b82f6, #06b6d4);
    box-shadow: 0 18px 48px rgba(10, 20, 30, .16);
}

.templates-hero-root .templates-cta-secondary {
    color: rgba(15, 23, 42, .86);
    background: rgba(255,255,255,.76);
    border: 1px solid rgba(15, 23, 42, .08);
    backdrop-filter: blur(10px);
}

.templates-hero-root .templates-cta:hover {
    transform: translateY(-1px);
    box-shadow: 0 26px 70px rgba(10, 20, 30, .16);
}

.templates-hero-root .templates-hero-pills {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 6px;
}

.templates-hero-root .templates-pill {
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(255,255,255,.66);
    border: 1px solid rgba(15, 23, 42, .06);
    font-weight: 850;
    font-size: .78rem;
    color: rgba(15, 23, 42, .68);
    backdrop-filter: blur(10px);
    cursor: pointer;
    appearance: none;
}

.templates-hero-root .templates-pill:hover {
    background: rgba(255,255,255,.82);
}

.templates-hero-root .templates-pill:focus-visible {
    outline: 0;
    box-shadow: 0 0 0 3px rgba(92, 144, 255, .35);
}

.templates-hero-root .templates-hero-right {
    position: relative;
    z-index: 1;
    min-width: 0;
}

.templates-hero-root .templates-preview-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    align-items: stretch;
    height: 100%;
}

.templates-hero-root .templates-preview-card {
    position: relative;
    border-radius: 18px;
    overflow: hidden;
    background: rgba(255,255,255,.84);
    border: 1px solid rgba(15, 23, 42, .06);
    box-shadow: 0 18px 48px rgba(10, 20, 30, .10);
    transform: translateZ(0);
    transition: transform .18s ease, box-shadow .18s ease;
}

.templates-hero-root .templates-preview-card:hover {
    transform: translateY(-4px) scale(1.01);
    box-shadow: 0 30px 78px rgba(10, 20, 30, .16);
}

.templates-hero-root .templates-preview-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(20, 22, 30, .55);
    backdrop-filter: blur(10px);
    color: #fff;
    font-weight: 900;
    font-size: .74rem;
    letter-spacing: .02em;
    z-index: 2;
}

.templates-hero-root .templates-preview-img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    aspect-ratio: 1/1;
}

.templates-hero-root .th-float-1 { animation: thFloat 7.2s ease-in-out infinite; }
.templates-hero-root .th-float-2 { animation: thFloat 8.1s ease-in-out infinite; animation-delay: -1.6s; }
.templates-hero-root .th-float-3 { animation: thFloat 7.6s ease-in-out infinite; animation-delay: -3.0s; }
.templates-hero-root .th-float-4 { animation: thFloat 8.6s ease-in-out infinite; animation-delay: -2.2s; }

@keyframes thFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@media (prefers-reduced-motion: reduce) {
    .templates-hero-root .th-float-1, .templates-hero-root .th-float-2, .templates-hero-root .th-float-3, .templates-hero-root .th-float-4 { animation: none; }
    .templates-hero-root .templates-cta, .templates-hero-root .templates-preview-card { transition: none; }
}

@media (max-width: 980px) {
    .templates-hero-root .templates-hero-card { max-height: none; }
    .templates-hero-root .templates-hero-inner { grid-template-columns: 1fr; gap: 16px; padding: 18px; max-height: none; }
    .templates-hero-root .templates-hero-title { font-size: 1.85rem; }
    .templates-hero-root .templates-preview-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 520px) {
    .templates-hero-root .templates-hero-title { font-size: 1.65rem; }
    .templates-hero-root .templates-preview-grid { grid-template-columns: 1fr; }
}

#pexels-menu {
    display: flex;
     margin-bottom: 5px;
}

#pixabay-menu {
    display: flex;
    margin-bottom: 5px;
}

/* Icon Grid - High density for icons */
.brand-grid.icon-grid {
    grid-template-columns: repeat(7, minmax(0, 1fr));
}

@media (min-width: 1600px) {
    .brand-grid.icon-grid {
        grid-template-columns: repeat(8, minmax(0, 1fr));
    }
}

@media (max-width: 1400px) {
    .brand-grid.icon-grid {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }
}

@media (max-width: 1200px) {
    .brand-grid.icon-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}
