/* =========================================
   Arquivo: filex/css/meus-assinantes.css
   XONA — MEUS ASSINANTES
   Requer main.css carregado antes.
   ========================================= */

/* =========================================
   BODY — sem sidebar direita
   ========================================= */
body.subscribers-body .main-content {
    margin-right: 0 !important;
    max-width: none !important;
}

.subscribers-page {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding-bottom: 24px;
    margin-top: 2%;
}

/* =========================================
   TÍTULO + PESQUISA
   ========================================= */
.subscribers-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}
.subscribers-title-block h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
}
.subscribers-title-block p {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
}
.subscribers-search { min-width: 280px; }

/* =========================================
   TABS
   ========================================= */
.subscribers-tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: thin;
    scrollbar-color: #30363d transparent;
}
.subscribers-tabs::-webkit-scrollbar { height: 4px; }
.subscribers-tabs::-webkit-scrollbar-thumb {
    background: #30363d;
    border-radius: 999px;
}

.sub-tab {
    flex-shrink: 0;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    padding: 9px 18px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.sub-tab:hover {
    border-color: var(--accent-pink);
    color: var(--accent-pink);
}
.sub-tab.active {
    background-color: var(--accent-pink);
    border-color: var(--accent-pink);
    color: #fff;
}

/* =========================================
   CONTADOR
   ========================================= */
.subscribers-counter {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    padding: 6px 14px;
    align-self: flex-start;
}
.subscribers-count-label {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}
.subscribers-count {
    font-size: 13px;
    font-weight: 700;
    color: var(--accent-pink);
}

/* =========================================
   TABELA (DESKTOP)
   ========================================= */
.subscribers-table-wrapper {
    width: 100%;
    max-width: 100%;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-sizing: border-box;
}

.subscribers-table {
    width: 100%;
    max-width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    font-size: 13.5px;
}

.subscribers-table col.col-subscritor { width: 32%; }
.subscribers-table col.col-data       { width: 14%; }
.subscribers-table col.col-intervalo  { width: 15%; }
.subscribers-table col.col-termina    { width: 22%; }
.subscribers-table col.col-estado     { width: 17%; }

.subscribers-table thead { background-color: var(--bg-dark); }

.subscribers-table th {
    text-align: left;
    font-size: 11.5px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.subscribers-table td {
    padding: 14px 18px;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
    overflow: hidden;
    text-overflow: ellipsis;
}

.subscribers-table tbody tr:last-child td { border-bottom: none; }

.sub-row {
    cursor: pointer;
    transition: background-color 0.15s;
}
.sub-row:hover { background-color: var(--bg-dark); }

.subscribers-table th.right,
.subscribers-table td.right {
    text-align: right;
    overflow: visible;
}

/* "Termina em" — quebra controlada */
.subscribers-table td.sub-cell[data-label="Termina em"] {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    line-height: 1.35;
}

/* "Estado" — nunca corta */
.subscribers-table td.sub-cell.right {
    white-space: nowrap;
}

/* =========================================
   CÉLULA — SUBSCRITOR
   ========================================= */
.sub-creator-cell {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}
.sub-avatar-wrapper {
    position: relative;
    flex-shrink: 0;
}
.sub-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--accent-pink);
    background-color: var(--bg-dark);
}
.sub-online {
    position: absolute;
    bottom: 1px;
    right: 1px;
    width: 11px;
    height: 11px;
    background-color: #22c55e;
    border-radius: 50%;
    border: 2px solid var(--bg-card);
}
.sub-creator-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}
.sub-creator-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}
.sub-creator-username {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* =========================================
   ESTADO
   ========================================= */
.sub-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 999px;
    white-space: nowrap;
    max-width: 100%;
}
.sub-status.active {
    background-color: rgba(34, 197, 94, 0.1);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.3);
}
.sub-status.expired {
    background-color: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* =========================================
   PAGINAÇÃO
   ========================================= */
.subscribers-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.page-btn {
    min-width: 38px;
    height: 38px;
    padding: 0 12px;
    border-radius: 10px;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}
.page-btn:hover:not(:disabled) {
    border-color: var(--accent-pink);
    color: var(--accent-pink);
}
.page-btn.active {
    background-color: var(--accent-pink);
    border-color: var(--accent-pink);
    color: #fff;
}
.page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
.page-btn i { font-size: 12px; }

/* =========================================
   CLASSES MOBILE
   ========================================= */
.sub-mobile-actions,
.sub-mobile-meta {
    display: none;
}

/* =========================================
   BREAKPOINT INTERMÉDIO (1201–1400px)
   ========================================= */
@media (min-width: 1201px) and (max-width: 1400px) {

    .subscribers-table th,
    .subscribers-table td { padding: 11px 12px; }

    .subscribers-table th { font-size: 10.5px; }
    .subscribers-table { font-size: 12.5px; }

    .sub-avatar { width: 38px; height: 38px; }
    .sub-creator-name { font-size: 13px; }
    .sub-creator-username { font-size: 11px; }
    .sub-creator-cell { gap: 10px; }

    .sub-status { font-size: 11px; padding: 3px 10px; }
}

/* =========================================
   MOBILE
   ========================================= */
@media (max-width: 768px) {

    body.subscribers-body .main-content {
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding: 0 !important;
    }

    .subscribers-page {
        padding: 0 10px 130px;
        gap: 14px;
    }

    .subscribers-top { flex-direction: column; gap: 12px; }
    .subscribers-title-block h1 { font-size: 22px; }
    .subscribers-title-block p { font-size: 12px; }
    .subscribers-search { min-width: 0; width: 100%; padding: 11px 16px; }

    .subscribers-tabs { padding-bottom: 6px; gap: 6px; }
    .sub-tab { font-size: 12.5px; padding: 8px 14px; }

    .subscribers-counter { padding: 5px 12px; }
    .subscribers-count-label { font-size: 11px; }
    .subscribers-count { font-size: 12px; }

    /* =====================================
       TABELA → CARDS
       ===================================== */
    .subscribers-table-wrapper {
        background: transparent;
        border: none;
        border-radius: 0;
        overflow: visible;
    }
    .subscribers-table { table-layout: auto; }
    .subscribers-table thead { display: none; }
    .subscribers-table,
    .subscribers-table tbody,
    .subscribers-table tr,
    .subscribers-table td {
        display: block;
        width: 100%;
    }
    .subscribers-table tbody {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .sub-row {
        background-color: var(--bg-card);
        border: 1px solid var(--border-color);
        border-radius: 16px;
        padding: 14px;
        display: flex;
        flex-direction: column;
        gap: 12px;
        cursor: pointer;
    }
    .sub-row:hover { background-color: var(--bg-card); }

    .subscribers-table td {
        padding: 0;
        border-bottom: none;
        overflow: visible;
        text-overflow: clip;
        white-space: normal;
    }

    /* Primeira <td> = cabeçalho + meta */
    .sub-row > td:first-child {
        display: flex;
        flex-direction: column;
        gap: 12px;
        width: 100%;
    }

    /* Cabeçalho */
    .sub-creator-cell {
        display: flex;
        align-items: center;
        gap: 12px;
        width: 100%;
        min-width: 0;
    }

    .sub-avatar-wrapper {
        position: relative;
        flex-shrink: 0;
        width: 46px;
        height: 46px;
    }
    .sub-avatar {
        width: 46px;
        height: 46px;
        border-radius: 50%;
        object-fit: cover;
        border: 2px solid var(--accent-pink);
        background-color: var(--bg-dark);
        display: block;
    }
    .sub-online {
        position: absolute;
        bottom: 1px;
        right: 1px;
        width: 12px;
        height: 12px;
        background-color: #22c55e;
        border-radius: 50%;
        border: 2px solid var(--bg-card);
    }

    .sub-creator-info { flex: 1; min-width: 0; }
    .sub-creator-name {
        font-size: 15px;
        font-weight: 700;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .sub-creator-username { font-size: 12px; }

    /* Ações à direita: ⋮ e › */
    .sub-mobile-actions {
        display: flex;
        align-items: center;
        gap: 10px;
        flex-shrink: 0;
        margin-left: auto;
    }
    .sub-mobile-menu,
    .sub-mobile-arrow {
        width: 30px;
        height: 30px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        background: transparent;
        border: none;
        color: var(--text-secondary);
        font-size: 15px;
        cursor: pointer;
        transition: all 0.2s;
    }
    .sub-mobile-menu:hover,
    .sub-mobile-arrow:hover {
        color: var(--accent-pink);
        background-color: var(--bg-dark);
    }

    /* Meta */
    .sub-mobile-meta {
        display: flex;
        flex-direction: column;
        gap: 8px;
        width: 100%;
        padding-top: 12px;
        border-top: 1px solid var(--border-color);
    }
    .sub-mobile-meta-row {
        display: flex;
        align-items: center;
        gap: 10px;
        width: 100%;
    }
    .sub-mobile-meta-icon {
        width: 18px;
        height: 18px;
        display: flex;
        align-items: center;
        justify-content: center;
        color: var(--accent-pink);
        font-size: 13px;
        flex-shrink: 0;
    }
    .sub-mobile-meta-label {
        font-size: 11px;
        font-weight: 600;
        color: var(--text-muted);
        text-transform: uppercase;
        letter-spacing: 0.4px;
        flex-shrink: 0;
    }
    .sub-mobile-meta-value {
        font-size: 13px;
        color: var(--text-primary);
        font-weight: 500;
        margin-left: auto;
        text-align: right;
        min-width: 0;
    }

    /* Esconder células desktop */
    .sub-row > td.sub-cell { display: none; }

    /* Mostrar só a última <td> (estado) */
    .sub-row > td.sub-cell.right {
        display: flex;
        justify-content: flex-end;
        width: 100%;
    }

    .sub-status { font-size: 12px; padding: 5px 12px; }
    .sub-status i { font-size: 7px; }

    /* Paginação mobile */
    .page-btn {
        min-width: 34px;
        height: 34px;
        font-size: 12.5px;
        padding: 0 10px;
    }
}