:root {
    --bg-main: #ffffff;
    --bg-sidebar: #fafafa;
    --text-primary: #111827;
    --text-secondary: #4b5563;
    --text-muted: #9ca3af;
    --border-color: #f3f4f6;
    --primary-color: #ef4444; /* The red/pink hue from logo/buttons */
    --primary-light: #fee2e2;
    --hover-bg: #f3f4f6;
    --font-family: 'Inter', sans-serif;
    
    /* Advanced Animations */
    --transition-snappy: 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
    --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Collection background colors shown in UI */
    --col-peach: #ffece0;
    --col-blue: #e0e7ff;
    --col-green: #e0f2fe;
    --col-peach-alt: #ffe4e6;
    --col-yellow: #fef3c7;
    --col-purple: #f3e8ff;
    --col-mint: #d1fae5;
}

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

body {
    font-family: var(--font-family);
    background-color: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* App Layout */
.app-container {
    display: flex;
    min-height: 100vh;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background-color: var(--bg-main);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    height: 100vh;
    flex-shrink: 0;
    position: sticky;
    top: 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 24px;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--text-primary);
}

.logo-icon {
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    padding: 0 12px;
    gap: 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all var(--transition-snappy);
}

.nav-item:hover {
    background-color: var(--hover-bg);
    color: var(--text-primary);
}

.nav-item.active {
    background-color: var(--hover-bg);
    color: var(--text-primary);
    font-weight: 600;
}

.nav-item svg {
    color: var(--text-muted);
}

.nav-item.active svg {
    color: var(--text-primary);
}

/* Sidebar Collections List */
.sidebar-collections-container {
    flex: 1;
    overflow-y: auto;
    padding: 16px 12px;
    margin-top: 16px;
    border-top: 1px solid var(--border-color);
}

.sidebar-collections {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.collection-nav-item {
    display: flex;
    padding: 8px 12px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    border-radius: 8px;
}

.collection-nav-item:hover {
    background-color: var(--hover-bg);
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
}

.sign-in-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    width: 100%;
    padding: 8px 0;
}

.sign-in-btn:hover {
    color: var(--text-primary);
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 32px 48px;
    height: 100vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 32px;
    background-color: #ffffff;
}

/* Top Section (Header + Promo) */
.top-section {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
}

.header-text h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 12px;
    letter-spacing: -0.02em;
}

.header-text p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 24px;
    line-height: 1.6;
}

.action-buttons {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    font-family: inherit;
}

.nav-btn.primary {
    background-color: var(--primary-color);
    color: white;
}

/* Minimal Mode Overrides (For Chrome/Plugins) */
body.minimal-mode {
    background: #ffffff;
}
body.minimal-mode .sidebar {
    display: none !important;
}
body.minimal-mode .top-section {
    display: none !important;
}
body.minimal-mode .app-container {
    height: 100vh;
}
body.minimal-mode .main-content {
    padding: 12px 14px !important;
    height: 100vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}
body.minimal-mode .plugin-header {
    display: flex !important;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}
body.minimal-mode .search-container {
    max-width: 100%;
    margin: 0 0 12px 0;
    border-radius: 8px;
    background: #f4f4f5;
    border: none;
    box-shadow: inset 0 0 0 1px #e4e4e7;
    padding: 8px 12px;
    height: auto;
    align-items: center;
}
body.minimal-mode .search-icon {
    width: 16px;
    height: 16px;
    color: #52525b;
}
body.minimal-mode .search-container input {
    font-size: 13px;
    color: #18181b;
}
body.minimal-mode .plugin-category-select {
    display: block !important;
    width: 100%;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid #e4e4e7;
    background: #fafafa;
    margin-bottom: 16px;
    font-family: inherit;
    font-size: 13px;
    color: #18181b;
    outline: none;
}
body.minimal-mode .category-pills {
    display: none !important;
}
body.minimal-mode .icon-grid {
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 8px !important;
    padding: 0 !important;
}
body.minimal-mode .icon-card {
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #f1f1f3;
    box-shadow: none;
    aspect-ratio: 1/1;
    min-height: unset;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease;
}
body.minimal-mode .icon-card:hover {
    background: #f4f4f5;
    transform: none;
    box-shadow: none;
}
body.minimal-mode .icon-card svg {
    max-width: 24px;
    max-height: 24px;
}
body.minimal-mode .icon-card .icon-name {
    display: none;
}

/* Page Headers */
.page-header {
    background-color: #c93445;
}

.btn-primary {
    background-color: #de3c4f;
    color: white;
}

.btn-primary:hover {
    background-color: #c93445;
}

.btn-secondary {
    background-color: #ffeef0;
    color: #de3c4f;
}

.btn-secondary:hover {
    background-color: #fce1e4;
}

.social-proof {
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.heart {
    color: #4b5563;
    display: inline-block;
    vertical-align: middle;
}

.company-logos {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    font-size: 0.85rem;
    color: var(--text-primary);
    font-weight: 500;
}

.company-tag {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Promo Banner */
.promo-banner {
    background: linear-gradient(135deg, #2a1b4d 0%, #1a1033 100%);
    border-radius: 16px;
    padding: 24px;
    width: 320px;
    flex-shrink: 0;
    color: white;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    position: relative;
    overflow: hidden;
}

/* Subtle glow effect behind promo */
.promo-banner::before {
    content: '';
    position: absolute;
    top: -50px;
    right: -50px;
    width: 150px;
    height: 150px;
    background: radial-gradient(circle, rgba(168,85,247,0.4) 0%, rgba(0,0,0,0) 70%);
    border-radius: 50%;
    pointer-events: none;
}

.promo-content {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 8px;
}

.promo-logo {
    width: 48px;
    height: 48px;
    background-color: #10b981;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.promo-text-wrap h3 {
    font-size: 1.1rem;
    margin-bottom: 4px;
}

.promo-badge {
    background: rgba(255,255,255,0.1);
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.65rem;
    color: #c4b5fd;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stars {
    color: #fbbf24;
    font-size: 0.8rem;
    margin-bottom: 12px;
}

.promo-banner p {
    font-size: 0.85rem;
    color: #e5e7eb;
    margin-bottom: 16px;
    line-height: 1.4;
}

.btn-promo {
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    border: none;
    background: linear-gradient(90deg, #8b5cf6 0%, #d946ef 100%);
    color: white;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}

/* Search Container */
.search-container {
    display: flex;
    align-items: center;
    background-color: white;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.02);
    transition: all var(--transition-snappy);
}

.search-container:focus-within {
    border-color: #d1d5db;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.search-icon {
    color: var(--text-muted);
    margin-right: 12px;
}

.search-container input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 1rem;
    font-family: inherit;
    color: var(--text-primary);
}

.search-container input::placeholder {
    color: var(--text-muted);
}

.powered-by {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Content Area Layouts */
.content-area {
    display: grid;
    gap: 24px;
}

/* Collections Grid */
.collections-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

/* Collection Card */
.collection-card {
    border-radius: 16px;
    padding: 20px;
    cursor: pointer;
    transition: transform var(--transition-snappy), box-shadow var(--transition-snappy);
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
}

.collection-card:hover {
    transform: translateY(-4px) scale(1.01);
    box-shadow: 0 14px 28px rgba(0,0,0,0.08);
}

.collection-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.collection-title {
    font-weight: 600;
    font-size: 1.05rem;
}

.collection-count {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.collection-icons-preview {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-gap: 12px;
    background-color: rgba(255,255,255,0.4);
    border-radius: 12px;
    padding: 12px;
    flex: 1;
}

.preview-icon-box {
    aspect-ratio: 1;
    background-color: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.preview-icon-box svg {
    width: 24px;
    height: 24px;
}

/* Single Collection View Header */
/* We'll dynamically inject this into top-section */
.collection-view-header {
    max-width: 600px;
}
.collection-view-header h1 {
    font-size: 2.25rem;
    font-weight: 700;
    margin-bottom: 8px;
}
.collection-view-header p {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 24px;
}
.action-buttons-alt {
    display: flex;
    gap: 16px;
}

/* Icon Grid (when viewing a collection) */
.icon-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 16px;
}

.icon-item {
    background-color: white;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1;
    cursor: pointer;
    transition: all var(--transition-snappy);
    position: relative;
    overflow: hidden;
    animation: fadeInScale 0.4s var(--transition-snappy) backwards;
}

@keyframes fadeInScale {
    0% { opacity: 0; transform: scale(0.9) translateY(10px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

.icon-item:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 12px 24px rgba(0,0,0,0.08);
    border-color: #d1d5db;
    z-index: 10;
}

.icon-item.selected {
    border-color: #fca5a5;
    background-color: #fef2f2;
}

.icon-item svg {
    width: 28px;
    height: 28px;
    transition: transform 0.2s ease;
}

.icon-item:hover svg {
    transform: scale(1.1);
}

/* Sub-actions on hover (Copy, Save) */
.icon-quick-actions {
    position: absolute;
    bottom: -12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    background: white;
    border: 1px solid #fca5a5;
    border-radius: 6px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 10;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.icon-item.selected .icon-quick-actions {
    opacity: 1;
    pointer-events: auto;
}

.icon-quick-actions button {
    background: none;
    border: none;
    font-size: 0.65rem;
    padding: 4px 8px;
    cursor: pointer;
    color: var(--text-secondary);
}

.icon-quick-actions button:hover {
    background: #fef2f2;
    color: var(--primary-color);
}

.icon-quick-actions button + button {
    border-left: 1px solid #fca5a5;
}

/* Popover for Icon Details */
.icon-popover-wrapper {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1), 0 0 0 1px rgba(252, 165, 165, 0.5); /* subtle pink border */
    display: flex;
    padding: 0;
    z-index: 100;
    overflow: hidden;
    animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slideUp {
    from { opacity: 0; transform: translate(-50%, 20px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

.popover-icon-preview {
    background-color: #fafafa;
    border-right: 1px dashed #e5e7eb;
    padding: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 140px;
}

.popover-icon-preview svg {
    width: 64px;
    height: 64px;
}

.popover-details {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 450px;
}

.popover-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.popover-title-area h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.popover-title-area p {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.popover-title-area p a {
    color: var(--text-primary);
    text-decoration: underline;
    text-decoration-color: #d1d5db;
}

.popover-actions-top button {
    background: #f3f4f6;
    border: none;
    border-radius: 6px;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin-left: 8px;
    color: var(--text-secondary);
}

.popover-actions-top button:hover {
    background: #e5e7eb;
}

.popover-controls {
    display: flex;
    gap: 12px;
    align-items: center;
}

.select-wrapper {
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 0.85rem;
    background: #fafafa;
    cursor: pointer;
}

.color-input-wrapper {
    display: flex;
    align-items: center;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 4px 8px;
    background: #fafafa;
    gap: 8px;
    position: relative;
}

.color-input-wrapper input[type="text"] {
    border: none;
    background: transparent;
    width: 70px;
    font-size: 0.85rem;
    outline: none;
}

.color-swatch {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    background: black;
}

.btn-icon {
    border: 1px solid var(--border-color);
    background: white;
    border-radius: 6px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.popover-downloads {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.dl-btn {
    border: none;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
}

.dl-btn.primary {
    background: #de3c4f;
    color: white;
}

.dl-btn.secondary {
    background: #ffeef0;
    color: #de3c4f;
}

.dl-btn.secondary:hover {
    background: #fce1e4;
}

/* Integration Landing Pages */
.integration-view-header {
    text-align: center;
    padding: 60px 20px 40px;
    max-width: 800px;
    margin: 0 auto;
}

.integration-icon-hero {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 96px;
    height: 96px;
    background: var(--primary-light);
    border-radius: 24px;
    margin-bottom: 24px;
    box-shadow: 0 10px 25px rgba(222, 60, 79, 0.15);
}

.integration-view-header h1 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 16px;
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, #111827 0%, #4b5563 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.integration-view-header p {
    font-size: 1.25rem;
    color: var(--text-secondary);
    line-height: 1.6;
    max-width: 600px;
    margin: 0 auto;
}

.integration-features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: auto auto;
    gap: 24px;
    margin-top: 24px;
}

.integration-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 32px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0,0,0,0.02);
}

.integration-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.06);
    border-color: #d1d5db;
}

.int-icon-wrap {
    width: 48px;
    height: 48px;
    background: #f3f4f6;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.integration-card h3 {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 12px;
}

.integration-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.5;
}

.integration-hero-image {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 24px;
    border: 1px solid var(--border-color);
    padding: 64px 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 24px;
    overflow: hidden;
    position: relative;
    min-height: 300px;
}

.mockup-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.5);
    padding: 40px 60px;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.08);
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-secondary);
}

/* Animations */
/* Enhanced Global Animations */
.fade-in {
    animation: fadeIn 0.6s var(--transition-snappy);
}

.fade-in-up {
    animation: fadeInUp 0.7s var(--transition-snappy);
}

.zoom-in {
    animation: zoomIn 0.8s var(--transition-snappy);
}

@keyframes fadeIn {
    from { opacity: 0; filter: blur(4px); }
    to { opacity: 1; filter: blur(0); }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); filter: blur(4px); }
    to { opacity: 1; transform: translateY(0); filter: blur(0); }
}

@keyframes zoomIn {
    from { opacity: 0; transform: scale(0.94) translateY(20px); filter: blur(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); filter: blur(0); }
}

/* Animations & Responsiveness */
@media (max-width: 1024px) {
    .top-section {
        flex-direction: column;
    }
    .promo-banner {
        width: 100%;
        max-width: 400px;
    }
}

@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        height: auto;
        position: static;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }
    .sidebar-collections-container {
        max-height: 200px;
    }
    .main-content {
        padding: 24px;
        height: auto;
    }
    .icon-popover-wrapper {
        width: calc(100% - 32px);
        left: 16px;
        transform: none;
        flex-direction: column;
        animation: slideUpMobile 0.3s forwards;
    }
    @keyframes slideUpMobile {
        from { opacity: 0; transform: translateY(20px); }
        to { opacity: 1; transform: translateY(0); }
    }
    .popover-icon-preview {
        width: 100%;
        border-right: none;
        border-bottom: 1px dashed #e5e7eb;
        padding: 16px;
    }
    .popover-details {
        min-width: 0;
    }
    .icon-grid {
        grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    }
}
