/* =====================================================
   GIF PICKER - Discord Style (Tenor API)
   ===================================================== */

.gif-picker-overlay {
    position: fixed;
    inset: 0;
    z-index: 9990;
}

.gif-picker {
    position: fixed;
    width: 440px;
    height: 460px;
    background: #2f3136;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    z-index: 9991;
    animation: gifPickerIn 0.15s cubic-bezier(0.2, 0.8, 0.2, 1);
    overflow: hidden;
    font-family: 'Inter', 'Segoe UI', sans-serif;
}

@keyframes gifPickerIn {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Header */
.gif-picker-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 12px 0;
    flex-shrink: 0;
}

.gif-picker-header .gif-logo {
    font-size: 14px;
    font-weight: 800;
    color: #fff;
    background: linear-gradient(135deg, #00b4d8, #5865f2, #e040fb);
    padding: 4px 8px;
    border-radius: 4px;
    letter-spacing: 1px;
}

/* Search */
.gif-picker-search {
    padding: 8px 12px 10px;
    flex-shrink: 0;
}

.gif-picker-search input {
    width: 100%;
    background: #202225;
    border: none;
    border-radius: 6px;
    padding: 8px 12px;
    color: #dcddde;
    font-size: 14px;
    outline: none;
    box-sizing: border-box;
    transition: box-shadow 0.15s;
}

.gif-picker-search input:focus {
    box-shadow: 0 0 0 2px rgba(88, 101, 242, 0.4);
}

.gif-picker-search input::placeholder {
    color: #72767d;
}

/* Category Chips */
.gif-picker-categories {
    display: flex;
    gap: 6px;
    padding: 0 12px 8px;
    overflow-x: auto;
    scrollbar-width: none;
    flex-shrink: 0;
}

.gif-picker-categories::-webkit-scrollbar {
    display: none;
}

.gif-category-chip {
    padding: 4px 12px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    color: #b9bbbe;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s;
    flex-shrink: 0;
}

.gif-category-chip:hover {
    background: rgba(88, 101, 242, 0.15);
    border-color: rgba(88, 101, 242, 0.3);
    color: #dcddde;
}

.gif-category-chip.active {
    background: rgba(88, 101, 242, 0.2);
    border-color: #5865f2;
    color: #fff;
}

/* Content Grid */
.gif-picker-content {
    flex: 1;
    overflow-y: auto;
    padding: 0 8px 8px;
}

.gif-picker-content::-webkit-scrollbar {
    width: 6px;
}

.gif-picker-content::-webkit-scrollbar-track {
    background: transparent;
}

.gif-picker-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.gif-picker-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Grid layout - 2 column masonry approximation */
.gif-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
}

.gif-item {
    position: relative;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    background: #202225;
    transition: transform 0.1s, box-shadow 0.1s;
    min-height: 80px;
}

.gif-item:hover {
    transform: scale(1.02);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
    z-index: 2;
}

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

.gif-item::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(transparent 60%, rgba(0, 0, 0, 0.4));
    opacity: 0;
    transition: opacity 0.15s;
    pointer-events: none;
}

.gif-item:hover::after {
    opacity: 1;
}

/* Loading */
.gif-picker-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #72767d;
    gap: 12px;
}

.gif-loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: #5865f2;
    border-radius: 50%;
    animation: gifSpin 0.8s linear infinite;
}

@keyframes gifSpin {
    to { transform: rotate(360deg); }
}

/* Empty / Error */
.gif-picker-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #72767d;
    font-size: 14px;
    gap: 8px;
}

.gif-picker-empty-icon {
    font-size: 40px;
    opacity: 0.5;
}

/* Tenor attribution */
.gif-picker-attribution {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}

.gif-picker-attribution span {
    font-size: 10px;
    color: #5e6066;
    letter-spacing: 0.3px;
}

/* Responsive */
@media (max-width: 520px) {
    .gif-picker {
        width: calc(100vw - 20px);
        right: 10px;
        left: 10px;
        bottom: 55px;
    }
}
