:root {
    --bg-color: #1A0A14;
    --card-bg: rgba(45, 27, 38, 0.7);
    --primary: #E84393;
    --secondary: #FD79A8;
    --accent: #6C5CE7;
    --text: #FFFFFF;
    --text-muted: #B2BEC3;
    --border: rgba(232, 67, 147, 0.2);
    --border-hover: rgba(232, 67, 147, 0.5);
    --glass-bg: rgba(255, 255, 255, 0.05);
    --radius: 12px;
    --shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.8);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

body {
    background-color: var(--bg-color);
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(232, 67, 147, 0.1) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(108, 92, 231, 0.1) 0%, transparent 40%);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.app-container {
    width: 100%;
    max-width: 500px;
}

header {
    text-align: center;
    margin-bottom: 30px;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: 5px;
}

header .accent {
    color: var(--primary);
    text-shadow: 0 0 15px rgba(232, 67, 147, 0.5);
}

header p {
    color: var(--text-muted);
    font-size: 1rem;
}

.picker-card {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 600px;
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Search Area */
.search-container {
    padding: 20px;
    display: flex;
    gap: 12px;
    align-items: center;
    border-bottom: 1px solid var(--border);
}

.search-icon {
    color: var(--text-muted);
    width: 20px;
    height: 20px;
}

#emoji-search {
    flex: 1;
    background: var(--glass-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 15px;
    color: var(--text);
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
}

#emoji-search:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(232, 67, 147, 0.2);
}

/* Skin Tone Selector */
.skin-tone-dropdown {
    position: relative;
}

#skin-tone-btn {
    background: var(--glass-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    width: 42px;
    height: 42px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

#skin-tone-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--secondary);
}

.skin-tone-options {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: #2D1B26;
    border: 1px solid var(--primary);
    border-radius: 8px;
    padding: 8px;
    display: none;
    grid-template-columns: repeat(3, 1fr);
    gap: 5px;
    z-index: 100;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
}

.skin-tone-options.show {
    display: grid;
    animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.skin-tone-options button {
    background: transparent;
    border: none;
    font-size: 1.2rem;
    padding: 5px;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.2s;
}

.skin-tone-options button:hover {
    background: rgba(232, 67, 147, 0.2);
}

/* Category Navigation */
.category-nav {
    display: flex;
    overflow-x: auto;
    padding: 10px 15px;
    gap: 10px;
    scrollbar-width: none; /* Firefox */
    border-bottom: 1px solid var(--border);
}

.category-nav::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

.category-item {
    padding: 8px 12px;
    border-radius: 20px;
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-muted);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    font-weight: 500;
}

.category-item:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.05);
}

.category-item.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(232, 67, 147, 0.3);
}

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

/* Emoji Display */
.emoji-display {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    position: relative;
}

.empty-msg, .error {
    text-align: center;
    color: var(--text-muted);
    margin-top: 50px;
    font-size: 0.9rem;
}

.error {
    color: #ff7675;
}

.emoji-display::-webkit-scrollbar {
    width: 6px;
}

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

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

.emoji-section {
    margin-bottom: 25px;
}

.emoji-section-title {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 1px;
    margin-bottom: 12px;
}

.emoji-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(45px, 1fr));
    gap: 8px;
    animation: fadeInGrid 0.3s ease-out;
}

@keyframes fadeInGrid {
    from { opacity: 0; transform: scale(0.98); }
    to { opacity: 1; transform: scale(1); }
}

.emoji-item {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    background: transparent;
    border: none;
    color: inherit;
    outline: none;
}

.emoji-item:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.2);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.emoji-item:focus {
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 0 2px var(--primary);
}

/* Loader */
.loader {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
    color: var(--text-muted);
}

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

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

/* Footer */
.picker-footer {
    padding: 15px 20px;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border);
    backdrop-filter: blur(5px);
}

#selected-emoji-preview {
    display: flex;
    align-items: center;
    gap: 10px;
}

.preview-icon {
    font-size: 1.5rem;
}

.preview-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text);
}

.copy-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-style: italic;
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--accent);
    color: white;
    padding: 12px 24px;
    border-radius: 30px;
    font-weight: 600;
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 1000;
}

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

/* Mobile adjustments */
@media (max-width: 480px) {
    .picker-card {
        height: calc(100vh - 120px);
    }
}
