:root {
    --bg-primary: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    --bg-secondary: rgba(255, 255, 255, 0.4);
    --text-primary: #2c3e50;
    --text-secondary: #5a6b7c;
    --border-color: rgba(255, 255, 255, 0.6);
    --card-bg: rgba(255, 255, 255, 0.75);
    --card-border: rgba(255, 255, 255, 0.8);
    --accent-color: #3273dc;
    --shadow-light: 0 4px 6px rgba(0, 0, 0, 0.05);
    --shadow-medium: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --backdrop-blur: blur(16px);

    /* Category colors - Enhanced Pastel Palette */
    --faces-color: #ffb3ba;
    --weather-color: #bae1ff;
    --stars-color: #ffffba;
    --arrows-color: #bfcfff;
    --hands-color: #ffdfba;
    --music-color: #ffb3e6;
    --communication-color: #c7f2c7;
    --flowers-color: #ffd1dc;
    --religious-color: #e6ccff;
    --zodiac-color: #d4bfff;
    --geometric-color: #b3f0ff;
    --sports-color: #ffcc99;
    --transport-color: #ccffcc;
    --mathematical-color: #f0e6ff;
    --currency-color: #ffe6cc;
    --punctuation-color: #ffb3d9;
    --technical-color: #e6f3ff;
    --variations-color: #fff0f5;
}

[data-theme="dark"] {
    --bg-primary: linear-gradient(135deg, #1a2a3a 0%, #2c3e50 100%);
    --bg-secondary: rgba(0, 0, 0, 0.3);
    --text-primary: #ecf0f1;
    --text-secondary: #bdc3c7;
    --border-color: rgba(255, 255, 255, 0.1);
    --card-bg: rgba(30, 41, 59, 0.7);
    --card-border: rgba(255, 255, 255, 0.1);
    --accent-color: #64b5f6;
    --shadow-light: 0 4px 6px rgba(0, 0, 0, 0.3);
    --shadow-medium: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
}

* {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    position: relative;
    z-index: 0;
}

/* Override Bulma Colors */
.title,
.subtitle,
.content,
.input,
strong {
    color: var(--text-primary) !important;
}

.content h1,
.content h2,
.content h3,
.content h4,
.content h5,
.content h6 {
    color: var(--text-primary) !important;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-primary);
    z-index: -1;
    pointer-events: none;
}

/* Glassmorphism Classes */
.glass {
    background: var(--card-bg);
    backdrop-filter: var(--backdrop-blur);
    -webkit-backdrop-filter: var(--backdrop-blur);
    border: 1px solid var(--card-border);
    box-shadow: var(--shadow-light);
}

/* Dark Mode Toggle */
/* Utility Classes */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

.dark-mode-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1001;
    border-radius: 50px;
    padding: 0.5rem 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    background: var(--card-bg);
    color: var(--text-primary);
    transition: all 0.3s ease;
    min-height: 44px;
    border: 2px solid var(--border-color);
    box-shadow: var(--shadow-light);
}

.dark-mode-toggle:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
    box-shadow: var(--shadow-medium);
}

.dark-mode-toggle:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

/* Layout */
.section {
    padding: 1.5rem 0;
}

/* Grid */
.textmoji-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    gap: 0.5rem;
    padding: 0.5rem;
    max-width: 1400px;
    margin: 0 auto;
}

/* Cards */
.textmoji-card {
    border-radius: 12px;
    padding: 0.5rem 0.25rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    min-height: 80px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.textmoji-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-medium);
    border-color: var(--accent-color);
}

.textmoji-card:active {
    transform: scale(0.95);
}

.textmoji-character {
    font-size: 2rem;
    font-weight: 500;
    margin-bottom: 0.1rem;
    line-height: 1.2;
    filter: drop-shadow(0 2px 4px var(--shadow-light));
    transition: transform 0.3s ease;
}

.textmoji-card:hover .textmoji-character {
    transform: scale(1.15);
}

.textmoji-code {
    font-size: 0.55rem;
    color: var(--text-secondary);
    font-family: 'JetBrains Mono', monospace;
    opacity: 0.5;
    transition: opacity 0.3s ease;
}

.textmoji-card:hover .textmoji-code {
    opacity: 1;
    color: var(--accent-color);
}

/* Category Borders */
.textmoji-card.category-faces {
    border-bottom: 4px solid var(--faces-color);
}

.textmoji-card.category-weather {
    border-bottom: 4px solid var(--weather-color);
}

.textmoji-card.category-stars {
    border-bottom: 4px solid var(--stars-color);
}

.textmoji-card.category-arrows {
    border-bottom: 4px solid var(--arrows-color);
}

.textmoji-card.category-hands {
    border-bottom: 4px solid var(--hands-color);
}

.textmoji-card.category-music {
    border-bottom: 4px solid var(--music-color);
}

.textmoji-card.category-communication {
    border-bottom: 4px solid var(--communication-color);
}

.textmoji-card.category-flowers {
    border-bottom: 4px solid var(--flowers-color);
}

.textmoji-card.category-religious {
    border-bottom: 4px solid var(--religious-color);
}

.textmoji-card.category-zodiac {
    border-bottom: 4px solid var(--zodiac-color);
}

.textmoji-card.category-geometric {
    border-bottom: 4px solid var(--geometric-color);
}

.textmoji-card.category-sports {
    border-bottom: 4px solid var(--sports-color);
}

.textmoji-card.category-transport {
    border-bottom: 4px solid var(--transport-color);
}

.textmoji-card.category-mathematical {
    border-bottom: 4px solid var(--mathematical-color);
}

.textmoji-card.category-currency {
    border-bottom: 4px solid var(--currency-color);
}

.textmoji-card.category-punctuation {
    border-bottom: 4px solid var(--punctuation-color);
}

.textmoji-card.category-technical {
    border-bottom: 4px solid var(--technical-color);
}

.textmoji-card.category-variations {
    border-bottom: 4px solid var(--variations-color);
}

/* Inputs */
.search-container .input {
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    backdrop-filter: blur(10px);
    color: var(--text-primary);
    border-radius: 50px;
    padding: 1rem 1rem 1rem 3rem;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    height: 60px;
    box-shadow: var(--shadow-light);
}

/* Placeholder styling for dark mode */
/* Placeholder styling */
.search-container .input::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
}

[data-theme="dark"] .search-container .input::placeholder {
    color: var(--text-primary) !important;
    opacity: 1;
}

.search-container .input:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 4px rgba(50, 115, 220, 0.15);
}

.filter-btn {
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.6rem 1.2rem;
    border-radius: 25px;
    font-weight: 600;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.filter-btn:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-light);
}

.filter-btn.active {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: white;
    box-shadow: 0 4px 10px rgba(50, 115, 220, 0.3);
}

/* Animations and Utilities */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

.animate-fade-in {
    animation: fadeInUp 0.6s ease-out forwards;
}

.copy-feedback {
    background: var(--accent-color);
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 10;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

/* Notifications */
.notification {
    background: var(--card-bg) !important;
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color) !important;
    color: var(--text-primary) !important;
    box-shadow: var(--shadow-medium) !important;
}

/* Header */
.header-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    padding: 1rem 0;
}


.logo {
    width: 90px;
    height: 90px;
    object-fit: contain;
    filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.1));
    transition: transform 0.3s ease;
}

.logo:hover {
    transform: rotate(10deg) scale(1.1);
}

/* Filter Container */
.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    justify-content: center;
    padding: 0.5rem;
    margin-bottom: 1rem;
}

/* Tooltips */
.character-tooltip {
    position: absolute;
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    backdrop-filter: blur(10px);
    border-radius: 8px;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    color: var(--text-primary);
    box-shadow: var(--shadow-medium);
    z-index: 1000;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transform: translateY(-5px);
    transition: all 0.2s ease;
}

.character-tooltip.show {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 768px) {
    .character-tooltip {
        display: none;
    }
}

/* Search Button Alignment */
.search-container .field.has-addons {
    display: flex;
    align-items: center;
}

.search-container .control {
    display: flex;
    align-items: center;
}

.search-container .control.has-icons-left {
    position: relative;
}

.search-container .input {
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    backdrop-filter: blur(10px);
    color: var(--text-primary);
    border-radius: 50px 0 0 50px !important;
    /* Force left radius */
    padding: 1rem 1rem 1rem 4rem !important;
    /* Increased padding */
    /* Force padding for icon */
    font-size: 1.1rem;
    transition: all 0.3s ease;
    height: 60px !important;
    /* Force height */
    box-shadow: var(--shadow-light);
    z-index: 1;
}

.search-container .input:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 4px rgba(50, 115, 220, 0.15);
    z-index: 2;
}

.search-container .button {
    height: 60px !important;
    width: 60px !important;
    border-radius: 0 50px 50px 0 !important;
    /* Force right radius */
    margin-left: -2px;
    /* Overlap borders */
    border: 2px solid var(--border-color);
    border-left: none;
    /* Merge look */
    background: var(--card-bg);
    color: var(--text-secondary);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    z-index: 1;
}

.search-container .button:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
    box-shadow: var(--shadow-light);
    z-index: 2;
}

.search-container .icon.is-left {
    height: 60px !important;
    width: 3.5rem !important;
    z-index: 5;
    position: absolute;
    top: 0;
    left: 15px;
    /* Offset more to the right */
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    .textmoji-grid {
        grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
        gap: 0.8rem;
    }

    .textmoji-card {
        min-height: 100px;
        padding: 1rem;
    }

    .textmoji-character {
        font-size: 2.2rem;
    }

    .header-content {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .dark-mode-toggle {
        top: 15px;
        right: 15px;
        font-size: 0.85rem;
        padding: 0.4rem 0.8rem;
    }

    .search-container .input,
    .search-container .button {
        height: 50px !important;
    }

    .search-container .button {
        width: 50px !important;
    }

    .search-container .icon.is-left {
        height: 50px !important;
    }
}