/* =========================================================
   WC Aggregator — styles
   ========================================================= */

/* -------------------- Model grid -------------------- */
.wca-models-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.wca-columns-1 { grid-template-columns: repeat(1, minmax(0, 1fr)) !important; }
.wca-columns-2 { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
.wca-columns-3 { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
.wca-columns-4 { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }
.wca-columns-5 { grid-template-columns: repeat(5, minmax(0, 1fr)) !important; }
.wca-columns-6 { grid-template-columns: repeat(6, minmax(0, 1fr)) !important; }

/* -------------------- Model card -------------------- */
.wca-model-card {
    overflow: hidden;
    cursor: pointer;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    transition: transform .2s, box-shadow .2s;
}

.wca-model-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, .1);
}

.wca-model-image {
    display: block;
    width: 100%;
    height: 250px;
    object-fit: cover;
    background: #f5f5f5;
}

.wca-model-info { padding: 12px; }

.wca-model-name {
    margin: 0 0 8px;
    color: #333;
    font-size: 16px;
    font-weight: 700;
}

.wca-model-meta {
    margin-bottom: 5px;
    color: #666;
    font-size: 13px;
}

.wca-model-views { color: #999; font-size: 12px; }

.wca-online-badge,
.wca-offline-badge {
    display: inline-block;
    margin-bottom: 8px;
    padding: 3px 8px;
    border-radius: 3px;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
}

.wca-online-badge { background: #46b450; }
.wca-offline-badge { background: #999; }

/* -------------------- Modal -------------------- */
.wca-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, .7);
    box-sizing: border-box;
}

.wca-modal-overlay.wca-modal-open { display: flex; }

.wca-modal {
    position: relative;
    width: min(1100px, 94vw);
    max-height: 92vh;
    overflow: auto;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, .3);
}

.wca-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid #e0e0e0;
}

.wca-modal-title { margin: 0; font-size: 18px; font-weight: 700; }
.wca-modal-close { border: 0; background: transparent; font-size: 20px; line-height: 1; cursor: pointer; }
.wca-modal-body { padding: 16px; }
.wca-modal-top-html,
.wca-modal-bottom-html { margin-bottom: 15px; }

/* Video is intentionally above chat and uses all modal width. */
.wca-modal-main {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
    margin-top: 15px;
}

.wca-modal-video-block {
    position: relative;
    flex: 0 0 auto;
    width: 100%;
    max-width: 100%;
    aspect-ratio: 16 / 9;
    max-height: 70vh;
    overflow: hidden;
    padding: 0;
    background: #000;
    border-radius: 6px;
}

.wca-modal-video-block video,
.wca-modal-video-block iframe,
.wca-modal-video-block img,
.wca-modal-video-block .wca-modal-video-player,
.wca-modal-video-block .wca-modal-preview-image {
    display: block;
    width: 100% !important;
    height: 100% !important;
    max-width: 100%;
    max-height: none;
    border: 0 !important;
    background: #000;
}

/* Keeps vertical phone streams visible without cropping. */
.wca-modal-video-block video,
.wca-modal-video-block img,
.wca-modal-video-block .wca-modal-video-player,
.wca-modal-video-block .wca-modal-preview-image {
    object-fit: contain;
}

/* Chaturbate iframe scales to the video area; its cross-domain UI cannot be removed by CSS/JS. */
.wca-modal-video-block iframe { min-height: 0 !important; }

.wca-modal-video-placeholder {
    display: grid;
    width: 100%;
    height: 100%;
    place-items: center;
    color: #999;
    background: #f5f5f5;
    text-align: center;
}

.wca-modal-chat-block { width: 100%; min-width: 0; }

/* -------------------- Chat -------------------- */
.wca-chat-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e0e0e0;
}

.wca-chat-tab {
    padding: 8px 16px;
    border: 0;
    border-radius: 5px 5px 0 0;
    color: #666;
    background: #f5f5f5;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all .2s;
}

.wca-chat-tab:hover { background: #e8e8e8; }
.wca-chat-tab.active { color: #fff; background: #4caf50; }
.wca-chat-tab-public.active { background: #2196f3; }
.wca-chat-tab-private.active { background: #9c27b0; }
.wca-chat-tab-users.active { background: #ff9800; }

.wca-chat-container {
    margin-bottom: 15px;
    padding: 15px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
}

.wca-chat-messages {
    max-height: 300px;
    margin-bottom: 15px;
    padding: 10px;
    overflow-y: auto;
    background: #f9f9f9;
    border-radius: 5px;
}

.wca-chat-message {
    margin-bottom: 12px;
    padding: 10px;
    background: #fff;
    border-left: 3px solid #2196f3;
    border-radius: 5px;
}

.wca-chat-message:nth-child(even) { border-left-color: #4caf50; }
.wca-chat-meta { display: flex; justify-content: space-between; margin-bottom: 5px; color: #888; font-size: 12px; }
.wca-chat-user { color: #333; font-weight: 600; }
.wca-chat-time { color: #999; }
.wca-chat-body { color: #333; font-size: 14px; line-height: 1.4; }
.wca-chat-no-messages,
.wca-no-users { padding: 20px; color: #999; text-align: center; }

.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: 0;
}
.wca-chat-message-input:focus { border-color: #2196f3; }
.wca-chat-send-btn {
    padding: 10px 20px;
    border: 0;
    border-radius: 5px;
    color: #fff;
    background: #4caf50;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}
.wca-chat-send-btn:hover { background: #43a047; }

.wca-chat-users-panel {
    padding: 15px;
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
}
.wca-chat-users-panel h4 { margin: 0 0 10px; color: #666; font-size: 14px; }
.wca-chat-users-list { max-height: 300px; overflow-y: auto; }
.wca-chat-user-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    padding: 8px 12px;
    color: #333;
    background: #fff;
    border-radius: 5px;
    font-size: 14px;
}
.wca-chat-model-owner { background: #e3f2fd; border-left: 3px solid #2196f3; font-weight: 600; }
.wca-chat-user-badge { padding: 2px 8px; border-radius: 3px; color: #fff; background: #2196f3; font-size: 11px; font-weight: 600; }

/* -------------------- Modal meta and profile -------------------- */
.wca-modal-meta { margin-top: 15px; padding-top: 15px; border-top: 1px solid #e0e0e0; }
.wca-modal-meta-row { margin-bottom: 8px; color: #555; font-size: 13px; }
.wca-modal-meta-label { margin-right: 5px; font-weight: 700; }

.wca-model-profile { max-width: 600px; margin: 0 auto; padding: 20px; }
.wca-model-profile-avatar { width: 100%; max-width: 300px; height: auto; border-radius: 8px; }
.wca-model-profile-name { margin-top: 15px; font-size: 24px; }
.wca-model-profile-meta { margin-bottom: 20px; }
.wca-model-profile-actions button { padding: 10px 20px; font-size: 14px; cursor: pointer; }

/* -------------------- Referral buttons -------------------- */
.wca-ref-buttons { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.wca-ref-btn { display: inline-block; padding: 8px 16px; border-radius: 4px; color: #fff; background: #0073aa; font-size: 13px; text-decoration: none; }
.wca-ref-btn:hover { opacity: .9; }
.wca-ref-webmaster { background: #00a32a; }
.wca-ref-signup { background: #dc3232; }

/* -------------------- Aggregator widget -------------------- */
.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 { flex: 1 1 auto; font-weight: 600; }
.wca-aggr-site-total,
.wca-aggr-site-online { margin-left: 8px; white-space: nowrap; }

/* -------------------- Tag widgets and model filter -------------------- */
.wca-site-tags-list { display: flex; flex-wrap: wrap; gap: 7px; margin: 0; padding: 0; list-style: none; }
.wca-site-tag-item { margin: 0; padding: 0; }
.wca-site-tag-link { display: inline-block; padding: 5px 9px; border: 1px solid rgba(127, 127, 127, .35); border-radius: 5px; color: inherit; line-height: 1.2; text-decoration: none; }
.wca-site-tag-link:hover { opacity: .8; }
.wca-site-tag-count { opacity: .7; font-size: .9em; }

.wca-active-model-filter {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
    padding: 10px 14px;
    background: #f1f8fc;
    border-left: 4px solid #0073aa;
}
.wca-clear-model-filter { color: #b32d2e; text-decoration: none; }
.wca-clear-model-filter:hover { text-decoration: underline; }
.wca-no-models { width: 100%; padding: 20px; text-align: center; }

/* -------------------- Feedback -------------------- */
.wca-feedback { width: 100%; max-width: 1100px; margin: 30px auto; padding: 20px; box-sizing: border-box; background: #fff; border: 1px solid #ddd; border-radius: 8px; }
.wca-feedback-moderator-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 20px; }
.wca-feedback-users { padding-right: 15px; border-right: 1px solid #ddd; }
.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; color: #333; background: #fff; 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; color: #fff; background: #d63638; 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 { overflow-wrap: anywhere; color: #222; white-space: pre-wrap; }
.wca-feedback-message-date { margin-top: 6px; color: #888; text-align: right; font-size: 11px; }
.wca-feedback-form { display: flex; flex-direction: column; gap: 10px; }
.wca-feedback-form textarea { width: 100%; min-height: 85px; padding: 10px; box-sizing: border-box; border: 1px solid #ccc; border-radius: 5px; resize: vertical; }
.wca-feedback-form button { align-self: flex-end; padding: 10px 20px; border: 0; border-radius: 5px; color: #fff; background: #0073aa; 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; }

/* -------------------- Responsive -------------------- */
@media (max-width: 1024px) {
    .wca-models-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 768px) {
    .wca-models-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .wca-modal-overlay { padding: 0; }
    .wca-modal { width: 100vw; max-height: 100vh; min-height: 100vh; border-radius: 0; }
    .wca-modal-body { padding: 10px; }
    .wca-modal-video-block { aspect-ratio: 9 / 16; max-height: 75vh; }
    .wca-chat-messages { max-height: 250px; }
    .wca-chat-tab { flex: 1 1 auto; min-width: 80px; text-align: center; }
    .wca-chat-input-area { flex-direction: column; }
    .wca-chat-send-btn,
    .wca-ref-btn { width: 100%; }
    .wca-ref-buttons { flex-direction: column; }
    .wca-modal-title { font-size: 16px; }
    .wca-modal-meta-row { font-size: 12px; }
    .wca-feedback-moderator-layout { display: block; }
    .wca-feedback-users { margin-bottom: 20px; padding: 0 0 15px; border-right: 0; border-bottom: 1px solid #ddd; }
    .wca-feedback-message { max-width: 90%; }
}

@media (max-width: 480px) {
    .wca-models-grid { grid-template-columns: 1fr; }
    .wca-model-image { height: 200px; }
    .wca-chat-messages { max-height: 200px; }
    .wca-chat-tab { flex: 1 1 45%; }
}

@media (max-width: 768px) and (orientation: landscape) {
    .wca-modal-video-block { aspect-ratio: 16 / 9; max-height: 55vh; }
    .wca-chat-messages { max-height: 150px; }
}

/* =========================================================
   MODAL ACTIONS
   ========================================================= */

.wca-modal-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.wca-ref-buttons,
.wca-model-profile-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.wca-modal-action-btn,
.wca-subscribe-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 8px 16px;
    border: 0;
    border-radius: 4px;
    color: #fff;
    background: #0073aa;
    font-size: 13px;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
}

.wca-modal-profile-btn {
    background: #dc3232;
}

.wca-modal-action-btn:hover,
.wca-subscribe-btn:hover {
    opacity: .88;
    color: #fff;
}

.wca-subscribe-btn {
    margin-top: 10px;
}

@media (max-width: 768px) {
    .wca-ref-buttons,
    .wca-model-profile-buttons {
        flex-direction: column;
    }

    .wca-ref-btn,
    .wca-modal-action-btn,
    .wca-subscribe-btn {
        width: 100%;
        box-sizing: border-box;
        text-align: center;
    }
}

/* =========================================================
   SUBSCRIBED MODELS
   ========================================================= */

.wca-subscribed-models {
    margin: 0 0 35px;
    padding: 18px;
    border: 1px solid #cfe7d3;
    border-radius: 10px;
    background: #f4fff5;
}

.wca-subscribed-models-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 5px;
}

.wca-subscribed-models-title {
    margin: 0;
    color: #176b2c;
    font-size: 22px;
}

.wca-subscribed-models-count {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 20px;
    color: #fff;
    background: #46b450;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

.wca-subscribed-models .wca-models-grid {
    margin-bottom: 0;
}

@media (max-width: 600px) {
    .wca-subscribed-models {
        padding: 12px;
    }

    .wca-subscribed-models-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .wca-subscribed-models-title {
        font-size: 18px;
    }
}