/* ================= FILTER BAR (2 üst, 1 alt) ================= */
.filters {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin: 16px 10px;
    padding: 12px 14px;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

/* Selectlər yuxarıda */
.filters select {
    grid-row: 1;
}

/* Axtarış altda və ortada */
#search-box {
    grid-column: 1 / -1;   /* bütün eni tutsun */
    text-align: center;
}

/* Select & Input */
.filters select,
.filters input {
    border: 1px solid #ddd;
    background: #f9f9f9;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    outline: none;
    transition: all 0.2s ease;
}

/* Hover */
.filters select:hover,
.filters input:hover {
    border-color: #2575fc;
}

/* Focus */
.filters select:focus,
.filters input:focus {
    border-color: #2575fc;
    box-shadow: 0 0 0 2px rgba(37,117,252,0.15);
}

/* AI Button */
#ai-btn {
    position: fixed;
    bottom: 200px; /* WhatsApp-dan yuxarı */
    right: 20px;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: linear-gradient(135deg, #079, #2575fc);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: transform 0.2s;
}
#ai-btn:hover {
    transform: scale(1.1);
}

#search-box {
    color: #222;
    font-weight: 600;
    letter-spacing: 0.3px;
    text-align: center;
}

#search-box::placeholder {
    color: #999;
    font-weight: 500;
}

#search-box:focus {
    background: #fff;
}

#search-box:not(:placeholder-shown) {
    border-color: #2575fc;
    box-shadow: 0 0 0 2px rgba(37,117,252,0.15);
}

/* ================= AI MODAL DESIGN ================= */
.ai-modal {
    display: none;
    position: fixed;
    z-index: 10001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    justify-content: center;
    align-items: center;
    background: rgba(0,0,0,0.45);
    backdrop-filter: blur(3px);
    animation: fadeIn 0.3s ease forwards;
}

.ai-modal-content {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%); /* tam mərkəz */
    width: 360px;
    max-height: 500px;
    background: #fff;
    border-radius: 20px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 12px 30px rgba(0,0,0,0.35);
    overflow: hidden;
}

.ai-modal-content h3 {
    margin: 0 0 10px 0;
    font-size: 18px;
    color: #333;
    text-align: center;
}

.ai-chat-box {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 10px;
    padding: 10px;
    border-radius: 15px;
    border: 1px solid #eee;
    background: #f9f9f9;
    display: flex;
    flex-direction: column;
    gap: 5px;
    scroll-behavior: smooth;
}

/* Scrollbar */
.ai-chat-box::-webkit-scrollbar {
    width: 6px;
}
.ai-chat-box::-webkit-scrollbar-thumb {
    background: #6a11cb;
    border-radius: 3px;
}

/* Input container */
.ai-modal-content input,
.ai-modal-content button {
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
}

#ai-input {
    flex: 1;
    padding: 10px 12px;
    border-radius: 15px;
    border: 1px solid #ccc;
    outline: none;
}

#ai-send {
    margin-left: 8px;
    padding: 10px 12px;
    border-radius: 15px;
    border: none;
    background: linear-gradient(135deg, #079, #2575fc);
    color: #fff;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}
#ai-send:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(106,17,203,0.5);
}

/* Close button */
.close-modal {
    position: absolute;
    top: 10px;
    right: 15px;
    cursor: pointer;
    font-size: 22px;
    color: #999;
    transition: color 0.2s;
}
.close-modal:hover {
    color: #6a11cb;
}

/* User & AI messages */
.user-msg {
    align-self: flex-end;
    background: linear-gradient(135deg, #6a11cb, #2575fc);
    color: #fff;
    padding: 8px 12px;
    border-radius: 15px 15px 5px 15px;
    max-width: 80%;
    animation: popIn 0.2s ease;
}

.ai-msg {
    align-self: flex-start;
    background: #f1f1f1;
    color: #333;
    padding: 8px 12px;
    border-radius: 15px 15px 15px 5px;
    max-width: 80%;
    animation: popIn 0.2s ease;
}

/* Animations */
@keyframes fadeIn {
    from {opacity:0;}
    to {opacity:1;}
}
@keyframes slideUp {
    from {transform: translateY(20px); opacity:0;}
    to {transform: translateY(0); opacity:1;}
}
@keyframes popIn {
    0% {transform: scale(0.9); opacity:0;}
    100% {transform: scale(1); opacity:1;}
}

.ai-msg.placeholder {
    color: #888;
    font-style: bold;
}

.category-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    margin: 20px 0;
    padding: 0 10px;
    overflow-x: auto; /* mobil scroll */
}

.category-buttons::-webkit-scrollbar {
    height: 6px;
}

.category-buttons::-webkit-scrollbar-thumb {
    background: #6a11cb;
    border-radius: 3px;
}

.category-btn {
    flex: 0 0 auto; /* mobil scroll üçün */
    padding: 10px 14px;
    background: linear-gradient(135deg, #079, #2575fc);
    color: #fff;
    font-weight: 600;
    border-radius: 12px;
    text-decoration: none;
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
    white-space: nowrap;
}

.category-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 15px rgba(0,0,0,0.3);
}

/* Desktop: daha böyük ekranlarda mərkəzləşmiş grid */
@media(min-width: 768px) {
    .category-buttons {
        justify-content: center;
    }
    .category-btn {
        padding: 14px 22px;
        font-size: 16px;
    }
}