/* ami-along/emoji-picker.css */
.emoji-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.emoji-modal {
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    max-width: 400px;
    width: 90%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.emoji-modal-header {
    padding: 15px 20px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.emoji-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #333;
}

.emoji-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}

.emoji-close:hover {
    background: #f0f0f0;
}

.emoji-search {
    padding: 15px 20px;
    border-bottom: 1px solid #e0e0e0;
}

.emoji-search input {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    box-sizing: border-box;
}

.emoji-search input:focus {
    outline: none;
    border-color: #4CAF50;
}

.emoji-categories {
    display: flex;
    flex-wrap: wrap;
    padding: 10px;
    border-bottom: 1px solid #e0e0e0;
    gap: 5px;
    justify-content: center;
}

.emoji-category-btn {
    background: none;
    border: none;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 20px;
    border-radius: 6px;
    transition: background 0.2s;
    flex-shrink: 0;
}

.emoji-category-btn:hover {
    background: #f0f0f0;
}

.emoji-category-btn.active {
    background: #e3f2fd;
}

.emoji-grid {
    padding: 15px;
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 5px;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
    box-sizing: border-box;
}

.emoji-item {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: background 0.2s, transform 0.1s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.emoji-item:hover {
    background: #f0f0f0;
    transform: scale(1.2);
}

.emoji-item:active {
    transform: scale(1.1);
}

.emoji-category-title {
    grid-column: 1 / -1;
    font-weight: bold;
    color: #666;
    font-size: 14px;
    padding: 10px 5px 5px 5px;
    margin-top: 10px;
}

.emoji-category-title:first-child {
    margin-top: 0;
}

@media (max-width: 500px) {
    .emoji-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

/* Better mobile touch support */
@media (max-width: 768px) {
    .emoji-modal {
        max-width: 95%;
        max-height: 85vh;
    }
    
    .emoji-item {
        padding: 12px;
        font-size: 28px;
        min-height: 48px;
        min-width: 48px;
    }
    
    .emoji-category-btn {
        padding: 12px 16px;
        font-size: 24px;
        min-height: 48px;
        min-width: 48px;
    }
    
    .emoji-search input {
        font-size: 16px;
        padding: 12px 15px;
    }
    
    .emoji-close {
        width: 44px;
        height: 44px;
        font-size: 28px;
    }
}

/* Prevent iOS zoom on input focus */
@media screen and (max-width: 768px) {
    .emoji-search input {
        font-size: 16px !important;
    }
}

/* Improve touch scrolling */
.emoji-grid {
    -webkit-overflow-scrolling: touch;
}

/* Ensure modal appears above everything on mobile */
@media (max-width: 768px) {
    .emoji-modal-overlay {
        z-index: 99999 !important;
    }
    
    /* Make sure TinyMCE doesn't block touches */
    .mce-tinymce {
        -webkit-tap-highlight-color: transparent;
    }
}