:root {
    /* Colors - Brand Palette */
    --brand-black: #111111;
    --brand-white: #F5F5F7;
    --brand-blue: #2A92FF;
    --brand-gray: #A8A8A8;

    /* Theme - Dark (Base) */
    --bg-primary: var(--brand-black);
    --bg-secondary: #0a0a0a;
    --bg-tertiary: #161616;
    --bg-elevated: #1f1f1f;

    --text-primary: #F5F5F7;
    --text-secondary: #A8A8A8;
    --text-tertiary: #666666;

    --accent-primary: var(--brand-blue);
    --accent-secondary: #0076e4;
    --accent-gradient: linear-gradient(135deg, var(--brand-blue) 0%, #0076e4 100%);

    --border-color: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.15);

    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;

    /* Spacing & Misc */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;

    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.6);

    --dot-color: rgba(255, 255, 255, 0.04);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.light-theme {
    --bg-primary: #FFFFFF;
    --bg-secondary: var(--brand-white);
    --bg-tertiary: #F0F0F2;
    --bg-elevated: #FFFFFF;

    --text-primary: var(--brand-black);
    --text-secondary: #4b4b4b;
    --text-tertiary: #888888;

    --border-color: #E0E0E5;
    --border-hover: #D0D0D5;

    --dot-color: rgba(0, 0, 0, 0.03);
}

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

body {
    font-family: 'Poppins', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    overflow-x: hidden;
}

body.no-scroll {
    overflow: hidden !important;
    height: 100vh;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 700;
}

/* Sidebar */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 240px;
    height: 100vh;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    z-index: 100;
    color: var(--text-primary);
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar.collapsed {
    width: 80px;
}

.main-content {
    margin-left: 240px;
    min-height: 100vh;
    padding: 32px 40px;
    background: var(--bg-primary);
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar.collapsed+.main-content {
    margin-left: 80px;
}

.sidebar-header {
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    transition: all 0.3s;
}

.sidebar.collapsed .logo {
    justify-content: center;
    width: 100%;
}

.sidebar-toggle {
    background: transparent;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.sidebar-toggle:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.sidebar.collapsed .sidebar-toggle {
    display: none;
    /* Hide toggle or reposition if needed */
}

/* Show toggle on hover of collapsed sidebar or add it to content header? 
   Let's just keep it simple: toggle is always there but maybe smaller or repositioned.
   Actually, let's put it at the bottom or keep it top. 
*/
.sidebar.collapsed .sidebar-header {
    padding: 24px 12px;
    flex-direction: column;
    gap: 20px;
}

.sidebar.collapsed .sidebar-toggle {
    display: flex;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 0 12px;
}

.nav-section {
    margin-bottom: 24px;
}

.sidebar.collapsed .nav-section-title {
    display: none;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 12px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s;
    cursor: pointer;
    margin-bottom: 4px;
}

.sidebar.collapsed .nav-item {
    padding: 12px;
    justify-content: center;
}

.sidebar.collapsed .nav-item span {
    display: none;
}

.sidebar.collapsed .nav-item .badge {
    display: none;
}

.nav-item svg {
    flex-shrink: 0;
}

.badge {
    padding: 2px 8px;
    background: rgba(148, 163, 184, 0.1);
    color: var(--text-secondary);
    font-size: 0.7rem;
    font-weight: 500;
    border-radius: 4px;
    text-transform: lowercase;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.badge-new {
    background: rgba(30, 64, 175, 0.2);
    color: #60a5fa;
}

.badge-hot {
    background: rgba(153, 27, 27, 0.2);
    color: #f87171;
}



.nav-item .badge {
    margin-left: auto;
}

.nav-item .count {
    margin-left: auto;
    color: var(--text-tertiary);
    font-size: 0.75rem;
}

.sidebar-footer {
    padding: 16px;
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.login-btn {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: none;
    padding: 8px 20px;
    border-radius: 9999px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.login-btn:hover {
    color: var(--text-primary);
    background: var(--bg-elevated);
}

.theme-toggle {
    width: 36px;
    height: 36px;
    background: transparent;
    border: none;
    color: #444;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.theme-toggle:hover {
    color: var(--text-primary);
}

/* Main Header Styling */
.content-header {
    margin-bottom: 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-breadcrumb {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.search-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 6px 12px;
    width: 220px;
    transition: all 0.2s;
}

.search-bar:focus-within {
    background: var(--bg-tertiary);
    border-color: var(--border-hover);
}

.search-bar svg {
    color: #666;
    width: 14px;
    height: 14px;
}

.search-bar input {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 0.8125rem;
    padding: 0;
}

.search-bar input::placeholder {
    color: #666;
}

.category-section {
    margin-bottom: var(--spacing-2xl);
}

.category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--spacing-lg);
}

.category-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.view-all-link {
    color: var(--text-secondary);
    font-size: 0.875rem;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: color 0.2s;
}

.view-all-link:hover {
    color: var(--text-primary);
}

/* Updated block Card */
.blocks-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.block-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 0;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.block-card:hover {
    border-color: var(--border-hover);
    background: var(--bg-tertiary);
}

.block-header {
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.block-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.75rem;
    color: var(--text-primary);
    flex-shrink: 0;
}

.block-info {
    flex: 1;
    min-width: 0;
}

.block-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 2px;
}

.block-author-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.block-description {
    font-size: 0.8125rem;
    color: var(--text-tertiary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.block-preview-container {
    padding: 0 16px 16px 16px;
    flex: 1;
}

.block-preview-box {
    background: #111111;
    background-image: radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.04) 1px, transparent 0);
    background-size: 16px 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 16 / 10;
    position: relative;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    box-shadow: inset 0 0 40px var(--shadow-sm);
}

.block-card:hover .block-preview-box {
    border-color: var(--border-hover);
    background-color: var(--bg-elevated);
}

.block-preview-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: none;
}

.block-preview-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
}

.block-preview-icon {
    width: 64px;
    height: 64px;
    color: var(--accent-primary);
    opacity: 0.5;
}

/* Hidden footer as it's not in the new design */
.block-footer {
    display: none;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-xl);
}

.modal.active {
    display: flex;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    animation: fadeIn var(--transition-base);
}

.modal-content {
    position: relative;
    width: 100%;
    max-width: 1200px;
    height: 85vh;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    overflow: hidden;
    animation: slideUp var(--transition-slow);
    display: flex;
    flex-direction: column;
}

.modal-close {
    position: absolute;
    top: var(--spacing-lg);
    right: var(--spacing-lg);
    width: 40px;
    height: 40px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.modal-close:hover {
    background: var(--bg-elevated);
    border-color: var(--border-hover);
    color: var(--text-primary);
}

.modal-header {
    padding: var(--spacing-xl);
    border-bottom: 1px solid var(--border-color);
}

.modal-breadcrumb {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-transform: capitalize;
    font-weight: 500;
}

.modal-breadcrumb svg {
    width: 12px;
    height: 12px;
    opacity: 0.5;
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

.modal-split-view {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    min-height: 100%;
}

.modal-section {
    padding: var(--spacing-xl);
}

.code-side {
    border-right: 1px solid var(--border-color);
    background: var(--bg-secondary);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
    min-width: 0;
    /* Critical for grid item shrinking */
}

.preview-side {
    background: var(--bg-primary);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
    /* Match code-side spacing */
}

.section-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-section h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    padding-right: 16px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.modal-actions {
    display: flex;
    gap: var(--spacing-md);
}

.action-btn {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.action-btn:hover {
    background: var(--bg-elevated);
    border-color: var(--border-hover);
    color: var(--text-primary);
}

.action-btn.copied {
    background: var(--success);
    border-color: var(--success);
    color: white;
}

.action-btn.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
}

.code-block {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    flex: none;
    height: 500px;
    display: flex;
    flex-direction: column;
}

.code-block pre {
    padding: var(--spacing-lg);
    overflow: auto;
    margin: 0;
    flex: 1;
}

.code-block code {
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    line-height: 1.6;
    color: var(--text-secondary);
}

.customizer-panel {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    height: 500px;
    padding: var(--spacing-lg);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    padding-bottom: var(--spacing-md);
    border-bottom: 1px solid var(--border-color);
}

.control-group:last-child {
    border-bottom: none;
}

.control-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.control-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.control-input-wrapper {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.color-input {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 32px;
    height: 32px;
    background-color: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
}

.color-input::-webkit-color-swatch {
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.text-input {
    flex: 1;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 8px 12px;
    color: var(--text-primary);
    font-size: 0.875rem;
    outline: none;
    transition: all var(--transition-fast);
}

.text-input:focus {
    border-color: var(--accent-primary);
    background: var(--bg-elevated);
}

.control-value {
    font-family: 'Courier New', monospace;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.preview-container {
    background: #111111;
    background-image: radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.04) 1px, transparent 0);
    background-size: 16px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    height: 500px;
}

.preview-container iframe {
    width: 100%;
    height: 100%;
    border: none;
}

@media (max-width: 900px) {
    .modal-split-view {
        grid-template-columns: 1fr;
    }

    .code-side {
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }

    .code-block {
        max-height: 300px;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-elevated);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-tertiary);
}

/* Responsive */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform var(--transition-base);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .blocks-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

@media (max-width: 640px) {
    .main-content {
        padding: var(--spacing-lg);
    }

    .blocks-grid {
        grid-template-columns: 1fr;
    }

    .modal {
        padding: var(--spacing-md);
    }

    .modal-content {
        max-height: 95vh;
    }
}

.spinner {
    width: var(--spinner-size);
    height: var(--spinner-size);
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top: 3px solid var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Loading State */
.loading-container {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    position: relative;
    overflow: hidden;
    padding: var(--spacing-2xl);
    border-radius: var(--radius-lg);
}

.loading-logo {
    width: 80px;
    height: auto;
    z-index: 10;
    margin-bottom: var(--spacing-lg);
    filter: drop-shadow(0 0 20px rgba(99, 102, 241, 0.3));
    animation: logo-pulse 1s ease-in-out infinite;
}


@keyframes logo-pulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(0.95);
        opacity: 0.8;
    }
}


/* Notifications */
.notification {
    position: fixed;
    top: var(--spacing-lg);
    right: var(--spacing-lg);
    z-index: 9999;
    animation: slideIn 0.3s ease;
}

.notification-content {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: 12px 20px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    max-width: 400px;
    backdrop-filter: blur(12px);
}

.notification-warning .notification-content {
    border-left: 4px solid var(--warning);
}

.notification-error .notification-content {
    border-left: 4px solid var(--error);
}

.notification-success .notification-content {
    border-left: 4px solid #10b981;
}

.notification-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.notification-message {
    font-size: 0.875rem;
    color: var(--text-primary);
    flex: 1;
}

.notification-close {
    background: none;
    border: none;
    color: var(--text-tertiary);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color var(--transition-fast);
}

.notification-close:hover {
    color: var(--text-primary);
}

.notification-fade-out {
    animation: fadeOut 0.3s ease forwards;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

/* Empty State */
.empty-state {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-2xl);
    text-align: center;
    gap: var(--spacing-md);
}

.empty-icon {
    font-size: 4rem;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.empty-state p {
    font-size: 0.875rem;
    color: var(--text-tertiary);
    margin: 0;
    max-width: 280px;
}

/* block Tags */
.block-tags {
    display: flex;
    gap: var(--spacing-xs);
    margin-left: auto;
}

.block-tag {
    padding: 0.125rem 0.5rem;
    background: var(--accent-gradient);
    color: white;
    font-size: 0.625rem;
    font-weight: 600;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Auth Modal Styles */
#authModalOverlay {
    display: none;
    /* Hidden by default */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

#authModalOverlay.active {
    display: flex;
    /* Show when active */
}

.auth-modal {
    background: var(--bg-secondary);
    width: 100%;
    max-width: 420px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    padding: 32px;
    position: relative;
    box-shadow: var(--shadow-xl);
    text-align: center;
}

.auth-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.auth-header p {
    color: var(--text-tertiary);
    font-size: 0.9rem;
    margin-bottom: 24px;
}

.auth-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.auth-buttons {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.social-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.social-btn:hover {
    background: var(--bg-elevated);
    border-color: var(--border-hover);
    transform: translateY(-1px);
}

.auth-footer {
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    font-size: 0.85rem;
    color: var(--text-tertiary);
}

.auth-footer a {
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 600;
    margin-left: 4px;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* New Auth Form Styles */
.auth-forms {
    margin-bottom: 24px;
    text-align: left;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.helper-link {
    font-size: 0.75rem;
    color: var(--accent-primary);
    text-decoration: none;
}

.helper-link:hover {
    text-decoration: underline;
}

.form-group input {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 0.9rem;
    outline: none;
    transition: all 0.2s;
}

.form-group input:focus {
    border-color: var(--accent-primary);
    background: var(--bg-elevated);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.auth-submit-btn {
    width: 100%;
    padding: 12px;
    background: var(--accent-gradient);
    border: none;
    border-radius: 10px;
    color: white;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 8px;
}

.auth-submit-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
    filter: brightness(1.1);
}

.auth-secondary-btn {
    width: 100%;
    padding: 10px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 10px;
}

.auth-secondary-btn:hover {
    background: var(--bg-tertiary);
    border-color: var(--border-hover);
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

.auth-divider span {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* User Profile Section in Sidebar */
.sidebar.collapsed .sidebar-footer {
    flex-direction: column;
    padding: 20px 12px;
    gap: 16px;
    align-items: center;
}

.sidebar.collapsed .user-info-brief {
    flex-direction: column;
    padding: 0;
    gap: 12px;
    align-items: center;
}

.sidebar.collapsed .user-details,
.sidebar.collapsed .icon-btn:not(.logout-btn) {
    display: none;
}

.sidebar.collapsed .login-btn {
    padding: 10px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.sidebar.collapsed .login-btn span {
    display: none;
}

.sidebar.collapsed .login-btn::before {
    content: '\2192';
    font-size: 1.2rem;
}

.sidebar.collapsed #sidebarLogoutBtn {
    margin-top: 0;
}

.user-info-brief {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    width: 100%;
}

.user-avatar {
    width: 32px;
    height: 32px;
    background: var(--accent-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

.user-details {
    flex: 1;
    overflow: hidden;
}

#sidebarUserName {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.icon-btn {
    background: transparent;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.logout-btn:hover {
    color: var(--error);
}

/* Settings Modal */
.settings-modal {
    background: var(--bg-secondary);
    width: 100%;
    max-width: 500px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    padding: 32px;
    position: relative;
    box-shadow: var(--shadow-xl);
}

.settings-header {
    margin-bottom: 24px;
}

.settings-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.settings-header p {
    color: var(--text-tertiary);
    font-size: 0.9rem;
}

.settings-section {
    margin-bottom: 24px;
}

.settings-section .form-group {
    margin-bottom: 20px;
}

.settings-section textarea {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
    outline: none;
    transition: all 0.2s;
    resize: none;
}

.form-row {
    display: flex;
    gap: 16px;
    margin-bottom: 0px;
}

.form-group.half {
    flex: 1;
}

.settings-section textarea:focus {
    border-color: var(--accent-primary);
    background: var(--bg-elevated);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.settings-footer {
    display: flex;
    justify-content: flex-end;
}

#settingsModalOverlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    align-items: center;
    justify-content: center;
    z-index: 3000;
}

#settingsModalOverlay.active {
    display: flex;
}