/* ========================================
   Models Popup - Доступные модели
   ======================================== */

.models-info-trigger {
    font-size: 0.85rem;
    color: #09b6a2;
    cursor: pointer;
    opacity: 0.6;
    transition: all 0.3s ease;
    margin-left: 0.25rem;
    vertical-align: middle;
}

.models-info-trigger:hover {
    opacity: 1;
    transform: scale(1.15);
    color: #079383;
}

/* Overlay */
.models-popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 1rem;
}

.models-popup-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Popup container */
.models-popup {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(24px) saturate(1.4);
    -webkit-backdrop-filter: blur(24px) saturate(1.4);
    border-radius: 20px;
    width: 100%;
    max-width: 720px;
    max-height: 85vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow:
        0 25px 60px rgba(0, 0, 0, 0.12),
        0 0 0 1px rgba(255, 255, 255, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    transform: scale(0.92) translateY(20px);
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.models-popup-overlay.active .models-popup {
    transform: scale(1) translateY(0);
}

/* Header */
.models-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(226, 232, 240, 0.6);
    flex-shrink: 0;
    background: rgba(248, 250, 252, 0.6);
}

.models-popup-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.models-popup-header h3 i {
    color: #09b6a2;
    font-size: 1.25rem;
}

.models-popup-header-lottie {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
}

.models-popup-close {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid rgba(226, 232, 240, 0.8);
    background: rgba(241, 245, 249, 0.6);
    color: #64748b;
    font-size: 1.25rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    line-height: 1;
}

.models-popup-close:hover {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

/* Body */
.models-popup-body {
    overflow-y: auto;
    padding: 0.75rem 1.5rem 1rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(9, 182, 162, 0.3) transparent;
}

.models-popup-body::-webkit-scrollbar {
    width: 5px;
}

.models-popup-body::-webkit-scrollbar-track {
    background: transparent;
}

.models-popup-body::-webkit-scrollbar-thumb {
    background: rgba(9, 182, 162, 0.3);
    border-radius: 10px;
}

/* Category */
.models-category {
    margin-bottom: 0.875rem;
}

.models-category:last-child {
    margin-bottom: 0;
}

.models-category-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.5rem;
    padding: 0.375rem 0.75rem;
    border-radius: 10px;
    border: none;
}

.models-category-header i {
    font-size: 1rem;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 7px;
    flex-shrink: 0;
}

.models-category-header span {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
}

/* Category colors */
.models-category-header.cat-text {
    background: rgba(99, 102, 241, 0.08);
}

.models-category-header.cat-text i {
    background: rgba(99, 102, 241, 0.15);
    color: #6366f1;
}

.models-category-header.cat-text span {
    color: #5b5ecd;
}

.models-category-header.cat-image {
    background: rgba(236, 72, 153, 0.07);
}

.models-category-header.cat-image i {
    background: rgba(236, 72, 153, 0.15);
    color: #ec4899;
}

.models-category-header.cat-image span {
    color: #d44690;
}

.models-category-header.cat-edit {
    background: rgba(14, 165, 233, 0.07);
}

.models-category-header.cat-edit i {
    background: rgba(14, 165, 233, 0.15);
    color: #0ea5e9;
}

.models-category-header.cat-edit span {
    color: #0c8dbf;
}

.models-category-header.cat-video {
    background: rgba(245, 158, 11, 0.07);
}

.models-category-header.cat-video i {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.models-category-header.cat-video span {
    color: #d48a09;
}

/* Models grid */
.models-category-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.3rem;
}

/* Model item */
.model-popup-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.35rem 0.6rem;
    border-radius: 12px;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.model-popup-item:hover {
    background: rgba(9, 182, 162, 0.04);
    border-color: rgba(9, 182, 162, 0.12);
}

/* Model icon */
.model-popup-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    background: #f8fafc;
    border: 1px solid rgba(226, 232, 240, 0.8);
}

.model-popup-icon svg {
    width: 20px;
    height: 20px;
}

/* Model info */
.model-popup-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.model-popup-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: #1e293b;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.model-popup-desc {
    font-size: 0.75rem;
    color: #94a3b8;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Responsive — compact height for laptops */
@media (max-height: 900px) {
    .models-popup {
        max-height: 90vh;
    }

    .models-popup-header {
        padding: 0.75rem 1.5rem;
    }

    .models-popup-header-lottie {
        width: 28px;
        height: 28px;
    }

    .models-popup-header h3 {
        font-size: 1.15rem;
    }

    .models-popup-body {
        padding: 0.5rem 1.25rem 0.75rem;
    }

    .models-category {
        margin-bottom: 0.625rem;
    }

    .models-category-header {
        margin-bottom: 0.35rem;
        padding: 0.3rem 0.6rem;
    }

    .models-category-header i {
        width: 24px;
        height: 24px;
        font-size: 0.875rem;
    }

    .models-category-header span {
        font-size: 0.8rem;
    }

    .models-category-grid {
        gap: 0.15rem;
    }

    .model-popup-item {
        padding: 0.25rem 0.5rem;
        gap: 0.5rem;
    }

    .model-popup-icon {
        width: 28px;
        height: 28px;
    }

    .model-popup-icon svg {
        width: 17px;
        height: 17px;
    }

    .model-popup-name {
        font-size: 0.8125rem;
    }

    .model-popup-desc {
        font-size: 0.6875rem;
    }
}

/* Responsive — tablets & small desktops */
@media (max-width: 640px) {
    .models-popup {
        max-width: 100%;
        max-height: 90vh;
        border-radius: 16px;
    }

    .models-popup-header {
        padding: 0.75rem 1rem;
    }

    .models-popup-header h3 {
        font-size: 1.05rem;
        gap: 0.5rem;
    }

    .models-popup-header-lottie {
        width: 26px;
        height: 26px;
    }

    .models-popup-close {
        width: 32px;
        height: 32px;
        font-size: 1.1rem;
    }

    .models-popup-body {
        padding: 0.5rem 1rem 0.75rem;
    }

    .models-category {
        margin-bottom: 0.5rem;
    }

    .models-category-header {
        margin-bottom: 0.3rem;
        padding: 0.25rem 0.6rem;
    }

    .models-category-header i {
        width: 22px;
        height: 22px;
        font-size: 0.8rem;
        border-radius: 6px;
    }

    .models-category-header span {
        font-size: 0.75rem;
    }

    .models-category-grid {
        grid-template-columns: 1fr;
        gap: 0.1rem;
    }

    .model-popup-item {
        padding: 0.25rem 0.4rem;
        gap: 0.5rem;
        border-radius: 8px;
    }

    .model-popup-icon {
        width: 26px;
        height: 26px;
        border-radius: 6px;
    }

    .model-popup-icon svg {
        width: 16px;
        height: 16px;
    }

    .model-popup-name {
        font-size: 0.8rem;
    }

    .model-popup-desc {
        font-size: 0.65rem;
    }
}

/* Responsive — mobile phones */
@media (max-width: 480px) {
    .models-popup-overlay {
        padding: 0.5rem;
    }

    .models-popup {
        border-radius: 16px;
        max-height: 92vh;
        max-width: 100%;
    }

    .models-popup-header {
        padding: 0.75rem 1rem;
    }

    .models-popup-body {
        padding: 0.4rem 0.75rem 0.6rem;
    }

    /* Скрываем описания моделей на телефонах */
    .model-popup-desc {
        display: none;
    }

    .model-popup-name {
        font-size: 0.8rem;
        line-height: 1.4;
    }

    .models-category-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.1rem;
    }

    .model-popup-item {
        padding: 0.3rem 0.35rem;
        gap: 0.35rem;
    }

    .model-popup-icon {
        width: 24px;
        height: 24px;
    }

    .model-popup-icon svg {
        width: 15px;
        height: 15px;
    }

    .models-category {
        margin-bottom: 0.4rem;
    }

    .models-category-header {
        margin-bottom: 0.2rem;
        padding: 0.2rem 0.5rem;
    }

    .models-category-header i {
        width: 20px;
        height: 20px;
        font-size: 0.7rem;
        border-radius: 5px;
    }

    .models-category-header span {
        font-size: 0.7rem;
        letter-spacing: 0.04em;
    }
}

/* Responsive — very small phones */
@media (max-width: 360px) {
    .models-popup-header h3 {
        font-size: 0.95rem;
    }

    .models-category-grid {
        grid-template-columns: 1fr;
    }

    .model-popup-desc {
        display: none;
    }
}
