/* ===============================
   MY FILES — ESTILO GOOGLE DRIVE (LISTA)
   =============================== */

:root {
    --folder-color: #f4b400; /* Cor mais próxima do amarelo do Google Drive */
    --file-color: #4285f4; /* Cor mais próxima do azul do Google Drive */
    --delete-color: #ea4335; /* Vermelho do Google */
    --star-color: #fbbc05; /* Amarelo da estrela do Google */
    --text-light: #5f6368; /* Texto cinza claro do Google */
    --text-dark: #202124; /* Texto escuro do Google */
    --border-color: #dadce0; /* Borda leve do Google */
    --hover-bg: #f8f9fa; /* Fundo leve no hover */
    --header-bg: #f5f5f5; /* Fundo do cabeçalho da lista */
}

/* Layout principal */
.myfiles-content {
    padding: 25px 35px;
    width: 100%;
    overflow-y: auto;
    min-height: calc(100vh - 65px);
    display: flex;
    flex-direction: column;
}

/* Breadcrumbs */
.breadcrumbs {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 25px;
}

/* Barra de ações */
.actions-bar {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
}

.actions-bar .btn-primary,
.actions-bar .btn-secondary {
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    border: none;
    transition: background-color 0.2s;
}

.actions-bar .btn-primary {
    background-color: var(--file-color);
    color: white;
}

.actions-bar .btn-primary:hover {
    background-color: #7fb0ff;
}

.actions-bar .btn-secondary {
    background-color: var(--color-background-light);
    color: var(--text-dark);
    border: 1px solid var(--border-color);
}

.actions-bar .btn-secondary:hover {
    background-color: var(--hover-bg);
}


/* Container da lista (cabeçalho + itens) */
.items-grid-drive {
    display: flex; /* Transforma em flex container */
    flex-direction: column; /* Itens um abaixo do outro */
    gap: 0; /* Remove gap entre os itens para ter bordas contínuas */
    border: 1px solid var(--border-color); /* Borda externa para a lista */
    border-radius: 8px; /* Cantos arredondados na lista */
    overflow: hidden; /* Garante que bordas internas não vazem */
}

/* Cabeçalho da lista */
.drive-item-header {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    background-color: var(--header-bg);
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    color: var(--text-dark);
    font-size: 0.9rem;
}

/* Cada item da lista (pasta ou arquivo) */
.drive-item {
    display: flex; /* Layout interno flexível */
    align-items: center; /* Alinha verticalmente */
    padding: 12px 15px; /* Padding interno */
    background: var(--color-background-white);
    border-bottom: 1px solid var(--border-color); /* Linha divisória entre itens */
    cursor: pointer;
    transition: background-color 0.2s ease-in-out;
    position: relative; /* Para posicionar os botões de ação */
}

.drive-item:last-child {
    border-bottom: none; /* Remove a borda do último item */
}

.drive-item:hover {
    background-color: var(--hover-bg); /* Fundo cinza claro no hover */
}

/* Estilo para cada coluna dentro do item e cabeçalho */
.drive-item-header .item-col,
.drive-item .item-col {
    padding: 0 8px; /* Padding horizontal para espaçar o conteúdo */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex; /* Cada coluna é um flex container */
    align-items: center; /* Vertically center content */
}

/* Column definitions - use flex-grow to distribute space */
.item-col-icon-name {
    flex: 3; /* Mais espaço para o nome */
    min-width: 250px;
    justify-content: flex-start;
}

.item-col-icon-name i {
    font-size: 1.3rem; /* Ícone menor para lista */
    margin-right: 15px;
    flex-shrink: 0; /* Impede que o ícone diminua */
}

.item-col-icon-name .item-name {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-dark);
    flex-grow: 1; /* Permite que o nome ocupe o espaço restante */
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Coluna de Proprietário */
.item-col-owner {
    flex: 1.5; /* Menos espaço que o nome, mais que a data */
    min-width: 120px;
    justify-content: flex-start;
    color: var(--text-light);
    font-size: 0.9rem;
}

/* Coluna de Data */
.item-col-date {
    flex: 1.5; /* Similar ao proprietário */
    min-width: 120px;
    justify-content: flex-end; /* Alinha a data à direita */
    color: var(--text-light);
    font-size: 0.9rem;
}

/* Coluna de Botões de Ação */
.item-col-actions {
    flex: 0 0 auto;
    width: 110px;
    justify-content: flex-end;
    gap: 5px;
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
}

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

.item-col-actions button {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.9rem; /* Ícones menores */
    padding: 5px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.item-col-actions button:hover {
    background-color: rgba(0, 0, 0, 0.05); /* Fundo leve no hover dos botões */
}

.favorite-btn {
    color: var(--star-color);
}

.download-btn {
    color: var(--file-color);
}

.delete-btn {
    color: var(--delete-color);
}

/* Coluna de Tamanho */
.item-col-size {
    flex: 0 0 80px; /* Largura fixa para o tamanho */
    justify-content: flex-end; /* Alinha o tamanho à direita */
    color: var(--text-light);
    font-size: 0.9rem;
}


/* Arquivo de linha: cursor padrão (sem ação de clique na linha) */
.drive-file {
    cursor: default;
}

/* Indicador visual de item compartilhado */
.drive-item.is-shared {
    border-left: 3px solid #22c55e;
    background: linear-gradient(90deg, #f0fdf4 0%, var(--color-background-white) 32px);
}

.drive-item.is-shared:hover {
    background: linear-gradient(90deg, #dcfce7 0%, var(--hover-bg) 32px);
}

/* Checkbox de seleção */
.item-select {
    margin-right: 10px;
    width: 16px;
    height: 16px;
    cursor: pointer;
    flex-shrink: 0;
}

/* Barra de progresso para operações em lote */
.bulk-progress {
    margin-bottom: 12px;
    padding: 10px 16px;
    background: #e8f0fe;
    border: 1px solid #c5d8fc;
    border-radius: 8px;
}

.bulk-progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.88rem;
    color: #1a73e8;
    font-weight: 500;
    margin-bottom: 6px;
}

.bulk-progress progress {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    border: none;
    appearance: none;
}

.bulk-progress progress::-webkit-progress-bar {
    background: #c5d8fc;
    border-radius: 4px;
}

.bulk-progress progress::-webkit-progress-value {
    background: #4285f4;
    border-radius: 4px;
}

.bulk-progress progress::-moz-progress-bar {
    background: #4285f4;
    border-radius: 4px;
}

/* Ícones por tipo */
.drive-folder i {
    color: var(--folder-color);
}

.drive-file i {
    color: var(--file-color);
}

.empty-state {
    width: 100%;
    text-align: center;
    padding: 80px 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    grid-column: 1 / -1; /* Mantido para compatibilidade, mas menos relevante agora */
}

.empty-state h2 {
    font-size: 26px;
    margin-bottom: 10px;
    color: var(--text-dark);
}

.empty-state p {
    font-size: 18px;
    color: var(--text-light);
    margin-top: 0;
}

/* ── TEMA ESCURO ─────────────────────────────────────────────── */

[data-theme="dark"] {
    --hover-bg: #2d3748;
    --header-bg: #1e2233;
    --border-color: #374151;
    --text-light: #94a3b8;
    --text-dark: #e2e8f0;
}

[data-theme="dark"] .drive-item.is-shared {
    border-left-color: #16a34a;
    background: linear-gradient(90deg, #052e16 0%, var(--color-background-white) 32px);
}

[data-theme="dark"] .drive-item.is-shared:hover {
    background: linear-gradient(90deg, #14532d 0%, var(--hover-bg) 32px);
}

[data-theme="dark"] .bulk-progress {
    background: #0f2044;
    border-color: #1e3a5f;
}

[data-theme="dark"] .bulk-progress-info {
    color: #93c5fd;
}

[data-theme="dark"] .bulk-progress progress::-webkit-progress-bar {
    background: #1e3a5f;
}

/* Responsividade — layout de 2 linhas em mobile */
@media (max-width: 768px) {
    .myfiles-content {
        padding: 15px;
    }

    /* Cabeçalho da tabela some (não faz sentido no layout em card) */
    .drive-item-header {
        display: none;
    }

    /* Item vira card com 2 linhas usando flex-wrap */
    .drive-item {
        flex-wrap: wrap;
        padding: 10px 12px;
        align-items: center;
        gap: 2px 0;
    }

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

    /* LINHA 1 — direita: botão de ação */
    .item-col-actions {
        order: 2;
        flex: 0 0 auto;
        opacity: 1 !important;
        width: auto;
    }

    /* Quebra de linha entre linha 1 e linha 2 */
    .drive-item::after {
        content: "";
        order: 3;
        flex: 0 0 100%;
        height: 0;
    }

    /* LINHA 2 — metadados: proprietário + data + tamanho */
    .item-col-owner {
        order: 4;
        display: flex !important;
        flex: 0 0 auto;
        min-width: 0;
        font-size: 0.78rem;
        color: var(--text-light, #5f6368);
    }

    .item-col-date {
        order: 5;
        flex: 1 1 auto;
        min-width: 0;
        justify-content: flex-start;
        font-size: 0.78rem;
        color: var(--text-light, #5f6368);
        padding: 0 8px;
    }

    .item-col-size {
        order: 6;
        flex: 0 0 auto;
        font-size: 0.78rem;
        color: var(--text-light, #5f6368);
        justify-content: flex-end;
    }

    .actions-bar {
        flex-wrap: wrap;
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .actions-bar .btn-primary,
    .actions-bar .btn-secondary {
        width: 100%;
        justify-content: center;
    }

    .item-col-icon-name i {
        font-size: 1.1rem;
        margin-right: 10px;
    }

    .item-col-icon-name .item-name {
        font-size: 0.88rem;
    }
}