
.expressions-page {
    background-color: var(--bg-color);
    padding-top: 70px;
    /* Navbar height */
    height: 100vh;
    overflow: hidden;
    /* Main scroll handled by content area */
}

.expressions-container {
    display: flex;
    height: calc(100vh - 70px);
}

/* Sidebar */
.sidebar {
    width: 300px;
    background-color: var(--card-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.search-box {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    position: relative;
}

.search-box i {
    position: absolute;
    left: 2.2rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.search-box input {
    width: 100%;
    padding: 0.8rem 1rem 0.8rem 2.5rem;
    background: #000;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.3s;
}

.search-box input:focus {
    border-color: #666;
}

.expression-list {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 0;
}

.expression-link {
    display: block;
    padding: 0.8rem 1.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
    border-left: 3px solid transparent;
    transition: all 0.2s;
}

.expression-link:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.expression-link.active {
    background-color: rgba(255, 255, 255, 0.08);
    color: #fff;
    border-left-color: #fff;
}

/* Main Content Area */
.expression-content {
    flex: 1;
    overflow-y: auto;
    padding: 3rem 4rem;
    background-color: #0f0f11;
}

.expression-item {
    display: block;
    max-width: 900px;
    margin: 0 auto 6rem auto;
    animation: fadeIn 0.3s ease-out;
    scroll-margin-top: 100px;
    /* Offset for fixed navbar */
    border-bottom: 1px solid #333;
    padding-bottom: 4rem;
}

.expression-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

/* Active class no longer needed for visibility, but kept for potential highlighting */
.expression-item.active {
    display: block;
}

.expression-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #ffffff, #a0a0a0);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.expression-desc {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.7;
}

.expression-usage {
    font-size: 0.95rem;
    color: #3392e2;
    /* AE Blue */
    background: rgba(51, 146, 226, 0.1);
    display: inline-block;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    margin-bottom: 2rem;
    border: 1px solid rgba(51, 146, 226, 0.2);
}

/* Code Block Styles */
.code-wrapper {
    background: #1e1e1e;
    border-radius: 8px;
    border: 1px solid #333;
    overflow: hidden;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}


.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 1.2rem;
    background: #252526;
    border-bottom: 1px solid #333;
    font-size: 0.85rem;
    color: #888;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.copy-btn {
    background: transparent;
    border: none;
    color: #aaa;
    cursor: pointer;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: color 0.3s;
}

.copy-btn:hover {
    color: #fff;
}

/* Theme Editor Styles */
.theme-editor-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.theme-editor-btn:hover {
    transform: scale(1.1) rotate(90deg);
    background: #333;
}

.theme-panel {
    position: fixed;
    bottom: 80px;
    right: 20px;
    width: 300px;
    background: rgba(20, 20, 20, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    z-index: 999;
    box-shadow: var(--shadow-lg);
    transform: translateY(20px);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
}

.theme-panel.active {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.theme-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #333;
}

.theme-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.theme-close {
    cursor: pointer;
    color: var(--text-secondary);
}

.theme-grid {
    display: grid;
    gap: 1rem;
}

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

.theme-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.color-picker-wrapper {
    position: relative;
    width: 40px;
    height: 25px;
    overflow: hidden;
    border-radius: 4px;
    border: 1px solid #444;
}

.color-picker-wrapper input[type="color"] {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    cursor: pointer;
    border: none;
    padding: 0;
}

.theme-actions {
    margin-top: 1.5rem;
    display: flex;
    gap: 1rem;
}

.reset-btn {
    width: 100%;
    padding: 0.6rem;
    background: #333;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.reset-btn:hover {
    background: #444;
}

/* PrismJS Variable Conversion */
.code-wrapper {
    background: var(--syntax-bg) !important;
    border-color: rgba(255, 255, 255, 0.1);
}

pre[class*="language-"] {
    background: var(--syntax-bg) !important;
    color: var(--syntax-text) !important;
    text-shadow: none !important;
    font-family: 'Monaco', 'Menlo', 'Courier New', monospace !important;
}

/* Variable Mapping */
.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
    color: var(--syntax-comment) !important;
}

.token.number,
.token.boolean {
    color: var(--syntax-number) !important;
}

.token.string,
.token.attr-value {
    color: var(--syntax-string) !important;
}

.token.keyword,
.token.atrule,
.token.selector {
    color: var(--syntax-keyword) !important;
}

.token.operator {
    color: var(--syntax-operator) !important;
}

.token.function,
.token.class-name {
    color: var(--syntax-function) !important;
}

.token.punctuation {
    color: var(--syntax-text) !important;
}

/* Functions & AE Globals - Yellow/Cream */
.token.function,
.token.class-name,
.token.ae-global {
    color: #e3d398 !important;
}

/* Variables/Identifiers - Light Beige/White */
.token.variable,
.token.property,
.token.constant,
.token.symbol,
.token.builtin {
    color: #d6d6d6 !important;
}

/* Punctuation - Grey */
.token.punctuation {
    color: #888888 !important;
}

.token.important,
.token.bold {
    font-weight: bold;
}

.token.italic {
    font-style: italic;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

/* Responsive Styles for Expressions Page */
@media (max-width: 768px) {
    .expressions-container {
        flex-direction: column;
        height: auto;
    }

    .sidebar {
        width: 100%;
        height: 300px;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }

    .expressions-page {
        height: auto;
        overflow: auto;
    }

    .expression-content {
        padding: 2rem 1.5rem;
        height: auto;
    }

    .expression-title {
        font-size: 2rem;
    }
}