:root {
    /* Glui Brand Colors */
    --glui-pink-primary: #C93A76;
    --glui-orange-primary: #E58248;
    --glui-purple-primary: #887DF7;
    --glui-green-primary: #75D1A8;
    --glui-magenta-primary: #AD4898;
    
    --glui-pink-light: #F8EAF5;
    --glui-orange-light: #FDF2EB;
    --glui-purple-light: #EFECFE;
    --glui-green-light: #EAF9F3;
    --glui-magenta-light: #F3D9E7;
    
    --glui-pink-dark: #AE2D5D;
    --glui-orange-dark: #CB7240;
    --glui-purple-dark: #5B50AD;
    --glui-green-dark: #509B79;
    --glui-magenta-dark: #993F87;
    
    /* Neutral Colors */
    --glui-text-primary: #1A202C;
    --glui-text-secondary: #4A5568;
    --glui-bg-light: rgba(255, 255, 255, 0.4);
    --glui-bg-card: rgba(255, 255, 255, 0.3);
    --glui-border: rgba(0, 0, 0, 0.1);
    --glui-border-light: rgba(0, 0, 0, 0.08);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #F8F9FA;
    min-height: 100vh;
    padding: 20px;
}

.container {
    margin: 0 auto;
    display: flex;
    gap: 20px;
    width: 100%;
}

.sidebar {
    width: 280px;
    background: var(--glui-bg-light);
    backdrop-filter: blur(15px);
    border-radius: 20px;
    border: 1px solid var(--glui-border);
    padding: 20px;
    height: fit-content;
    position: sticky;
    top: 20px;
    flex-shrink: 0;
}

.sidebar-header {
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.sidebar-header-content {
    flex: 1;
}

.sidebar-toggle {
    background: none;
    border: none;
    color: var(--glui-text-secondary);
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.2s ease;
    margin-left: 10px;
}

.sidebar-toggle:hover {
    background: var(--glui-border-light);
    color: var(--glui-purple-primary);
}

.sidebar-toggle i {
    font-size: 14px;
    transition: transform 0.3s ease;
}

.sidebar.collapsed .sidebar-toggle i {
    transform: rotate(180deg);
}

.sidebar-content {
    overflow: hidden;
    transition: max-height 0.4s ease, opacity 0.3s ease;
    max-height: 1000px;
    opacity: 1;
}

.sidebar.collapsed .sidebar-content {
    max-height: 0;
    opacity: 0;
}

.sidebar-title {
    color: var(--glui-text-primary);
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.sidebar-title i {
    margin-right: 8px;
    color: var(--glui-purple-primary);
}

.sidebar-subtitle {
    color: var(--glui-text-secondary);
    font-size: 0.9rem;
    opacity: 0.8;
}

.main-content {
    flex: 1;
    min-width: 0;
}

.header {
    text-align: center;
    margin-bottom: 40px;
    background: var(--glui-bg-light);
    backdrop-filter: blur(10px);
    padding: 30px;
    border-radius: 20px;
    border: 1px solid var(--glui-border);
}

.header h1 {
    color: #1A202C;
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 10px;
}

.header h1 i {
    margin-right: 12px;
}

.header p {
    color: var(--glui-text-secondary);
    font-size: 1.1rem;
}

.filter-section {
    margin-bottom: 20px;
}

.filter-section-title {
    color: #6B7280;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 12px;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: color 0.2s ease;
}

.filter-section-title .chevron {
    transition: transform 0.2s ease;
    color: #9CA3AF;
}

.filter-section.collapsed .chevron {
    transform: rotate(-90deg);
}

.filter-options {
    display: flex;
    flex-direction: column;
    gap: 0;
    width: 100%;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.filter-section.collapsed .filter-options {
    max-height: 0;
}



.filter-option {
    padding: 12px 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    font-weight: 400;
    color: var(--glui-text-primary);
    user-select: none;
    background: none;
    border: none;
    position: relative;
    text-align: left;
    width: 100%;
}

.filter-option:hover {
    background: #F4F4F5;
}

.filter-option.active {
    background: var(--glui-purple-light);
    font-weight: 600;
    color: var(--glui-purple-primary);
}

.filter-option.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--glui-purple-primary);
}

.search-box {
    width: 100%;
    margin-bottom: 25px;
    position: relative;
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--glui-text-secondary);
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 12px 16px 12px 40px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: #F1F3F5;
    color: var(--glui-text-primary);
    font-size: 14px;
    box-sizing: border-box;
    transition: border-color 0.2s ease;
}

.search-input::placeholder {
    color: var(--glui-text-secondary);
}

.search-input:focus {
    outline: none;
    border-color: var(--glui-purple-primary);
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

@media (min-width: 1400px) {
    .grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width: 1024px) and (max-width: 1399px) {
    .grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 767px) {
    .grid {
        grid-template-columns: 1fr;
    }
}

.ad-card {
    background: #FFFFFF;
    border-radius: 12px;
    padding: 0;
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.ad-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--glui-pink-primary), var(--glui-orange-primary), var(--glui-purple-primary), var(--glui-green-primary));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.ad-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.ad-card:hover .ad-preview-image::after {
    opacity: 1;
}

.ad-preview-image {
    width: 100%;
    height: 200px;
    background: #EFECFE;
    border-radius: 12px 12px 0 0;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #4A5568;
    font-size: 14px;
    font-weight: 500;
    padding: 5%;
}

.ad-preview-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(136, 125, 247, 0.1);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.ad-preview-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.ad-content {
    padding: 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.ad-header {
    margin-bottom: 8px;
}

.ad-info {
    flex: 1;
}

.ad-brand {
    color: #4A5568;
    font-size: 12px;
    font-weight: 400;
    margin-bottom: 2px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.ad-title {
    color: #1A202C;
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 4px 0;
    line-height: 1.2;
}

.ad-format {
    color: #4A5568;
    font-size: 12px;
    font-weight: 400;
}

.device-indicators {
    display: flex;
    gap: 4px;
    margin-bottom: 8px;
}

.device-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    background: var(--glui-purple-light);
    padding: 3px 6px;
    border-radius: 8px;
    font-size: 0.65rem;
    font-weight: 500;
    color: var(--glui-text-primary);
}

.device-indicator i {
    font-size: 0.7rem;
}

.device-indicator.mobile {
    background: var(--glui-green-light);
    color: var(--glui-green-dark);
}

.device-indicator.desktop {
    background: var(--glui-orange-light);
    color: var(--glui-orange-dark);
}

.device-indicator.universal {
    background: var(--glui-magenta-light);
    color: var(--glui-magenta-dark);
}

.capability-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: auto;
    padding-top: 8px;
}

.capability-tag {
    background: var(--glui-purple-dark);
    color: #FFFFFF;
    padding: 2px 6px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.2px;
}

.capability-tag.interactive {
    background: #CB7240;
    color: #FFFFFF;
}

.capability-tag.responsive {
    background: var(--glui-green-dark);
    color: #FFFFFF;
}

.capability-tag.multilang {
    background: var(--glui-magenta-dark);
    color: #FFFFFF;
}

.capability-tag.lead-gen {
    background: #509B79;
    color: #FFFFFF;
}

.capability-tag.gamification {
    background: #993F87;
    color: #FFFFFF;
}

.capability-tag.carousel {
    background: var(--glui-green-dark);
    color: #FFFFFF;
}

.ad-actions {
    display: flex;
    gap: 6px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--glui-border-light);
}


.preview-btn {
    flex: 1;
    padding: 8px 12px;
    border-radius: 8px;
    text-decoration: none;
    text-align: center;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: #F1F3F5;
    color: var(--glui-pink-primary);
    border: 1px solid #E2E8F0;
}

.preview-btn i {
    font-size: 0.75rem;
}

.preview-btn:hover {
    background: var(--glui-pink-primary);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px var(--glui-pink-primary);
}

.loading {
    text-align: center;
    padding: 40px;
    color: rgba(44, 62, 80, 0.8);
}

.spinner {
    display: inline-block;
    width: 30px;
    height: 30px;
    border: 3px solid rgba(44, 62, 80, 0.3);
    border-top: 3px solid #2c3e50;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 10px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@media (max-width: 1200px) {
    .sidebar {
        transition: all 0.4s ease;
    }
    
    .sidebar.auto-collapsed .sidebar-content {
        max-height: 0;
        opacity: 0;
    }
    
    .sidebar.auto-collapsed .sidebar-toggle i {
        transform: rotate(180deg);
    }
    
    .sidebar.auto-collapsed.expanded .sidebar-content {
        max-height: 1000px;
        opacity: 1;
    }
    
    .sidebar.auto-collapsed.expanded .sidebar-toggle i {
        transform: rotate(0deg);
    }
    
    .grid-row.square-row {
        grid-template-columns: 1fr 1fr;
    }
}

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

    .sidebar {
        width: 100%;
        position: static;
        margin-bottom: 20px;
    }

    .sidebar-header {
        text-align: center;
    }

    .filter-section {
        margin-bottom: 20px;
    }

    .filter-options {
        gap: 6px;
    }

    .filter-option {
        padding: 8px 10px;
        font-size: 0.85rem;
    }
}

@media (max-width: 768px) {
    body {
        padding: 8px;
    }

    .container {
        gap: 8px;
    }

    .sidebar {
        margin-bottom: 8px;
        padding: 12px;
        border-radius: 12px;
    }

    .grid {
        gap: 12px;
    }

    .header h1 {
        font-size: 2rem;
    }

    .ad-preview-image {
        height: 160px;
    }

    .ad-content {
        padding: 10px;
    }

    .ad-brand {
        font-size: 0.7rem;
    }

    .ad-title {
        font-size: 0.9rem;
    }

    .ad-format {
        font-size: 0.65rem;
    }

    .device-indicator {
        font-size: 0.6rem;
        padding: 2px 5px;
    }

    .capability-tags {
        gap: 3px;
        padding-top: 6px;
    }

    .capability-tag {
        font-size: 0.55rem;
        padding: 2px 5px;
    }

    .ad-actions {
        margin-top: 6px;
        padding-top: 6px;
        gap: 5px;
    }

    .view-full-btn {
        font-size: 0.65rem;
        padding: 5px 8px;
        gap: 3px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 4px;
    }

    .container {
        gap: 4px;
    }

    .sidebar {
        margin-bottom: 4px;
        padding: 8px;
        border-radius: 8px;
    }

    .grid {
        gap: 8px;
    }

    .ad-card {
        border-radius: 6px;
    }

    .ad-preview-image {
        height: 140px;
    }

    .ad-content {
        padding: 8px;
    }

    .ad-brand {
        font-size: 0.65rem;
    }

    .ad-title {
        font-size: 0.85rem;
    }

    .ad-format {
        font-size: 0.6rem;
    }

    .device-indicators {
        gap: 3px;
        margin-bottom: 6px;
    }

    .device-indicator {
        font-size: 0.55rem;
        padding: 2px 4px;
    }

    .capability-tags {
        gap: 2px;
        padding-top: 4px;
    }

    .capability-tag {
        font-size: 0.5rem;
        padding: 1px 4px;
    }

    .ad-actions {
        gap: 4px;
        margin-top: 4px;
        padding-top: 4px;
    }

    .view-full-btn {
        font-size: 0.6rem;
        padding: 4px 6px;
        gap: 2px;
    }
}