/* ========================================
   СЕТКА МОДЕЛЕЙ
   ======================================== */

.wca-models-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin: 20px 0;
}

.wca-columns-1 { grid-template-columns: repeat(1, 1fr) !important; }
.wca-columns-2 { grid-template-columns: repeat(2, 1fr) !important; }
.wca-columns-3 { grid-template-columns: repeat(3, 1fr) !important; }
.wca-columns-4 { grid-template-columns: repeat(4, 1fr) !important; }
.wca-columns-5 { grid-template-columns: repeat(5, 1fr) !important; }
.wca-columns-6 { grid-template-columns: repeat(6, 1fr) !important; }

@media (max-width: 1024px) {
    .wca-models-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .wca-models-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .wca-models-grid {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   КАРТОЧКА МОДЕЛИ
   ======================================== */

.wca-model-card {
    position: relative;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.wca-model-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

/* Контейнер под изображение — одинаковый для всех карточек */
.wca-model-avatar {
    position: relative;
    width: 100%;
    /* Пропорция: 3 по ширине, 4 по высоте */
    aspect-ratio: 3 / 4;
    overflow: hidden;
    background: #f5f5f5;
}

/* Сама картинка */
.wca-model-avatar img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;      /* заполняет контейнер, обрезая лишнее */
    object-position: center;
    display: block;
}

/* Бейдж онлайна */
.wca-online-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    background: #4caf50;
    color: #fff;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: bold;
    z-index: 2;
}

.wca-offline-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: bold;
    margin-bottom: 8px;
    background: #999;
    color: #fff;
}

/* Блок с информацией под картинкой */
.wca-model-info {
    padding: 12px;
    flex: 1 1 auto;
}

.wca-model-name {
    font-size: 16px;
    font-weight: bold;
    margin: 0 0 8px 0;
    color: #333;
}

.wca-model-meta {
    font-size: 13px;
    color: #666;
    margin-bottom: 5px;
}

.wca-model-views {
    font-size: 12px;
    color: #999;
}

/* Старый класс .wca-model-image оставляем для совместимости,
   но теперь он не обязателен */
.wca-model-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #f5f5f5;
    display: block;
}

/* ========================================
   МОДАЛКА
   ======================================== */

.wca-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.72);
    box-sizing: border-box;
}

.wca-modal-overlay.wca-modal-open {
    display: flex;
}

.wca-modal {
    position: relative;
    display: flex;
    flex-direction: column;
    width: min(1200px, 100%);
    max-width: 1200px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0 20px 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    box-sizing: border-box;
}

.wca-modal-header {
    display: flex;
    align-items: center;
    min-height: 58px;
    padding: 12px 48px 12px 0;
    border-bottom: 1px solid #e0e0e0;
    box-sizing: border-box;
}

.wca-modal-title {
    margin: 0;
    color: #333;
    font-size: 20px;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.wca-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 5;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: #333;
    font-size: 28px;
    line-height: 36px;
    text-align: center;
    cursor: pointer;
}

.wca-modal-close:hover {
    background: #f0f0f0;
}

.wca-modal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}

.wca-modal-profile-btn,
.wca-subscribe-btn {
    display: inline-block;
    min-height: 38px;
    padding: 9px 14px;
    border: 0;
    border-radius: 4px;
    font-size: 14px;
    line-height: 20px;
    text-decoration: none;
    cursor: pointer;
    box-sizing: border-box;
}

.wca-modal-profile-btn {
    background: #0073aa;
    color: #fff;
}

.wca-modal-profile-btn:hover {
    background: #005f8d;
    color: #fff;
}

.wca-subscribe-btn {
    background: #0073aa;
    color: #fff;
}

.wca-subscribe-btn:hover {
    background: #005f8d;
}

.wca-modal-top-html,
.wca-modal-bottom-html {
    width: 100%;
    margin-top: 15px;
    overflow-wrap: anywhere;
}

.wca-modal-main {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: start;
    gap: 20px;
    width: 100%;
    margin-top: 15px;
    box-sizing: border-box;
}

.wca-modal-video-block,
.wca-modal-chat-block {
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
}

.wca-modal-video-block {
    overflow: hidden;
}

.wca-modal-chat-block {
    overflow: hidden;
}

.wca-modal-video-player {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: 430px;
    background: #000;
    border-radius: 6px;
    object-fit: contain;
}

.wca-modal-iframe {
    display: block;
    width: 100%;
    height: 420px;
    max-width: 100%;
    border: 0;
    border-radius: 6px;
    background: #000;
}

.wca-modal-preview-image {
    display: block;
    width: 100%;
    max-width: 100%;
    max-height: 430px;
    object-fit: cover;
    border-radius: 6px;
}

.wca-modal-video-placeholder {
    width: 100%;
    padding: 40px 15px;
    background: #f5f5f5;
    border-radius: 6px;
    color: #999;
    text-align: center;
    box-sizing: border-box;
}

.wca-modal-meta {
    width: 100%;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
    box-sizing: border-box;
}

.wca-modal-meta-row {
    margin-bottom: 8px;
    color: #555;
    font-size: 13px;
    overflow-wrap: anywhere;
}

.wca-modal-meta-label {
    margin-right: 5px;
    font-weight: 700;
}

@media (max-width: 768px) {
    .wca-modal-overlay {
        align-items: flex-start;
        padding: 0;
    }

    .wca-modal {
        width: 100%;
        max-width: 100%;
        height: 100%;
        max-height: 100%;
        padding: 0 10px 15px;
        border-radius: 0;
    }

    .wca-modal-header {
        min-height: 52px;
        padding-right: 42px;
    }

    .wca-modal-title {
        font-size: 17px;
    }

    .wca-modal-main {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .wca-modal-video-block,
    .wca-modal-chat-block {
        width: 100%;
        min-width: 0;
    }

    .wca-modal-iframe {
        height: 320px;
    }

    .wca-modal-video-player {
        max-height: 320px;
    }

    .wca-modal-preview-image {
        max-height: 320px;
    }

    .wca-chat-messages {
        max-height: 250px;
    }
}

/* ========================================
   ВИДЕО И ЧАТ (ОБЩАЯ РАЗМЕТКА)
   ======================================== */

.wca-modal-main {
    display: flex;
    gap: 15px;
    margin-top: 15px;
}

.wca-modal-video-block {
    flex: 2;
    min-width: 0;
}

.wca-modal-chat-block {
    flex: 1;
    min-width: 0;
}

.wca-modal-video-player {
    width: 100%;
    max-height: 400px;
    background: #000;
    border-radius: 6px;
}

.wca-modal-preview-image {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
    border-radius: 6px;
}

.wca-modal-video-placeholder {
    background: #f5f5f5;
    padding: 40px;
    text-align: center;
    color: #999;
    border-radius: 6px;
}

/* ========================================
   CHAT
   ======================================== */

.wca-chat-tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 15px;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 10px;
    flex-wrap: wrap;
}

.wca-chat-tab {
    padding: 8px 16px;
    border: none;
    background: #f5f5f5;
    cursor: pointer;
    border-radius: 5px 5px 0 0;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    transition: all 0.2s;
}

.wca-chat-tab:hover {
    background: #e8e8e8;
}

.wca-chat-tab.active {
    background: #4CAF50;
    color: white;
}

.wca-chat-tab-public.active {
    background: #2196F3;
}

.wca-chat-tab-private.active {
    background: #9C27B0;
}

.wca-chat-tab-users.active {
    background: #FF9800;
}

.wca-chat-container {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
}

.wca-chat-messages {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 15px;
    padding: 10px;
    background: #f9f9f9;
    border-radius: 5px;
}

.wca-chat-message {
    margin-bottom: 12px;
    padding: 10px;
    background: #fff;
    border-radius: 5px;
    border-left: 3px solid #2196F3;
}

.wca-chat-message:nth-child(even) {
    border-left-color: #4CAF50;
}

.wca-chat-meta {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    font-size: 12px;
    color: #888;
}

.wca-chat-user {
    font-weight: 600;
    color: #333;
}

.wca-chat-time {
    color: #999;
}

.wca-chat-body {
    font-size: 14px;
    color: #333;
    line-height: 1.4;
}

.wca-chat-no-messages {
    text-align: center;
    color: #999;
    padding: 20px;
}

.wca-chat-input-area {
    display: flex;
    gap: 10px;
}

.wca-chat-message-input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.wca-chat-message-input:focus {
    border-color: #2196F3;
}

.wca-chat-send-btn {
    padding: 10px 20px;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.2s;
}

.wca-chat-send-btn:hover {
    background: #43A047;
}

.wca-chat-users-panel {
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
}

.wca-chat-users-panel h4 {
    margin: 0 0 10px 0;
    font-size: 14px;
    color: #666;
}

.wca-chat-users-list {
    max-height: 300px;
    overflow-y: auto;
}

.wca-chat-user-item {
    padding: 8px 12px;
    background: #fff;
    border-radius: 5px;
    margin-bottom: 8px;
    font-size: 14px;
    color: #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.wca-chat-model-owner {
    background: #E3F2FD;
    border-left: 3px solid #2196F3;
    font-weight: 600;
}

.wca-chat-user-badge {
    background: #2196F3;
    color: white;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
}

.wca-no-users {
    text-align: center;
    color: #999;
    padding: 10px;
}

/* ========================================
   МЕТА ДАННЫЕ
   ======================================== */

.wca-modal-meta {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
}

.wca-modal-meta-row {
    margin-bottom: 8px;
    font-size: 13px;
    color: #555;
}

.wca-modal-meta-label {
    font-weight: bold;
    margin-right: 5px;
}

/* ========================================
   ПРОФИЛЬ МОДЕЛИ
   ======================================== */

.wca-model-profile {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
}

.wca-model-profile-avatar {
    max-width: 300px;
    width: 100%;
    height: auto;
    border-radius: 8px;
}

.wca-model-profile-name {
    font-size: 24px;
    margin-top: 15px;
}

.wca-model-profile-meta {
    margin-bottom: 20px;
}

.wca-model-profile-actions button {
    padding: 10px 20px;
    font-size: 14px;
    cursor: pointer;
}

/* ========================================
   РЕФЕРАЛЬНЫЕ КНОПКИ
   ======================================== */

.wca-ref-buttons {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.wca-ref-btn {
    padding: 8px 16px;
    background: #0073aa;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font-size: 13px;
    display: inline-block;
}

.wca-ref-btn:hover {
    opacity: 0.9;
}

.wca-ref-webmaster {
    background: #00a32a;
}

.wca-ref-signup {
    background: #dc3232;
}

/* ========================================
   ВИДЖЕТ АГРЕГАТОРА
   ======================================== */

.wca-aggregator-widget {
    font-size: 14px;
}

.wca-aggr-loading {
    color: #888;
    font-style: italic;
}

.wca-aggr-sites {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.wca-aggr-site-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 4px 0;
    border-bottom: 1px solid #eee;
}

.wca-aggr-site-name {
    font-weight: 600;
    flex: 1 1 auto;
}

.wca-aggr-site-total,
.wca-aggr-site-online {
    white-space: nowrap;
    margin-left: 8px;
}

/* ========================================
   АДАПТИВ (МОБИЛЬНЫЕ)
   ======================================== */

/* Мобильные: видео сверху, чат снизу */
@media (max-width: 768px) {
    .wca-modal {
        width: 100vw;
        max-width: 100vw;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
        margin: 0;
    }

    .wca-modal-body {
        padding: 10px;
    }

    /* Вертикальная раскладка: видео сверху, чат снизу */
    .wca-modal-main {
        flex-direction: column;
        gap: 10px;
    }

    .wca-modal-video-block,
    .wca-modal-chat-block {
        flex: none;
        width: 100%;
    }

    .wca-modal-video-player,
    .wca-modal-preview-image {
        max-height: 300px;
    }

    .wca-chat-messages {
        max-height: 250px;
    }

    .wca-chat-tabs {
        flex-wrap: wrap;
    }

    .wca-chat-tab {
        flex: 1 1 auto;
        text-align: center;
        min-width: 80px;
    }

    .wca-chat-input-area {
        flex-direction: column;
    }

    .wca-chat-send-btn {
        width: 100%;
    }

    .wca-ref-buttons {
        flex-direction: column;
    }

    .wca-ref-btn {
        width: 100%;
        text-align: center;
    }

    .wca-modal-title {
        font-size: 16px;
    }

    .wca-modal-meta-row {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .wca-modal-video-player,
    .wca-modal-preview-image {
        max-height: 250px;
    }

    .wca-chat-messages {
        max-height: 200px;
    }

    .wca-chat-tab {
        flex: 1 1 45%;
    }
}

@media (max-width: 768px) and (orientation: landscape) {
    .wca-modal-video-player,
    .wca-modal-preview-image {
        max-height: 200px;
    }

    .wca-chat-messages {
        max-height: 150px;
    }
}

/* ========================================
   FEEDBACK
   ======================================== */

.wca-feedback {
    width: 100%;
    max-width: 1100px;
    margin: 30px auto;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fff;
    box-sizing: border-box;
}

.wca-feedback-moderator-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 20px;
}

.wca-feedback-users {
    border-right: 1px solid #ddd;
    padding-right: 15px;
}

.wca-feedback-users h3 {
    margin: 0 0 15px;
}

.wca-feedback-users-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.wca-feedback-user {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background: #fff;
    color: #333;
    text-align: left;
    cursor: pointer;
}

.wca-feedback-user:hover,
.wca-feedback-user.is-active {
    border-color: #0073aa;
    background: #eef7fb;
}

.wca-feedback-user b {
    min-width: 22px;
    padding: 2px 6px;
    border-radius: 12px;
    background: #d63638;
    color: #fff;
    text-align: center;
    font-size: 12px;
}

.wca-feedback-chat {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.wca-feedback-chat-header {
    min-height: 40px;
    padding-bottom: 12px;
    border-bottom: 1px solid #ddd;
}

.wca-feedback-messages {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 350px;
    max-height: 500px;
    padding: 15px 0;
    overflow-y: auto;
}

.wca-feedback-message {
    max-width: 75%;
    padding: 10px 13px;
    border-radius: 8px;
    background: #f0f0f0;
}

.wca-feedback-message.is-own {
    align-self: flex-end;
    background: #dff1ff;
}

.wca-feedback-message.is-other {
    align-self: flex-start;
}

.wca-feedback-message-author {
    margin-bottom: 4px;
    color: #555;
    font-size: 12px;
    font-weight: 600;
}

.wca-feedback-message-text {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    color: #222;
}

.wca-feedback-message-date {
    margin-top: 6px;
    color: #888;
    font-size: 11px;
    text-align: right;
}

.wca-feedback-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.wca-feedback-form textarea {
    width: 100%;
    min-height: 85px;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    resize: vertical;
    box-sizing: border-box;
}

.wca-feedback-form button {
    align-self: flex-end;
    padding: 10px 20px;
    border: 0;
    border-radius: 5px;
    background: #0073aa;
    color: #fff;
    cursor: pointer;
}

.wca-feedback-form button:disabled {
    opacity: .6;
    cursor: wait;
}

.wca-feedback-form-message {
    font-size: 14px;
}

.wca-feedback-form-message.is-success {
    color: #176b2c;
}

.wca-feedback-form-message.is-error {
    color: #b32d2e;
}

.wca-feedback-empty,
.wca-feedback-loading {
    padding: 20px;
    color: #777;
    text-align: center;
}

@media screen and (max-width: 700px) {
    .wca-feedback-moderator-layout {
        display: block;
    }

    .wca-feedback-users {
        margin-bottom: 20px;
        padding-right: 0;
        padding-bottom: 15px;
        border-right: 0;
        border-bottom: 1px solid #ddd;
    }

    .wca-feedback-message {
        max-width: 90%;
    }
}

/* ========================================
   МОИ ПОДПИСКИ
   ======================================== */

.wca-my-subscriptions-block {
    margin: 30px 0 40px;
}

.wca-my-subscriptions-title {
    margin: 0 0 15px;
    font-size: 20px;
    color: #333;
}

/* Лёгкая цветная обводка для карточек подписок */
.wca-subscribed-card {
    position: relative;
}

.wca-subscribed-card::before {
    content: "";
    position: absolute;
    inset: -2px;
    border-radius: 10px;
    background: linear-gradient(135deg, #0073aa, #00a0d2);
    z-index: -1;
    opacity: 0.25;
    transition: opacity 0.2s ease;
}

.wca-subscribed-card:hover::before {
    opacity: 0.5;
}