:root {
    --bg-primary: #1f1f1f;
    --bg-secondary: #2d2d2d;
    --bg-hover: #3a3a3a;
    --bg-active: #404040;
    --text-primary: #ffffff;
    --text-secondary: #b3b3b3;
    --text-tertiary: #8a8a8a;
    --border-color: #3f3f3f;
    --accent-primary: #7160e8;
    --accent-secondary: #5b4fc4;
    --sidebar-width: 280px;
    --header-height: 56px;
    --breakpoint: 768px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    overflow-x: hidden;
}

/* Mobile Header */
.mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background-color: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    align-items: center;
    padding: 0 12px;
    gap: 12px;
    z-index: 1000;
}

.header-title {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    font-size: 16px;
    font-weight: 600;
}

/* Sidebar */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background-color: var(--bg-primary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    z-index: 999;
    transition: transform 0.3s ease, width 0.3s ease;
}

.sidebar.collapsed {
    width: 60px;
}

.sidebar.collapsed .brand-text,
.sidebar.collapsed .nav-item span,
.sidebar.collapsed .nav-item-small,
.sidebar.collapsed .nav-section-header,
.sidebar.collapsed .nav-section-subheader,
.sidebar.collapsed .user-name {
    display: none;
}

.sidebar.collapsed .nav-item,
.sidebar.collapsed .user-profile {
    justify-content: center;
    padding-left: 8px;
    padding-right: 8px;
}

.sidebar.collapsed .brand-toggle {
    justify-content: center;
    padding: 8px 12px 8px 0px;
    border-radius: 6px;
}

.sidebar.collapsed .brand-toggle:hover {
    background-color: var(--bg-hover);
}

.sidebar.collapsed .brand-logo {
    display: block;
}

.sidebar.collapsed .brand-sidebar-icon {
    display: none;
}

/* Show sidebar icon on hover only when collapsed */
.sidebar.collapsed .brand-toggle:hover .brand-logo {
    display: none;
}

.sidebar.collapsed .brand-toggle:hover .brand-sidebar-icon {
    display: block;
}

/* Hide toggle button when collapsed */
.sidebar.collapsed .sidebar-toggle-btn {
    display: none;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    height: var(--header-height);
    border-bottom: 1px solid var(--border-color);
}

.brand-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 600;
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 0;
    transition: all 0.2s;
}

.brand-sidebar-icon {
    display: none;
    width: 24px;
    height: 24px;
    filter: brightness(0) invert(1);
}

.brand-text {
    white-space: nowrap;
}

/* Sidebar Navigation */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}

.sidebar-nav::-webkit-scrollbar {
    width: 6px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background-color: var(--bg-hover);
    border-radius: 3px;
}

.nav-section {
    margin-bottom: 8px;
}

.nav-section-header {
    padding: 12px 16px 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.nav-section-subheader {
    padding: 8px 16px 4px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.nav-item, .nav-item-small {
    width: calc(100% - 16px);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    margin: 2px 8px;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
    border-radius: 8px;
    position: relative;
}

.nav-item-small {
    padding: 8px 24px;
    font-size: 13px;
    color: var(--text-secondary);
}

.nav-item:hover, .nav-item-small:hover {
    background-color: var(--bg-hover);
}

.nav-item.active {
    background-color: var(--bg-hover);
    color: var(--text-primary);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 20px;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 50%, #ffd876 100%);
    border-radius: 0 2px 2px 0;
}

.nav-item img {
    width: 20px;
    height: 20px;
    display: block;
    filter: brightness(0) invert(1);
    transition: all 0.2s;
}

.nav-item:hover img,
.nav-item.active img {
    filter: brightness(0) saturate(100%) invert(65%) sepia(80%) saturate(1500%) hue-rotate(295deg) brightness(105%) contrast(100%);
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 12px;
    border-top: 1px solid var(--border-color);
}

.user-profile {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    border-radius: 6px;
    transition: background-color 0.2s;
}

.user-profile:hover {
    background-color: var(--bg-hover);
}

.avatar-icon {
    width: 24px;
    height: 24px;
    filter: brightness(0) invert(1);
    opacity: 0.9;
}

.user-name {
    flex: 1;
    font-size: 14px;
}

/* Sidebar Overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 998;
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    background-color: var(--bg-secondary);
    transition: margin-left 0.3s ease;
    position: relative;
}

.main-content.sidebar-collapsed {
    margin-left: 60px;
}

.content-body {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: margin-right 0.3s ease;
}

/* History Panel */
.history-panel {
    position: fixed;
    right: 24px;
    top: 24px;
    bottom: 24px;
    width: 340px;
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    display: none;
    flex-direction: column;
    z-index: 100;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.history-panel.visible {
    display: flex;
}

.history-header {
    padding: 20px 20px 16px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.history-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.history-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.history-new-chat-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 13px;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
}

.history-new-chat-btn:hover {
    background-color: var(--bg-hover);
    border-color: var(--text-tertiary);
}

.history-new-chat-btn img {
    width: 16px;
    height: 16px;
    filter: brightness(0) invert(1);
    opacity: 0.9;
}

.history-close-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.history-close-btn:hover {
    background-color: var(--bg-hover);
}

.history-close-btn img {
    width: 20px;
    height: 20px;
    filter: brightness(0) invert(1);
    opacity: 0.7;
}

.history-content {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.history-content::-webkit-scrollbar {
    width: 6px;
}

.history-content::-webkit-scrollbar-thumb {
    background-color: var(--bg-hover);
    border-radius: 3px;
}

.history-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    margin-bottom: 4px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.history-item:hover {
    background-color: var(--bg-hover);
}

.history-item-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.history-item-icon img {
    width: 20px;
    height: 20px;
    filter: brightness(0) saturate(100%) invert(42%) sepia(90%) saturate(3500%) hue-rotate(243deg) brightness(95%) contrast(90%);
}

.history-item-title {
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.4;
    flex: 1;
}

.history-item-actions {
    display: none;
    align-items: center;
    gap: 4px;
}

.history-item:hover .history-item-actions {
    display: flex;
}

.history-item-action-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.history-item-action-btn:hover {
    background-color: var(--bg-active);
}

.history-item-action-btn img {
    width: 16px;
    height: 16px;
    filter: brightness(0) invert(1);
    opacity: 0.7;
}

/* Adjust content body when history panel is visible */
.content-body.with-history {
    margin-right: 388px;
}

.history-sort-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 12px 12px 8px;
    margin-bottom: 4px;
}

.history-search-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: var(--bg-hover);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 6px 10px;
    transition: border-color 0.2s;
}

.history-search-wrapper:focus-within {
    border-color: var(--accent-primary);
}

.history-search-icon {
    width: 16px;
    height: 16px;
    filter: brightness(0) invert(1);
    opacity: 0.6;
    flex-shrink: 0;
}

.history-search-input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 13px;
    font-family: inherit;
}

.history-search-input::placeholder {
    color: var(--text-tertiary);
}

.history-filter-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background-color 0.2s;
}

.history-filter-btn:hover {
    background-color: var(--bg-hover);
}

.history-filter-btn img {
    width: 16px;
    height: 16px;
    filter: brightness(0) invert(1);
    opacity: 0.6;
}

/* History Toggle (modern pill button shown when history panel is closed) */
.history-toggle {
    position: fixed;
    top: 24px;
    right: 24px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    box-shadow: 0 8px 20px rgba(0,0,0,0.35);
    cursor: pointer;
    z-index: 110;
    transition: transform 0.18s ease, background-color 0.18s;
}

.history-toggle:hover {
    transform: translateY(-2px);
    background-color: var(--bg-hover);
}

.history-toggle img {
    width: 16px;
    height: 16px;
    display: block;
    /* match icon coloring used elsewhere (white on dark) */
    filter: brightness(0) invert(1);
    opacity: 0.95;
}

.history-toggle .history-toggle-label {
    font-size: 14px;
    font-weight: 600;
}

/* Utility hidden class used to toggle visibility */
.hidden {
    display: none !important;
}

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    max-width: 400px;
}

.empty-icon {
    width: 120px;
    height: 120px;
    margin-bottom: 24px;
    position: relative;
}

.icon-magnifier {
    width: 80px;
    height: 80px;
    filter: brightness(0) invert(1);
    opacity: 0.5;
}

.empty-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 12px;
}

.empty-description {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Buttons */
.icon-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    border-radius: 6px;
    transition: background-color 0.2s;
}

.icon-btn:hover {
    background-color: var(--bg-hover);
}

.icon-btn img {
    width: 20px;
    height: 20px;
    display: block;
    filter: brightness(0) invert(1);
}

.brand-logo {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

.user-profile img {
    width: 16px;
    height: 16px;
    filter: brightness(0) invert(1);
}

/* Desktop Only Elements */
.desktop-only {
    display: flex;
}

/* Mobile Styles */
@media screen and (max-width: 767px) {
    .mobile-header {
        display: flex;
    }

    .sidebar {
        transform: translateX(-100%);
        width: 60%;
        max-width: 280px;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    /* On mobile, always show sidebar icon instead of logo in collapsed state */
    .brand-logo {
        display: none;
    }

    .brand-sidebar-icon {
        display: block;
    }

    .brand-toggle {
        pointer-events: none;
    }

    .sidebar-overlay.active {
        display: block;
        opacity: 1;
    }

    .desktop-only {
        display: none !important;
    }

    .main-content {
        margin-left: 0;
        margin-top: var(--header-height);
    }

    .content-body {
        padding: 24px 16px;
    }

    /* Hide history panel on mobile */
    .history-panel {
        display: none !important;
    }

    .content-body.with-history {
        margin-right: 0;
    }

    .empty-icon {
        width: 100px;
        height: 100px;
    }

    .icon-magnifier {
        width: 60px;
        height: 60px;
    }

    .empty-title {
        font-size: 20px;
    }

    .empty-description {
        font-size: 13px;
    }
}

/* Tablet Adjustments */
@media screen and (min-width: 768px) and (max-width: 1024px) {
    .sidebar {
        width: 240px;
    }

    .main-content {
        margin-left: 240px;
    }
}

/* Content Cards (for future content) */
.card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
    transition: all 0.2s;
}

.card:hover {
    background-color: var(--bg-hover);
    border-color: var(--accent-secondary);
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
}

.card-content {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Chat Page Styles */
.chat-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    height: 100%;
    padding: 120px 40px 40px;
}

.chat-welcome {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 40px;
}

.welcome-title {
    font-size: 38px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.chat-input-wrapper {
    width: 100%;
    max-width: 960px;
}

.chat-input-container {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 29px;
    padding: 21px 26px;
    transition: all 0.2s;
}

.chat-input-container:focus-within {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(113, 96, 232, 0.1);
}

.chat-attach-btn,
.chat-voice-btn {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
    flex-shrink: 0;
}

.chat-attach-btn:hover,
.chat-voice-btn:hover {
    background-color: var(--bg-hover);
}

.chat-attach-btn img,
.chat-voice-btn img {
    width: 20px;
    height: 20px;
    filter: brightness(0) invert(1);
    opacity: 0.8;
}

.chat-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 15px;
    padding: 4px 0;
}

.chat-input::placeholder {
    color: var(--text-secondary);
}

/* Create Page Styles */
.create-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    height: 100%;
    padding: 80px 40px 40px;
    max-width: 1400px;
    margin: 0 auto;
}

.create-header {
    text-align: center;
    margin-bottom: 60px;
}

.create-title {
    font-size: 48px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.create-options {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: center;
    margin-bottom: 80px;
}

.create-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 24px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.create-option.primary {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
}

.create-option:hover {
    background-color: var(--bg-hover);
    border-color: var(--text-tertiary);
}

.create-option.primary:hover {
    background: var(--accent-secondary);
    border-color: var(--accent-secondary);
}

.create-option.more {
    background: transparent;
    border: none;
    color: var(--text-secondary);
}

.create-option img {
    width: 20px;
    height: 20px;
    filter: brightness(0) invert(1);
    opacity: 0.9;
}

.create-option.primary img {
    filter: brightness(0) invert(1);
}

.create-input-section {
    width: 100%;
    max-width: 1200px;
}

.create-input-container {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.create-input {
    width: 100%;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 18px;
    padding: 16px 0;
    border-bottom: 1px solid var(--border-color);
}

.create-input::placeholder {
    color: var(--text-secondary);
}

.create-input-options {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.create-input-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.create-input-option:hover {
    background-color: var(--bg-hover);
    border-color: var(--text-tertiary);
}

.create-input-option img {
    width: 16px;
    height: 16px;
    filter: brightness(0) invert(1);
    opacity: 0.8;
}

.create-submit-btn {
    align-self: flex-end;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.create-submit-btn:hover {
    background-color: var(--bg-hover);
    border-color: var(--text-tertiary);
}

.create-submit-btn img {
    width: 20px;
    height: 20px;
    filter: brightness(0) invert(1);
    opacity: 0.8;
}

/* Responsive adjustments for Create page */
@media screen and (max-width: 767px) {
    .create-title {
        font-size: 32px;
    }
    
    .create-options {
        gap: 12px;
    }
    
    .create-option {
        font-size: 14px;
        padding: 12px 20px;
    }
    
    .create-input-container {
        padding: 20px;
    }
    
    .create-input {
        font-size: 16px;
    }
}

/* Loop Page Styles */
.loop-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    padding: 32px 48px;
    overflow-y: auto;
    max-width: 100%;
}

.loop-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    gap: 20px;
}

.loop-filter-tabs {
    display: flex;
    gap: 12px;
    flex: 1;
}

.loop-filter-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 24px;
    color: var(--text-secondary);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.loop-filter-btn img {
    width: 18px;
    height: 18px;
    filter: brightness(0) invert(1);
    opacity: 0.6;
}

.loop-filter-btn:hover {
    background-color: var(--bg-hover);
    color: var(--text-primary);
}

.loop-filter-btn:hover img {
    opacity: 0.9;
}

.loop-filter-btn.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
}

.loop-filter-btn.active img {
    opacity: 1;
}

.loop-new-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--accent-primary);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.loop-new-btn:hover {
    background: var(--accent-secondary);
}

.loop-new-btn img {
    width: 20px;
    height: 20px;
    filter: brightness(0) invert(1);
}

.loop-new-btn .dropdown-icon {
    width: 18px;
    height: 18px;
    margin-left: 4px;
}

.loop-search-row {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 24px;
    width: 100%;
}

.loop-search-container {
    position: relative;
    flex: 1;
}

.loop-search-container .search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    filter: brightness(0) invert(1);
    opacity: 0.5;
    pointer-events: none;
}

.loop-search-input {
    width: 100%;
    padding: 14px 16px 14px 48px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s;
}

.loop-search-input::placeholder {
    color: var(--text-secondary);
}

.loop-search-input:focus {
    border-color: var(--accent-primary);
    background: var(--bg-primary);
}

.loop-search-input:hover {
    border-color: var(--text-tertiary);
    background: var(--bg-primary);
}

.loop-filter-icon-btn {
    padding: 12px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.2s, opacity 0.2s;
    flex-shrink: 0;
    width: 48px;
    height: 48px;
}

.loop-filter-icon-btn:hover {
    background: var(--bg-primary);
    border-color: var(--text-tertiary);
}

.loop-filter-icon-btn:active,
.loop-filter-icon-btn:focus {
    background: var(--bg-primary);
    border-color: var(--accent-primary);
    outline: none;
}

.loop-filter-icon-btn img {
    width: 20px;
    height: 20px;
    filter: brightness(0) invert(1);
    opacity: 0.7;
}

.loop-filter-icon-btn:hover img {
    opacity: 1;
}

.loop-notebooks-list {
    display: flex;
    flex-direction: column;
    width: 100%;
    border-top: 1px solid var(--border-color);
}

.loop-notebook-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 16px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background-color 0.2s;
    width: 100%;
    border-radius: 8px;
}

.loop-notebook-item:hover {
    background-color: var(--bg-hover);
}

.notebook-icon-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
}

.notebook-icon {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.notebook-icon img {
    width: 28px;
    height: 28px;
    filter: brightness(0) invert(1);
}

.notebook-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.notebook-title {
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 500;
}

.notebook-label {
    color: var(--text-tertiary);
    font-size: 13px;
    font-weight: 400;
}

.loop-section-label {
    padding: 16px 16px 12px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.notebook-star-btn {
    padding: 8px;
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.2s;
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    position: relative;
}

.notebook-star-btn:hover {
    background-color: var(--bg-secondary);
}

.notebook-star-btn img {
    width: 20px;
    height: 20px;
    position: absolute;
}

.notebook-star-btn .star-regular {
    filter: brightness(0) invert(1);
    opacity: 0.6;
}

.notebook-star-btn:hover .star-regular {
    opacity: 0.9;
}

.notebook-star-btn .star-filled {
    filter: brightness(0) invert(1);
    opacity: 0.6;
}

.notebook-menu-btn {
    padding: 8px;
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.2s;
    flex-shrink: 0;
    width: 36px;
    height: 36px;
}

.notebook-menu-btn:hover {
    background-color: var(--bg-secondary);
}

.notebook-menu-btn img {
    width: 20px;
    height: 20px;
    filter: brightness(0) invert(1);
    opacity: 0.7;
}

.notebook-time {
    color: var(--text-secondary);
    font-size: 14px;
    white-space: nowrap;
    margin-left: 8px;
    flex-shrink: 0;
    min-width: 80px;
    text-align: right;
}

/* Responsive adjustments for Loop page */
@media screen and (max-width: 1024px) {
    .loop-container {
        padding: 28px 36px;
    }
}

/* Search Page Styles */
.search-page-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    width: 100%;
    padding: 40px;
    background-color: var(--bg-secondary);
}

.search-page-content {
    width: 100%;
    max-width: 960px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 32px;
}

.search-page-title {
    font-size: 38px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    text-align: center;
}

.search-page-input-wrapper {
    width: 100%;
}

.search-page-input-container {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 29px;
    padding: 16px 26px;
    transition: all 0.2s;
}

.search-page-input-container:focus-within {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(113, 96, 232, 0.1);
}

.search-page-icon {
    width: 20px;
    height: 20px;
    filter: brightness(0) invert(1);
    opacity: 0.5;
    margin-right: 13px;
    flex-shrink: 0;
}

.search-page-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 15px;
    font-weight: 400;
}

.search-page-input::placeholder {
    color: var(--text-secondary);
}

/* Responsive adjustments for Search page */
@media screen and (max-width: 767px) {
    .search-page-container {
        padding: 24px 16px;
    }
    
    .search-page-title {
        font-size: 26px;
    }
    
    .search-page-input-container {
        padding: 13px 19px;
    }
    
    .search-page-input {
        font-size: 13px;
    }
    
    .search-page-icon {
        width: 16px;
        height: 16px;
        margin-right: 10px;
    }
}

@media screen and (max-width: 1024px) {
    .search-page-title {
        font-size: 32px;
    }
}

/* Responsive adjustments for Loop page */
@media screen and (max-width: 1024px) {
    .loop-container {
        padding: 28px 36px;
    }
}

@media screen and (max-width: 767px) {
    .loop-container {
        padding: 20px 16px;
    }
    
    .loop-header-row {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
        margin-bottom: 24px;
    }
    
    .loop-filter-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    
    .loop-filter-tabs::-webkit-scrollbar {
        display: none;
    }
    
    .loop-filter-btn {
        padding: 8px 20px;
        font-size: 14px;
    }
    
    .loop-new-btn {
        width: 100%;
        justify-content: center;
        padding: 12px 20px;
    }
    
    .loop-search-row {
        gap: 8px;
    }
    
    .loop-search-input {
        padding: 12px 16px 12px 44px;
        font-size: 14px;
    }
    
    .loop-search-container .search-icon {
        width: 18px;
        height: 18px;
        left: 14px;
    }
    
    .loop-filter-icon-btn {
        width: 44px;
        height: 44px;
        padding: 10px;
    }
    
    .loop-filter-icon-btn img {
        width: 18px;
        height: 18px;
    }
    
    .loop-notebook-item {
        padding: 16px 0;
        gap: 12px;
    }
    
    .notebook-icon {
        width: 44px;
        height: 44px;
    }
    
    .notebook-icon img {
        width: 24px;
        height: 24px;
    }
    
    .notebook-title {
        font-size: 15px;
    }
    
    .notebook-time {
        font-size: 13px;
    }
}

@media screen and (max-width: 480px) {
    .loop-container {
        padding: 16px 12px;
    }
    
    .loop-filter-tabs {
        gap: 8px;
    }
    
    .loop-filter-btn {
        padding: 7px 16px;
        font-size: 13px;
    }
    
    .loop-new-notebook-btn {
        width: 100%;
        justify-content: center;
    }
    
    .notebook-time {
        display: none;
    }
    
    .loop-notebook-item {
        gap: 10px;
    }
}

/* Apps Page Styles */
.apps-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    padding: 48px 80px;
    overflow-y: auto;
}

.apps-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 48px;
}

.apps-title {
    font-size: 48px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.apps-install-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--accent-primary);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.apps-install-btn:hover {
    background: var(--accent-secondary);
}

.apps-install-btn img {
    width: 20px;
    height: 20px;
    filter: brightness(0) invert(1);
}

.apps-install-btn .dropdown-icon {
    width: 18px;
    height: 18px;
}

.apps-filter-buttons {
    display: flex;
    gap: 12px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}

.filter-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 24px;
    color: var(--text-secondary);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-btn img {
    width: 18px;
    height: 18px;
    filter: brightness(0) invert(1);
    opacity: 0.6;
}

.filter-btn:hover {
    background-color: var(--bg-hover);
    color: var(--text-primary);
}

.filter-btn:hover img {
    opacity: 0.9;
}

.filter-btn.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
}

.filter-btn.active img {
    opacity: 1;
}

.apps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    width: 100%;
}

.app-card {
    display: flex;
    flex-direction: column;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    transition: all 0.2s;
    cursor: pointer;
}

.app-card-header {
    display: flex;
    align-items: center;
    gap: 16px;
}

.app-icon {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
}

.app-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.app-card:hover {
    border-color: var(--text-tertiary);
    transform: translateY(-2px);
}

.app-card-large {
    grid-column: span 2;
}

.app-name {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 4px 0;
}

.app-description {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.5;
}

/* Responsive adjustments for Apps page */
@media screen and (max-width: 1024px) {
    .apps-container {
        padding: 40px 48px;
    }
    
    .apps-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }
    
    .app-card-large {
        grid-column: span 1;
    }
    
    .filter-btn {
        padding: 8px 16px;
        font-size: 14px;
    }
}

@media screen and (max-width: 767px) {
    .apps-container {
        padding: 24px 16px;
    }
    
    .apps-header {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
        margin-bottom: 32px;
    }
    
    .apps-title {
        font-size: 32px;
    }
    
    .apps-install-btn {
        width: 100%;
        justify-content: center;
    }
    
    .apps-filter-buttons {
        gap: 8px;
        margin-bottom: 24px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    
    .apps-filter-buttons::-webkit-scrollbar {
        display: none;
    }
    
    .filter-btn {
        padding: 8px 16px;
        font-size: 14px;
        white-space: nowrap;
        flex-shrink: 0;
    }
    
    .apps-grid {
        grid-template-columns: 1fr;
    }
    
    .app-card-large {
        grid-column: span 1;
    }
}
