:root {
    /* Sunset Orange Palette */
    --bg-base: #1A0F0A;
    --bg-surface: rgba(45, 26, 17, 0.7);
    --bg-surface-solid: #2d1a11;
    --bg-hover: rgba(225, 112, 85, 0.15);

    --border-light: rgba(225, 112, 85, 0.2);
    --border-subtle: rgba(255, 255, 255, 0.05);

    --text-main: #f8fafc;
    --text-muted: #a19590;

    --primary: #E17055;
    --primary-hover: #d25e43;
    --secondary: #FAB1A0;
    --accent: #0984E3;

    --font-ui: 'Inter', system-ui, sans-serif;

    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;

    --shadow-glass: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

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

body {
    background-color: var(--bg-base);
    color: var(--text-main);
    font-family: var(--font-ui);
    line-height: 1.5;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Glassmorphism */
.glass-panel {
    background: var(--bg-surface);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-light);
}

/* Typography Utils */
.text-sm {
    font-size: 0.85rem;
}

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

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

.hidden {
    display: none !important;
}

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

/* Structural Layout */
.app-container {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Header */
.app-header {
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    flex-shrink: 0;
    border-bottom: 1px solid var(--border-light);
    z-index: 10;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 500;
    min-width: 200px;
}

.logo strong {
    font-weight: 800;
    color: #FFF;
}

.logo svg {
    color: var(--primary);
}

/* Search Bar */
.search-bar-container {
    flex: 1;
    display: flex;
    justify-content: center;
    max-width: 600px;
    margin: 0 2rem;
}

.search-input-wrapper {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    transition: all 0.2s;
}

.search-input-wrapper:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(225, 112, 85, 0.2);
    background: rgba(0, 0, 0, 0.5);
}

.search-icon {
    position: absolute;
    left: 1rem;
    color: var(--text-muted);
}

.search-input {
    width: 100%;
    background: transparent;
    border: none;
    color: #FFF;
    padding: 0.75rem 2.5rem 0.75rem 2.5rem;
    font-family: var(--font-ui);
    font-size: 1rem;
    outline: none;
}

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

.clear-btn {
    position: absolute;
    right: 0.75rem;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.clear-btn:hover {
    color: #FFF;
    background: rgba(255, 255, 255, 0.1);
}

/* Tone Selector */
.tone-selector {
    display: flex;
    gap: 0.35rem;
    align-items: center;
    background: rgba(0, 0, 0, 0.3);
    padding: 0.4rem;
    border-radius: 20px;
    border: 1px solid var(--border-subtle);
}

.tone-btn {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: transform 0.2s;
    padding: 0;
}

.tone-btn:hover {
    transform: scale(1.1);
}

.tone-btn.active {
    border-color: #FFF;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
    transform: scale(1.15);
}

/* Workspace */
.workspace {
    display: flex;
    flex: 1;
    overflow: hidden;
    background: radial-gradient(circle at top right, rgba(225, 112, 85, 0.05), transparent 50%);
}

/* Sidebar */
.sidebar {
    width: 260px;
    flex-shrink: 0;
    border-right: 1px solid var(--border-light);
    border-top: none;
    border-bottom: none;
    border-left: none;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.category-list {
    list-style: none;
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.cat-item {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--text-muted);
    transition: all 0.2s;
    border: 1px solid transparent;
}

.cat-icon {
    font-size: 1.25rem;
}

.cat-item:hover {
    background: var(--bg-hover);
    color: var(--text-main);
}

.cat-item.active {
    background: rgba(225, 112, 85, 0.2);
    color: var(--primary);
    border-color: rgba(225, 112, 85, 0.3);
    font-weight: 600;
}

.category-list .divider {
    height: 1px;
    background: var(--border-subtle);
    margin: 0.75rem 0;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 2rem 3rem;
    position: relative;
}

.content-header {
    margin-bottom: 2rem;
    display: flex;
    align-items: baseline;
    gap: 1rem;
}

.content-header h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #FFF;
}

/* Emoji Grid */
.emoji-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    gap: 1rem;
    overflow-y: auto;
    align-content: start;
    flex: 1;
    padding-right: 1rem;
    padding-bottom: 2rem;
}

.emoji-grid::-webkit-scrollbar {
    width: 8px;
}

.emoji-grid::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.emoji-grid::-webkit-scrollbar-track {
    background: transparent;
}

.emoji-item {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    background: var(--bg-surface-solid);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    user-select: none;
    position: relative;
}

.emoji-item:hover {
    background: rgba(225, 112, 85, 0.15);
    border-color: var(--primary);
    transform: scale(1.15) translateY(-4px);
    z-index: 5;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
}

.emoji-item:active {
    transform: scale(0.95);
}

/* Tooltip on hover */
.emoji-item::after {
    content: attr(data-name);
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: #000;
    color: #FFF;
    font-size: 0.7rem;
    padding: 0.4rem 0.75rem;
    border-radius: 4px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: 0.2s;
    z-index: 10;
    font-family: var(--font-ui);
    font-weight: 500;
}

.emoji-item:hover::after {
    opacity: 1;
    bottom: -35px;
}

/* Empty State */
.empty-state {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.empty-icon {
    font-size: 4rem;
    filter: grayscale(1);
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.5rem;
    color: #FFF;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--primary);
    color: #FFF;
    padding: 0.75rem 1.5rem;
    border-radius: 30px;
    font-weight: 600;
    font-size: 0.95rem;
    box-shadow: 0 10px 25px rgba(225, 112, 85, 0.4);
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

@media (max-width: 768px) {
    .app-header {
        padding: 0 1rem;
        height: auto;
        flex-direction: column;
        padding-bottom: 1rem;
        gap: 1rem;
    }

    .logo {
        margin-top: 1rem;
    }

    .search-bar-container {
        margin: 0;
        width: 100%;
    }

    .workspace {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--border-light);
        padding: 0;
    }

    .category-list {
        flex-direction: row;
        overflow-x: auto;
        padding: 0.5rem;
        scrollbar-width: none;
    }

    .cat-item {
        white-space: nowrap;
    }

    .main-content {
        padding: 1rem;
    }

    .emoji-item {
        font-size: 2rem;
    }
}