/**
 * Emoji Gallery - Common Styles
 * Minimal and clean design for all platforms
 */

/* ===========================
   RESET & BASE
   =========================== */
#emoji-gallery-page {
    background: #ffffff;
    color: #000000;
}

/* ===========================
   PLATFORM NAVIGATION
   =========================== */
.platform-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 20px 20px 16px;
    margin: 0;
}

.platform-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: transparent;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    color: #000000;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}

.platform-btn.active {
    background-color: #000000;
    color: #ffffff;
    border-color: #000000;
}

.platform-emoji {
    font-size: 16px;
    line-height: 1;
}

.platform-name {
    line-height: 1;
}

/* ===========================
   HEADER SECTION
   =========================== */
.gallery-header {
    text-align: left;
    padding: 0 20px;
    margin: 0 0 8px 0;
}

.gallery-title {
    font-size: 32px;
    font-weight: 700;
    margin: 0 0 8px 0;
    padding: 0;
    color: #000000;
}

.gallery-description {
    font-size: 15px;
    line-height: 1.6;
    color: #666666;
    margin: 0;
    padding: 0;
}

/* ===========================
   GROUP NAVIGATION
   =========================== */
.group-nav {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 8px;
    padding: 16px 20px;
    margin: 0;
    flex-wrap: wrap;
}

.group-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: transparent;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    color: #000000;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}

.group-btn.active {
    background-color: #000000;
    color: #ffffff;
    border-color: #000000;
}

/* ===========================
   GALLERY CONTAINER
   =========================== */
#gallery {
    margin: 0;
    padding: 0 20px;
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* ===========================
   GROUP SECTION
   =========================== */
.emoji-group-container {
    margin: 40px 0;
    padding: 0;
}

.emoji-group-container:first-child {
    margin-top: 0;
}

.emoji-group {
    margin: 0;
    padding: 0;
}

.group-header {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 12px 0;
    padding: 0;
    color: #000000;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}

/* ===========================
   EMOJI GRID
   =========================== */
.emoji-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
    gap: 2px;
    margin: 0;
    padding: 0;
}

.emoji-item {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 50px;
    cursor: pointer;
    text-decoration: none;
    background: transparent;
    border: none;
    padding: 0;
    border-radius: 4px;
}

.emoji-item:hover {
    background-color: #f5f5f5;
}

.emoji-image {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

/* Lazy loading placeholder */
.emoji-image[data-src] {
    background: #f5f5f5;
    border-radius: 4px;
}

/* ===========================
   LOADING INDICATOR
   =========================== */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: #666666;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f5f5f5;
    border-top: 3px solid #000000;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 16px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-container p {
    margin: 0;
    font-size: 14px;
}

/* ===========================
   NO RESULTS MESSAGE
   =========================== */
.no-results {
    text-align: center;
    padding: 60px 20px;
    color: #666666;
    font-size: 16px;
}

.no-results p {
    margin: 0;
}

/* ===========================
   FLOATING SEARCH BAR
   =========================== */
.search-container {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    width: 90%;
    max-width: 500px;
    padding: 0;
}

.search-input {
    width: 100%;
    padding: 14px 20px;
    font-size: 15px;
    border: 2px solid #000000;
    border-radius: 50px;
    background: #ffffff;
    color: #000000;
    outline: none;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.search-input:focus {
    box-shadow: 0 6px 30px rgba(0, 0, 0, 0.2);
}

.search-input::placeholder {
    color: #999999;
}

/* ===========================
   EMOJI MODAL
   =========================== */
.emoji-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.emoji-modal.active {
    display: block;
    opacity: 1;
}

.emoji-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
}

.emoji-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: #ffffff;
    border-radius: 16px;
    padding: 40px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    transition: transform 0.3s ease;
}

.emoji-modal.active .emoji-modal-content {
    transform: translate(-50%, -50%) scale(1);
}

.emoji-modal-close {
    position: absolute !important;
    top: 16px !important;
    right: 16px !important;
    background: transparent !important;
    border: none !important;
    font-size: 32px !important;
    color: #666666 !important;
    cursor: pointer !important;
    width: 40px !important;
    height: 40px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1 !important;
    padding: 0 !important;
    transition: none !important;
    box-shadow: none !important;
    text-decoration: none !important;
}

.emoji-modal-close:hover {
    color: #666666 !important;
    background: transparent !important;
    opacity: 1 !important;
    transform: none !important;
    box-shadow: none !important;
    text-decoration: none !important;
}

.emoji-modal-image {
    margin-bottom: 30px;
}

.emoji-modal-image img {
    width: 120px;
    height: 120px;
    object-fit: contain;
}

.emoji-modal-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.modal-btn {
    flex: 1 !important;
    padding: 14px 20px !important;
    border: none !important;
    border-radius: 8px !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    text-decoration: none !important;
    display: inline-block !important;
    transition: all 0.2s ease !important;
    box-sizing: border-box !important;
}

.modal-btn-download,
.modal-btn-copy {
    background: #000000 !important;
    color: #ffffff !important;
}

.modal-btn-download:hover,
.modal-btn-copy:hover {
    background: #333333 !important;
}

.modal-btn-copy.copied {
    background: #4CAF50 !important;
    color: #ffffff !important;
}

/* ===========================
   RESPONSIVE DESIGN
   =========================== */

/* Tablet */
@media (max-width: 768px) {
    .platform-nav {
        flex-wrap: wrap;
        gap: 6px;
        padding: 16px 16px 12px;
    }

    .platform-btn {
        padding: 8px 12px;
        font-size: 13px;
    }

    .platform-emoji {
        font-size: 14px;
    }

    .gallery-header {
        padding: 0 16px;
    }

    .gallery-title {
        font-size: 28px;
    }

    .gallery-description {
        font-size: 14px;
    }

    .group-nav {
        padding: 12px 16px;
        gap: 6px;
    }

    .group-btn {
        padding: 8px 12px;
        font-size: 13px;
    }

    #gallery {
        padding: 0 16px;
    }

    .emoji-grid {
        grid-template-columns: repeat(auto-fill, minmax(52px, 1fr));
        gap: 2px;
    }

    .emoji-item {
        height: 52px;
    }

    .emoji-image {
        width: 42px;
        height: 42px;
    }

    .search-container {
        width: 92%;
        bottom: 16px;
    }

    .search-input {
        padding: 12px 18px;
        font-size: 14px;
    }
}

/* Mobile */
@media (max-width: 480px) {
    .platform-nav {
        gap: 4px;
        padding: 12px 12px 8px;
    }

    .platform-btn {
        padding: 6px 10px;
        font-size: 12px;
        gap: 4px;
    }

    .platform-emoji {
        font-size: 13px;
    }

    .gallery-header {
        padding: 0 12px;
    }

    .gallery-title {
        font-size: 24px;
    }

    .gallery-description {
        font-size: 13px;
    }

    .group-nav {
        padding: 10px 12px;
        gap: 4px;
    }

    .group-btn {
        padding: 6px 10px;
        font-size: 12px;
    }

    #gallery {
        padding: 0 12px;
    }

    .emoji-group {
        margin: 32px 0;
    }

    .group-header {
        font-size: 16px;
        margin-bottom: 10px;
    }

    .emoji-grid {
        grid-template-columns: repeat(auto-fill, minmax(55px, 1fr));
        gap: 2px;
    }

    .emoji-item {
        height: 55px;
    }

    .emoji-image {
        width: 45px;
        height: 45px;
    }

    .search-container {
        width: 94%;
        bottom: 12px;
    }

    .search-input {
        padding: 11px 16px;
        font-size: 14px;
    }
}

/* Extra small mobile */
@media (max-width: 360px) {
    .emoji-grid {
        grid-template-columns: repeat(auto-fill, minmax(58px, 1fr));
    }

    .emoji-item {
        height: 58px;
    }

    .emoji-image {
        width: 48px;
        height: 48px;
    }
}
