.gif-picker-overlay {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(8, 10, 18, 0.85);
backdrop-filter: blur(8px);
z-index: 1000;
display: flex;
align-items: center;
justify-content: center;
opacity: 0;
visibility: hidden;
transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.gif-picker-overlay.active {
opacity: 1;
visibility: visible;
}

.gif-picker-modal {
background: rgba(20, 24, 36, 0.98);
border: 1px solid rgba(255, 255, 255, 0.08);
border-radius: 14px;
width: 90%;
max-width: 600px;
max-height: 80vh;
display: flex;
flex-direction: column;
overflow: hidden;
transform: scale(0.85) translateY(20px);
transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.gif-picker-overlay.active .gif-picker-modal {
transform: scale(1) translateY(0);
}

.gif-picker-header {
display: flex;
align-items: center;
justify-content: space-between;
padding: 20px;
border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.gif-picker-header h3 {
color: white;
font-size: 1.2rem;
font-weight: 600;
margin: 0;
}

.gif-warning-banner {
display: flex;
align-items: center;
gap: 10px;
padding: 12px 20px;
background: rgba(245, 158, 11, 0.08);
border-bottom: 1px solid rgba(245, 158, 11, 0.2);
border-left: 3px solid rgba(245, 158, 11, 0.6);
}

.gif-warning-banner svg {
flex-shrink: 0;
color: rgba(245, 158, 11, 0.9);
}

.gif-warning-banner span {
color: rgba(255, 255, 255, 0.85);
font-size: 0.85rem;
line-height: 1.4;
}

.gif-picker-close {
background: transparent;
border: none;
color: rgba(255, 255, 255, 0.65);
cursor: pointer;
padding: 8px;
border-radius: 8px;
transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.gif-picker-close:hover {
color: white;
background: rgba(255, 255, 255, 0.1);
}

.gif-picker-search {
display: flex;
gap: 12px;
padding: 20px;
border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.gif-search-input {
flex: 1;
background: rgba(255, 255, 255, 0.04);
border: 1px solid rgba(255, 255, 255, 0.08);
border-radius: 12px;
padding: 12px 16px;
color: white;
font-size: 0.9rem;
transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.gif-search-input:focus {
outline: none;
border-color: rgba(245, 158, 11, 0.45);
background: rgba(255, 255, 255, 0.06);
box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.08);
}

.gif-search-input::placeholder {
color: rgba(255, 255, 255, 0.4);
}

.gif-search-btn {
background: linear-gradient(135deg, rgba(245, 158, 11, 0.8), rgba(217, 119, 6, 0.7));
border: 1px solid rgba(245, 158, 11, 0.3);
color: white;
cursor: pointer;
padding: 12px 16px;
border-radius: 12px;
font-size: 0.9rem;
font-weight: 500;
transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
display: flex;
align-items: center;
justify-content: center;
gap: 6px;
}

.gif-search-btn:hover {
background: linear-gradient(135deg, rgba(245, 158, 11, 0.9), rgba(217, 119, 6, 0.8));
border-color: rgba(245, 158, 11, 0.4);
transform: translateY(-1px);
}

.gif-picker-content {
flex: 1;
display: flex;
flex-direction: column;
overflow: hidden;
}

.gif-categories {
display: flex;
gap: 8px;
padding: 16px 20px;
border-bottom: 1px solid rgba(255, 255, 255, 0.07);
overflow-x: auto;
white-space: nowrap;
align-items: center;
scrollbar-width: none;
-ms-overflow-style: none;
}

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

.gif-category {
background: rgba(255, 255, 255, 0.04);
border: 1px solid rgba(255, 255, 255, 0.08);
color: rgba(255, 255, 255, 0.7);
cursor: pointer;
padding: 8px 16px;
border-radius: 20px;
font-size: 0.8rem;
font-weight: 500;
transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
white-space: nowrap;
flex: 0 0 auto;
display: inline-flex;
align-items: center;
justify-content: center;
min-height: 34px;
}

.gif-category:hover {
background: rgba(255, 255, 255, 0.08);
border-color: rgba(255, 255, 255, 0.15);
color: white;
}

.gif-category.active {
background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(217, 119, 6, 0.1));
border-color: rgba(245, 158, 11, 0.35);
color: rgba(251, 191, 36, 0.9);
}

.gif-grid {
flex: 1;
padding: 20px;
overflow-y: auto;
display: grid;
grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
grid-auto-rows: 120px;
gap: 10px;
align-items: stretch;
}

.gif-item {
position: relative;
aspect-ratio: 1 / 1;
border-radius: 8px;
overflow: hidden;
cursor: pointer;
transition: all 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94);
border: 2px solid transparent;
background: rgba(255,255,255,0.03);
display: flex;
align-items: center;
justify-content: center;
width: 100%;
height: 100%;
}

.gif-item:hover {
transform: scale(1.03);
border-color: rgba(245, 158, 11, 0.4);
}

.gif-item img {
max-width: 100%;
max-height: 100%;
width: auto;
height: auto;
object-fit: contain;
background: rgba(0,0,0,0.15);
display: block;
}

.gif-loading {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 40px 20px;
color: rgba(255, 255, 255, 0.6);
font-size: 0.9rem;
grid-column: 1 / -1;
}

.gif-loading-spinner {
width: 24px;
height: 24px;
border: 2px solid rgba(255, 255, 255, 0.1);
border-top: 2px solid rgba(245, 158, 11, 0.8);
border-radius: 50%;
animation: spin 1s linear infinite;
margin-bottom: 12px;
}

@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}

.gif-empty {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 40px 20px;
color: rgba(255, 255, 255, 0.6);
font-size: 0.9rem;
grid-column: 1 / -1;
}

.gif-empty-icon {
font-size: 2rem;
margin-bottom: 12px;
opacity: 0.4;
}

.gif-picker-footer {
padding: 10px 16px;
border-top: 1px solid rgba(255,255,255,0.07);
display: flex;
justify-content: flex-end;
}

.tenor-attrib {
color: rgba(255,255,255,0.6);
font-size: 0.8rem;
text-decoration: none;
}

.tenor-attrib:hover { color: rgba(255,255,255,0.85); }

.gif-error-message {
position: fixed;
top: 20px;
left: 20px;
right: 20px;
margin: 0 auto;
background: rgba(20, 24, 36, 0.98);
border: 1px solid rgba(239, 68, 68, 0.4);
border-radius: 10px;
padding: 12px 20px;
color: white;
font-size: 0.85rem;
z-index: 10000;
display: flex;
align-items: center;
gap: 10px;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
animation: slideInDown 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
width: fit-content;
max-width: calc(100vw - 40px);
}

.gif-error-message i {
flex-shrink: 0;
color: rgba(239, 68, 68, 0.9);
font-size: 1.1rem;
}

.gif-error-message.hide {
animation: slideOutUp 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes slideInDown {
from {
transform: translateY(-100%);
opacity: 0;
}
to {
transform: translateY(0);
opacity: 1;
}
}

@keyframes slideOutUp {
from {
transform: translateY(0);
opacity: 1;
}
to {
transform: translateY(-100%);
opacity: 0;
}
}

@media (max-width: 640px) {
.gif-picker-modal {
width: 95%;
max-height: 85vh;
}

.gif-picker-header {
padding: 16px;
}

.gif-picker-header h3 {
font-size: 1.1rem;
}

.gif-warning-banner {
padding: 10px 16px;
gap: 8px;
}

.gif-warning-banner span {
font-size: 0.8rem;
}

.gif-error-message {
padding: 10px 14px;
font-size: 0.8rem;
line-height: 1.3;
}

.gif-error-message span {
word-break: break-word;
}

.gif-error-message i {
font-size: 1rem;
}

.gif-picker-search {
padding: 16px;
gap: 8px;
}

.gif-search-input {
padding: 10px 14px;
font-size: 0.85rem;
}

.gif-search-btn {
padding: 10px 14px;
font-size: 0.85rem;
}

.gif-categories {
padding: 12px 16px;
gap: 6px;
}

.gif-category {
padding: 6px 12px;
font-size: 0.75rem;
}

.gif-grid {
padding: 16px;
grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
grid-auto-rows: 100px;
gap: 8px;
}
}
