.kol-emoji-picker-modal {
    position: fixed;
    inset: 0;
    z-index: 1000002;
    background: transparent;
    pointer-events: none;
    display: none;
}

.kol-emoji-picker-modal.show,
.kol-emoji-picker-modal.kol-emoji-picker-open {
    display: block !important;
}

.kol-emoji-picker-content {
    position: fixed;
    background: white;
    border-radius: 12px;
    width: min(390px, calc(100vw - 20px));
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    overflow: visible;
    display: flex;
    flex-direction: column;
    max-height: min(430px, calc(100vh - 20px));
    pointer-events: auto;
}

.kol-emoji-picker-content::after {
    content: '';
    position: absolute;
    right: 18px;
    bottom: -10px;
    width: 20px;
    height: 20px;
    background: inherit;
    box-shadow: 4px 4px 12px rgba(0, 0, 0, 0.08);
    transform: rotate(45deg);
}

.kol-emoji-picker-below .kol-emoji-picker-content::after {
    top: -10px;
    bottom: auto;
    box-shadow: -4px -4px 12px rgba(0, 0, 0, 0.06);
}

.kol-emoji-picker-header {
    display: none;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid #e0e0e0;
    background-color: #f8f9fa;
}

.kol-emoji-picker-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
}

.kol-emoji-picker-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: background-color 0.2s;
}

.kol-emoji-picker-close:hover {
    background-color: #e0e0e0;
    color: #1a1a1a;
}

.kol-emoji-picker-current {
    display: none;
}

.kol-emoji-label {
    font-size: 12px;
    color: #666;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.kol-emoji-display {
    font-size: 48px;
    line-height: 1;
    min-height: 50px;
    display: flex;
    align-items: center;
}

.kol-emoji-search-box {
    padding: 10px;
    border-bottom: 0;
    position: relative;
    z-index: 1;
}

.kol-emoji-search {
    width: 100%;
    padding: 10px 14px;
    border: 0;
    border-radius: 999px;
    background: #f0f2f5;
    font-size: 16px;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.kol-emoji-search:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.18);
}

.kol-emoji-categories {
    display: flex;
    order: 3;
    padding: 8px 10px 10px;
    gap: 4px;
    border-top: 1px solid #e5e7eb;
    border-bottom: 0;
    flex-wrap: nowrap;
    justify-content: space-between;
    position: relative;
    z-index: 1;
}

.kol-emoji-category-btn {
    background: transparent;
    border: none;
    width: 36px;
    height: 32px;
    padding: 0;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s;
    color: #666;
}

.kol-emoji-category-btn:hover {
    background-color: #e0e0e0;
}

.kol-emoji-category-btn.active {
    background-color: #e7f0ff;
    color: #0866ff;
}

.kol-emoji-grid {
    overflow-y: auto;
    padding: 0 14px 10px;
    flex: 1;
    position: relative;
    z-index: 1;
}

.kol-emoji-category-label {
    font-size: 13px;
    color: #6b7280;
    text-transform: none;
    letter-spacing: 0;
    margin: 4px 0 8px 4px;
    font-weight: 500;
}

.kol-emoji-row {
    display: grid;
    grid-template-columns: repeat(8, minmax(32px, 1fr));
    gap: 5px;
    margin-bottom: 8px;
}

.kol-emoji-item {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
}

.kol-emoji-item:hover {
    background-color: #f0f0f0;
    transform: scale(1.1);
}

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

.kol-emoji-no-results {
    text-align: center;
    color: #999;
    padding: 32px 16px;
    font-size: 14px;
}

.kol-emoji-trigger {
    background-color: #4a90e2;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

.kol-emoji-trigger:hover {
    background-color: #357abd;
}

html.dark-mode .kol-emoji-picker-content {
    background: #242526;
    color: #e4e6eb;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

html.dark-mode .kol-emoji-search {
    background: #3a3b3c;
    color: #e4e6eb;
}

html.dark-mode .kol-emoji-search::placeholder {
    color: #b0b3b8;
}

html.dark-mode .kol-emoji-categories {
    border-top-color: #3a3b3c;
}

html.dark-mode .kol-emoji-category-label {
    color: #b0b3b8;
}

html.dark-mode .kol-emoji-category-btn {
    color: #b0b3b8;
}

html.dark-mode .kol-emoji-category-btn:hover,
html.dark-mode .kol-emoji-item:hover {
    background-color: #3a3b3c;
}

html.dark-mode .kol-emoji-category-btn.active {
    background-color: #263951;
    color: #78a9ff;
}

.kol-emoji-input {
    display: none;
}

/* Scrollbar styling */
.kol-emoji-grid::-webkit-scrollbar {
    width: 6px;
}

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

.kol-emoji-grid::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.kol-emoji-grid::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* Responsive */
@media (max-width: 600px) {
    .kol-emoji-picker-content {
        width: calc(100vw - 20px);
        max-height: min(420px, calc(100vh - 20px));
    }

    .kol-emoji-row {
        grid-template-columns: repeat(8, minmax(28px, 1fr));
    }

    .kol-emoji-item {
        font-size: 28px;
    }

    .kol-emoji-display {
        font-size: 36px;
    }
}
