/**
 * WG Comments - Emoji & Giphy Styles
 *
 * @package WG_Comments
 * @version 1.0.0
 */

/* ===========================
   Custom Toolbar Buttons
   =========================== */

.wgc-custom-btn {
    width: 36px !important;
    height: 36px !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 16px;
    font-weight: 600;
    color: #495057;
}

.wgc-custom-btn:hover {
    background: #f8f9fa;
    border-color: #8b5cf6;
    color: #8b5cf6;
    transform: scale(1.05);
}

#wgc-gif-btn {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

/* ===========================
   Emoji Modal (wie GIF Modal)
   =========================== */

.wgc-emoji-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(4px);
}

.wgc-emoji-modal-content {
    background: #ffffff;
    border-radius: 16px;
    width: 100%;
    max-width: 500px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
}

.wgc-emoji-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e9ecef;
    background: #f8f9fa;
}

.wgc-emoji-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.wgc-emoji-close {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    font-size: 24px;
    color: #6c757d;
    cursor: pointer;
    transition: all 0.2s ease;
}

.wgc-emoji-close:hover {
    background: #ef4444;
    border-color: #ef4444;
    color: #ffffff;
    transform: rotate(90deg);
}

.wgc-emoji-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 8px;
    padding: 20px;
    overflow-y: auto;
    max-height: calc(80vh - 80px);
}

.wgc-emoji-item {
    width: 100%;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    cursor: pointer;
    border: 1px solid transparent;
    border-radius: 8px;
    transition: all 0.2s;
    background: #f8f9fa;
    padding: 0;
}

.wgc-emoji-item:hover {
    background: #ffffff;
    border-color: #8b5cf6;
    transform: scale(1.15);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

/* Scrollbar */
.wgc-emoji-grid::-webkit-scrollbar {
    width: 8px;
}

.wgc-emoji-grid::-webkit-scrollbar-track {
    background: #f8f9fa;
}

.wgc-emoji-grid::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 4px;
}

.wgc-emoji-grid::-webkit-scrollbar-thumb:hover {
    background: #8b5cf6;
}

/* Responsive */
@media (max-width: 768px) {
    .wgc-emoji-modal-content {
        max-height: 90vh;
    }

    .wgc-emoji-grid {
        grid-template-columns: repeat(6, 1fr);
        gap: 6px;
        padding: 12px;
    }
}

@media (max-width: 480px) {
    .wgc-emoji-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

/* Alte duplicate styles entfernt */

/* ===========================
   GIF Modal
   =========================== */

.wgc-gif-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(4px);
}

.wgc-gif-modal-content {
    background: #ffffff;
    border-radius: 16px;
    width: 100%;
    max-width: 800px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
}

.wgc-gif-header {
    display: flex;
    gap: 12px;
    padding: 20px;
    border-bottom: 1px solid #e9ecef;
    background: #f8f9fa;
}

.wgc-gif-search {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    font-size: 14px;
    transition: all 0.2s ease;
}

.wgc-gif-search:focus {
    outline: none;
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.wgc-gif-close {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    font-size: 24px;
    color: #6c757d;
    cursor: pointer;
    transition: all 0.2s ease;
}

.wgc-gif-close:hover {
    background: #ef4444;
    border-color: #ef4444;
    color: #ffffff;
    transform: rotate(90deg);
}

.wgc-gif-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
    padding: 20px;
    overflow-y: auto;
    max-height: calc(80vh - 100px);
}

.wgc-gif-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #f8f9fa;
}

.wgc-gif-item:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 24px rgba(139, 92, 246, 0.3);
    z-index: 10;
}

.wgc-gif-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.wgc-gif-loading,
.wgc-gif-error {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
    font-size: 14px;
}

.wgc-gif-error {
    color: #ef4444;
}

/* GIF Grid Scrollbar */
.wgc-gif-grid::-webkit-scrollbar {
    width: 8px;
}

.wgc-gif-grid::-webkit-scrollbar-track {
    background: #f8f9fa;
}

.wgc-gif-grid::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 4px;
}

.wgc-gif-grid::-webkit-scrollbar-thumb:hover {
    background: #8b5cf6;
}

/* ===========================
   Responsive
   =========================== */

@media (max-width: 768px) {
    .wgc-emoji-picker {
        left: 50%;
        transform: translateX(-50%);
        width: calc(100% - 40px);
        max-width: 340px;
    }

    .wgc-gif-modal-content {
        max-height: 90vh;
    }

    .wgc-gif-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 8px;
        padding: 12px;
    }

    .wgc-emoji-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

@media (max-width: 480px) {
    .wgc-gif-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .wgc-emoji-grid {
        grid-template-columns: repeat(5, 1fr);
    }

    .wgc-emoji-tabs {
        font-size: 11px;
    }
}

/* ===========================
   Powered by Giphy Badge
   =========================== */

.wgc-gif-header::after {
    content: 'Powered by GIPHY';
    position: absolute;
    bottom: 8px;
    right: 8px;
    font-size: 10px;
    color: #6c757d;
    opacity: 0.6;
}
