/* ================================================================
   COMPARTILHAMENTOS — estilos da página de feed de compartilhamentos
   ================================================================ */

.shared-content {
    padding: 28px 35px;
    width: 100%;
    overflow-y: auto;
    min-height: calc(100vh - 65px);
    display: flex;
    flex-direction: column;
}

.shared-page-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--color-dark-text);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.shared-page-title i {
    color: #2563eb;
}

.shared-page-subtitle {
    font-size: 0.9rem;
    color: var(--color-muted-text);
    margin-bottom: 28px;
}

/* ── Container colapsável (seção) ──────────────────────────────── */

.shared-section {
    background: var(--color-background-white);
    border: 1px solid var(--color-border-light);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 20px;
    box-shadow: var(--card-shadow);
}

.shared-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    cursor: pointer;
    user-select: none;
    transition: background 0.18s;
    gap: 12px;
}

.shared-section-header:hover {
    background: var(--color-background-light);
}

.shared-section-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.shared-section-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.shared-section-icon.all    { background: #eff6ff; color: #2563eb; }
.shared-section-icon.company { background: #f0fdf4; color: #16a34a; }
.shared-section-icon.user    { background: #faf5ff; color: #7c3aed; }

.shared-section-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--color-dark-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.shared-section-count {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 20px;
    background: var(--color-background-light);
    color: var(--color-muted-text);
    flex-shrink: 0;
}

.shared-section-chevron {
    font-size: 0.85rem;
    color: var(--color-muted-text);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
}

.shared-section.is-open .shared-section-chevron {
    transform: rotate(180deg);
}

/* ── Corpo colapsável ─────────────────────────────────────────── */

.shared-section-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.32s cubic-bezier(0.4, 0, 0.2, 1);
}

.shared-section.is-open .shared-section-body {
    max-height: 2000px;
    transition: max-height 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

.shared-section-inner {
    border-top: 1px solid var(--color-border-extra-light);
    padding: 0;
}

/* ── Sub-seção (ex: "compartilhei" vs "compartilharam comigo") ── */

.shared-subsection-label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px 8px;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--color-gray-text);
    background: var(--color-background-light);
    border-bottom: 1px solid var(--color-border-extra-light);
}

/* ── Itens (reutiliza as classes de my-files) ─────────────────── */

.shared-items-list {
    display: flex;
    flex-direction: column;
}

/* Vazio */
.shared-empty {
    text-align: center;
    padding: 36px 20px;
    color: var(--color-muted-text);
    font-size: 0.9rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.shared-empty i {
    font-size: 2rem;
    opacity: 0.35;
}

/* ── Item individual ─────────────────────────────────────────── */

.shared-item {
    display: flex;
    align-items: center;
    padding: 11px 20px;
    background: var(--color-background-white);
    border-bottom: 1px solid var(--color-border-extra-light);
    cursor: default;
    transition: background 0.15s;
    gap: 0;
}

.shared-item:last-child {
    border-bottom: none;
}

.shared-item:hover {
    background: #f8faff;
}

.shared-item .item-col-icon-name {
    flex: 3;
    min-width: 200px;
    display: flex;
    align-items: center;
    gap: 0;
    overflow: hidden;
}

.shared-item .item-col-icon-name i {
    font-size: 1.2rem;
    margin-right: 12px;
    flex-shrink: 0;
}

.shared-item .item-col-owner {
    flex: 1.5;
    min-width: 100px;
    font-size: 0.875rem;
    color: var(--color-muted-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.shared-item .item-col-date {
    flex: 1.5;
    min-width: 100px;
    font-size: 0.875rem;
    color: var(--color-muted-text);
    text-align: right;
    white-space: nowrap;
}

.shared-item .item-col-actions {
    flex: 0 0 auto;
    width: 90px;
    display: flex;
    justify-content: flex-end;
    opacity: 0;
    transition: opacity 0.18s;
}

.shared-item:hover .item-col-actions {
    opacity: 1;
}

.shared-item .item-col-size {
    flex: 0 0 80px;
    font-size: 0.875rem;
    color: var(--color-muted-text);
    text-align: right;
    white-space: nowrap;
}

.shared-item-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-dark-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Ícones de arquivo/pasta nas cores padrão */
.shared-item .fa-folder      { color: #f4b400; }
.shared-item .fa-file-pdf    { color: #ea4335; }
.shared-item .fa-file-word   { color: #4285f4; }
.shared-item .fa-file-excel  { color: #34a853; }
.shared-item .fa-file-image  { color: #a142f4; }
.shared-item .fa-file-video  { color: #e8710a; }
.shared-item .fa-file        { color: #5f6368; }
.shared-item .fa-file-alt    { color: #5f6368; }

/* Botão editar na linha */
.shared-edit-btn {
    background: none;
    border: 1px solid var(--color-border-light);
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 0.8rem;
    color: var(--color-dark-text);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
    transition: background 0.15s, border-color 0.15s;
}

.shared-edit-btn:hover {
    background: var(--color-background-light);
    border-color: var(--color-accent-blue);
    color: var(--color-accent-blue);
}

/* ── Cabeçalho da lista de itens ─────────────────────────────── */

.shared-list-header {
    display: flex;
    align-items: center;
    padding: 9px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid var(--color-border-extra-light);
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--color-gray-text);
}

.shared-list-header .item-col-icon-name { flex: 3; min-width: 200px; }
.shared-list-header .item-col-owner     { flex: 1.5; min-width: 100px; }
.shared-list-header .item-col-date      { flex: 1.5; min-width: 100px; text-align: right; }
.shared-list-header .item-col-actions   { flex: 0 0 90px; }
.shared-list-header .item-col-size      { flex: 0 0 80px; text-align: right; }

/* ── Tema escuro ─────────────────────────────────────────────── */

[data-theme="dark"] .shared-list-header {
    background: var(--color-background-light);
}

[data-theme="dark"] .shared-item:hover {
    background: #1e2a3a;
}

/* ── Responsivo ──────────────────────────────────────────────── */

@media (max-width: 768px) {
    .shared-content {
        padding: 16px;
    }

    /* Cabeçalho da lista some */
    .shared-list-header {
        display: none;
    }

    /* Item vira card de 2 linhas */
    .shared-item {
        flex-wrap: wrap;
        padding: 10px 16px;
        align-items: center;
        gap: 2px 0;
    }

    /* LINHA 1 — ícone + nome */
    .shared-item .item-col-icon-name {
        order: 1;
        flex: 1 1 0;
        min-width: 0;
    }

    /* LINHA 1 — botão editar */
    .shared-item .item-col-actions {
        order: 2;
        flex: 0 0 auto;
        opacity: 1;
        width: auto;
    }

    /* Quebra de linha */
    .shared-item::after {
        content: "";
        order: 3;
        flex: 0 0 100%;
        height: 0;
    }

    /* LINHA 2 — metadados */
    .shared-item .item-col-owner {
        order: 4;
        flex: 0 0 auto;
        min-width: 0;
        font-size: 0.78rem;
    }

    .shared-item .item-col-date {
        order: 5;
        flex: 1 1 auto;
        text-align: left;
        font-size: 0.78rem;
        padding: 0 8px;
        white-space: normal;
    }

    .shared-item .item-col-size {
        order: 6;
        flex: 0 0 auto;
        font-size: 0.78rem;
    }
}
