/* RESET E BASE */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Roboto Mono', monospace;
    background-color: #000;
    overflow: hidden;
    color: #e0e0e0;
    user-select: none;
}

/* === TELA DE LOGIN === */
#login-screen {
    position: absolute;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(circle at center, #1a1a1a, #000);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    transition: opacity 0.8s ease;
}

.login-box {
    text-align: center;
    background: rgba(20, 20, 20, 0.95);
    padding: 60px;
    border: 1px solid #333;
    border-radius: 6px;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.9);
    width: 400px;
}

.avatar img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 3px solid #555;
    object-fit: cover;
    margin-bottom: 25px;
}

h2 {
    font-weight: 500;
    letter-spacing: 1px;
    margin-bottom: 5px;
    color: #fff;
}

.status {
    color: #666;
    font-size: 0.75rem;
    margin-bottom: 35px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.input-group {
    display: flex;
    justify-content: center;
    gap: 8px;
}

input {
    background: #0a0a0a;
    border: 1px solid #444;
    color: #fff;
    padding: 12px;
    border-radius: 2px;
    outline: none;
    font-family: 'Roboto Mono', monospace;
    width: 70%;
    transition: border-color 0.3s;
}

input:focus {
    border-color: #888;
}

button {
    background: #e0e0e0;
    color: #000;
    border: none;
    padding: 0 20px;
    cursor: pointer;
    font-weight: bold;
    border-radius: 2px;
}

button:hover {
    background: #fff;
}

#error-msg {
    color: #ff4444;
    font-size: 0.75rem;
    margin-top: 20px;
    height: 20px;
    letter-spacing: 0.5px;
}

/* === DESKTOP (Fundo Preto Sólido) === */
#desktop-screen {
    width: 100vw;
    height: 100vh;
    background-color: #000000;
    /* Alterado para preto sólido */
    position: relative;
}

.icon-grid {
    padding: 40px;
    display: flex;
    flex-direction: column;
    flex-wrap: wrap;
    height: 90vh;
    align-content: flex-start;
    gap: 30px;
}

.desktop-icon {
    text-align: center;
    cursor: pointer;
    width: 130px;
    padding: 10px;
    border-radius: 4px;
    border: 1px solid transparent;
    transition: background 0.2s;
    position: relative;
}

.desktop-icon:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.15);
}

.desktop-icon img {
    width: 50px;
    margin-bottom: 10px;
}

.desktop-icon span {
    display: block;
    font-size: 0.75rem;
    font-weight: 500;
    color: #e0e0e0;
}

.lock-icon {
    position: absolute;
    top: 5px;
    right: 25px;
    font-size: 12px;
}

/* Ícone da Nuvem (Direita) */
.icon-right {
    position: absolute;
    top: 30px;
    right: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100px;
}

.icon-right img {
    width: 60px;
    margin-bottom: 5px;
}

/* === JANELAS === */
.window {
    position: absolute;
    top: 10%;
    left: 20%;
    width: 700px;
    background: #181818;
    border: 1px solid #333;
    box-shadow: 20px 20px 60px rgba(0, 0, 0, 0.8);
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    z-index: 10;
}

.pdf-window {
    width: 850px;
    height: 85vh;
    top: 5%;
    left: 10%;
}

/* Força o iframe a ocupar todo o espaço do window-content */
#pdf-frame {
    width: 100%;
    height: 100%;
    flex: 1;                 /* Garante que ele estique */
    border: none;
}

/* Cabeçalho da Janela mais profissional */
.window-header {
    background: #222;
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #333;
    font-size: 0.7rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.window-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}
/* Classe que será aplicada via JavaScript */
.window.maximized {
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    max-height: 100vh !important;
    border-radius: 0;
    z-index: 9999;
}

/* Ajuste específico para o iframe do PDF dentro da janela maximizada */
.maximized .window-content {
    height: calc(100vh - 40px);
    /* Subtrai a altura do cabeçalho */
    max-height: none;
}

.window-content {
    flex: 1;                 /* ADICIONADO: Força a crescer até o fim da janela */
    display: flex;           /* ADICIONADO */
    flex-direction: column;  /* ADICIONADO */
    background: #111;
    overflow: hidden;        /* PDFs já tem sua própria rolagem */
}

/* Botão de fechar estilo Minimalist/Windows */
.close-btn {
    background: none;
    border: none;
    color: #dbd5d5;
    font-size: 16px;
    font-family: 'Arial', sans-serif;
    /* Arial costuma alinhar melhor o X */
    cursor: pointer;
    line-height: 1;
    padding: 5px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    color: #ff5f56;
    /* Fica vermelho suave no hover */
    transform: scale(1.1);
}

/* Botão de Maximizar */
.maximize-btn {
    background: none;
    border: none;
    color: #f3f0f0;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5px;
    transition: color 0.2s;
}

.maximize-btn:hover {
    color: #db4e4e;
}

.back-btn-container {
    width: 100%;
    display: block;
    margin-bottom: 20px;
}

.back-btn {
    display: inline-block;
    color: #f3f0f0;
    cursor: pointer;
    font-size: 0.8rem;
    padding: 5px 10px;
    border: 1px solid #111416;
    border-radius: 3px;
    background: #b5c5d3;
}



/* Grid para arquivos e fotos */
/* Container que segura os ícones dentro da janela */
.file-grid-layout {
    display: flex !important;
    flex-direction: row !important; /* Força os ícones a ficarem lado a lado */
    flex-wrap: wrap !important;    /* Permite que eles pulem para a linha de baixo */
    gap: 15px;                      /* Espaço entre os ícones */
    padding: 20px;                  /* Espaço nas bordas da janela */
    align-content: flex-start;
    overflow-y: auto;               /* Cria barra de rolagem se tiver muitos itens */
    height: 100%;                   /* Ocupa a altura total disponível */
}

/* Estilo dos itens de arquivo */
.file-item {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    padding: 10px;
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 3px;
    cursor: pointer;
    width: 100%;
    /* Lista normal */
}

/* Força o item de arquivo a virar um quadrado com ícone em cima e texto embaixo */
/* Ajuste do item (ícone + texto) */
.file-grid-layout .file-item {
    display: flex;
    flex-direction: column;         /* Ícone em cima, texto embaixo */
    align-items: center;
    justify-content: flex-start;
    width: 100px;                   /* Largura fixa para cada "pasta" */
    height: 110px;                  /* Altura fixa */
    text-align: center;
    cursor: pointer;
    transition: background 0.2s;
    border-radius: 4px;
    padding: 10px 5px;
}

.file-grid-layout .file-item:hover {
    background: rgba(255, 255, 255, 0.1);
}


.file-item img {
    width: 24px;
    margin-right: 15px;
}

.file-grid-layout .file-item img {
    width: 45px;                    /* Tamanho do ícone da pasta */
    height: auto;
    margin-bottom: 5px;
}

.file-grid-layout .file-item span {
    font-size: 0.75rem;
    color: #ccc;
    margin-top: 8px;
    word-wrap: break-word;          /* Quebra a palavra se for muito grande */
    display: block;
    width: 100%;
    line-height: 1.2;
}

.file-item span {
    font-size: 0.8rem;
    color: #ccc;
    word-break: break-all;
}

/* Ícone de vídeo falso */
.video-thumb-icon {
    width: 40px;
    height: 40px;
    background: #2c3e50;
    color: #fff;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    margin-bottom: 10px;
    border: 1px solid #4a69bd;
}

/* Visualizador de Imagem (Overlay) */
.overlay-viewer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.95);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.viewer-content {
    text-align: center;
    max-width: 90%;
    max-height: 90%;
}

.viewer-content img {
    max-width: 100%;
    max-height: 80vh;
    border: 1px solid #333;
    box-shadow: 0 0 50px rgba(255, 255, 255, 0.05);
}

.viewer-content p {
    color: #00bcd4;
    font-family: 'Roboto Mono', monospace;
    margin-top: 15px;
    background: #000;
    display: inline-block;
    padding: 8px 15px;
    border: 1px solid #333;
    font-size: 0.9rem;
}

/* Janela de Erro Biométrica */
.bio-window {
    width: 320px;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%);
    border: 1px solid #ff4444;
    z-index: 990;
}

.error-header {
    background: #1a0000;
    color: #ff4444;
    justify-content: center;
}

.bio-content {
    text-align: center;
    padding: 30px;
    background: #0a0000;
}

#bio-icon {
    font-size: 40px;
    margin-bottom: 15px;
}

.progress-bar-container {
    width: 100%;
    height: 2px;
    background: #333;
    margin-bottom: 15px;
}

.progress-fill {
    width: 0%;
    height: 100%;
    background: #ff4444;
    transition: width 1.5s ease-in-out;
}

.cancel-btn {
    background: transparent;
    border: 1px solid #444;
    color: #666;
    margin-top: 20px;
    font-size: 0.7rem;
}

.hidden {
    display: none !important;
}

.no-padding {
    padding: 0;
}

audio {
    height: 25px;
    width: 100%;
    margin-top: 5px;
}

/* Animação */
@keyframes shakeCenter {

    0%,
    100% {
        transform: translate(-50%, -50%) translateX(0);
    }

    20%,
    60% {
        transform: translate(-50%, -50%) translateX(-5px);
    }

    40%,
    80% {
        transform: translate(-50%, -50%) translateX(5px);
    }
}


/* Estilo para arquivos PDF com cadeado */
.locked-file {
    position: relative;
    opacity: 0.7;
    /* Dá um aspecto de arquivo protegido */
}

.lock-small {
    position: absolute;
    left: 28px;
    top: 5px;
    font-size: 12px;
    background: #111;
    border-radius: 50%;
    padding: 2px;
    z-index: 5;
}

.locked-file:hover {
    opacity: 1;
    border-color: #ff4444 !important;
    /* Destaque em vermelho ao passar o mouse */
}
/* ============================================================
   5. AJUSTES MOBILE (AQUI ESTÁ A SOLUÇÃO DO FIREFOX)
   ============================================================ */
@media (max-width: 768px) {

    #desktop-screen {
        height: 100dvh !important; /* d para dinâmico (Firefox bar) */
        width: 100vw;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important; /* CENTRALIZA TUDO */
        justify-content: flex-start;
        padding-top: 20px;
    }

    .icon-grid {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 10px !important;
        padding: 15px !important;
        height: auto !important;
        width: 100% !important;
        max-width: 360px !important; /* Mantém as pastas juntas no meio */
        margin: 0 auto !important;
    }

    .desktop-icon {
        width: 100% !important;
        margin-bottom: 10px;
    }

    /* Ícone da Nuvem (Cloud) */
    .icon-right {
        position: relative !important;
        top: 20px !important;
        right: 0 !important;
        margin: 20px auto 40px auto !important;
    }

    /* JANELAS INTERNAS NO MOBILE */
    .window {
        width: 94vw !important;
        height: 75dvh !important; /* Menor para não ficar sob o search bar */
        left: 3vw !important;
        top: 10dvh !important; /* Empurra para baixo para fugir do topo */
        position: fixed !important;
    }

    /* Grade de arquivos dentro da pasta */
    .file-grid-layout {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 8px !important;
        padding: 10px !important;
    }

    .file-grid-layout .file-item {
        width: 100% !important;
        height: 85px !important;
        padding: 5px !important;
    }

    /* Alerta Biométrico */
    .bio-window {
        width: 85% !important;
        top: 45% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) !important;
    }
}
/* No final do seu style.css, adicione ou atualize estas regras */

/* Ajuste para o Desktop no Mobile Landscape */
@media (max-width: 930px) and (orientation: landscape) {
    #desktop-screen {
        overflow-y: auto !important; /* Permite rolar o desktop se os ícones sumirem */
        height: 100vh;
    }
    .icon-grid {
        height: auto !important;
        flex-direction: row !important;
        flex-wrap: wrap !important;
        justify-content: center;
    }
}

/* Estilo visual para pastas com cadeado (reaproveitando o que já existe) */
.desktop-icon.locked {
    opacity: 0.8;
}

.lock-icon {
    position: absolute;
    top: 5px;
    right: 25px;
    font-size: 14px;
    filter: drop-shadow(0 0 2px black);
}

