/* /crypt/style.css */

/* 1. IMPORTAÇÃO DA FONTE TECNOLÓGICA (Exo 2) */
@import url('https://fonts.googleapis.com/css2?family=Exo+2:wght@300;400;600&display=swap');

:root {
    --bg-app: #f0f0f0;
    --border-color: #a0a0a0;
    --accent-color: #005CA9;
    --text-color: #333;
}

* { box-sizing: border-box; }

body {
    /* Atualizando a fonte principal também para ficar harmônico */
    font-family: 'Exo 2', 'Segoe UI', Tahoma, sans-serif; 
    background-color: #e0e3e5;
    margin: 0;
    padding: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.main-wrapper {
    display: flex;
    flex: 1;
    height: 100%;
}

/* Área de Conteúdo */
.content-area {
    flex: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.header-container {
    display: flex;
    align-items: center; /* Alinha verticalmente */
    justify-content: center;
    margin-bottom: 25px;
    gap: 20px;
}

/* Agrupador de Texto (Título + Subtítulo) */
.header-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.app-logo {
    height: 65px; /* Levemente maior */
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.15));
    transition: transform 0.3s ease;
}
.app-logo:hover { transform: scale(1.05); }

.app-title {
    margin: 0;
    color: #2c3e50;
    font-weight: 600; /* Mais peso para marcar presença */
    font-size: 36px;  /* Maior */
    letter-spacing: 2px; /* Espaçamento "tech" */
    line-height: 1;
    text-transform: uppercase; /* Fica mais imponente */
}

.app-subtitle {
    margin: 5px 0 0 0;
    color: #546e7a; /* Cinza azulado elegante */
    font-weight: 300; /* Leve e fino */
    font-size: 14px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* O "Aplicativo" */
.app-window {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    height: 100%;
    max-height: 800px;
    overflow: hidden;
}

/* Barra de Ferramentas */
.toolbar {
    background: linear-gradient(to bottom, #f9f9f9, #e0e0e0);
    border-bottom: 1px solid #ccc;
    padding: 8px 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.btn-tool {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    border: 1px solid #999;
    background: linear-gradient(to bottom, #fff, #eaeaea);
    border-radius: 3px;
    color: #333;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    user-select: none; /* Botões não devem selecionar texto */
}

.btn-tool:hover { background: linear-gradient(to bottom, #f0f0f0, #dcdcdc); border-color: #666; }
.btn-tool:active { background: #ccc; box-shadow: inset 0 1px 3px rgba(0,0,0,0.2); }
.btn-tool .material-icons { font-size: 18px; color: #555; }

.separator {
    width: 1px;
    height: 24px;
    background: #ccc;
    border-right: 1px solid #fff;
    margin: 0 5px;
}

.select-method {
    padding: 5px;
    border: 1px solid #999;
    border-radius: 3px;
    font-size: 13px;
    background: #fff;
}

/* --- CORREÇÃO PRINCIPAL AQUI --- */
.crypto-editor {
    flex: 1;
    width: 100%;
    border: none;
    padding: 15px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 14px;
    color: #333;
    resize: none;
    outline: none;
    background-color: #fff;
    
    /* Garante que o mouse funcione para colar/selecionar */
    cursor: text;
    user-select: text;
    -webkit-user-select: text; /* Safari/Chrome */
}

.crypto-editor:focus {
    background-color: #f0f8ff; /* Azul bem claro para indicar foco */
    box-shadow: inset 0 0 5px rgba(0, 92, 169, 0.2); /* Sombra interna sutil */
}

.statusbar {
    background: #f0f0f0;
    border-top: 1px solid #ccc;
    padding: 4px 10px;
    font-size: 11px;
    color: #666;
    display: flex;
    justify-content: space-between;
    user-select: none;
}

/* Container da barra */
.progress-container {
    width: 150px;       /* Largura fixa */
    height: 10px;
    background-color: #e0e0e0;
    border-radius: 5px;
    overflow: hidden;
    margin: 0 10px;
    display: none;      /* Oculto por padrão */
    border: 1px solid #ccc;
}

/* O enchimento da barra */
.progress-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #4caf50, #81c784); /* Verde */
    transition: width 0.1s linear; /* Animação suave */
}

/* --- CHECKBOX CUSTOMIZADO NA TOOLBAR --- */
.checkbox-container {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    color: #333;
    margin-left: 5px;
    cursor: pointer;
    user-select: none;
}

/* --- MODAL DE PREVIEW --- */
.modal-overlay {
    display: none; /* Oculto por padrão */
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.5); /* Fundo escuro transparente */
    z-index: 1000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(2px); /* Efeito de desfoque tech */
}

.modal-window {
    background: #fff;
    border: 1px solid #999;
    border-radius: 6px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    width: auto;
    max-width: 90%;
    max-height: 90%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }

.modal-header {
    background: linear-gradient(to bottom, #f9f9f9, #e0e0e0);
    padding: 8px 15px;
    border-bottom: 1px solid #ccc;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title { font-weight: 600; font-size: 14px; color: #333; }

.btn-close {
    background: none; border: none; cursor: pointer; color: #666; font-size: 20px; line-height: 1;
}
.btn-close:hover { color: red; }

.modal-body {
    padding: 20px;
    background: #e0e3e5; /* Fundo cinza para destacar a imagem */
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: auto;
}

.preview-image {
    max-width: 100%;
    max-height: 60vh; /* Limita altura para caber na tela */
    border: 1px solid #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    image-rendering: pixelated; /* Garante que os pixels fiquem nítidos */
}

.modal-footer {
    padding: 10px;
    background: #f0f0f0;
    border-top: 1px solid #ccc;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* /crypt/style.css - ADIÇÕES MOBILE */

/* Regras para telas menores que 768px (Celulares e Tablets pequenos) */
@media (max-width: 768px) {
    
    /* 1. Ajuste do Corpo */
    body {
        background-color: #fff; /* Fundo branco para parecer app */
    }
    
    .content-area {
        padding: 10px; /* Menos margem */
    }

    /* 2. Cabeçalho Empilhado */
    .header-container {
        flex-direction: column; /* Logo em cima, texto embaixo */
        gap: 10px;
        margin-bottom: 15px;
        text-align: center;
    }
    
    .header-text {
        align-items: center;
    }

    .app-title { font-size: 28px; }
    .app-subtitle { font-size: 11px; }
    .app-logo { height: 50px; }

    /* 3. Janela do App "Full Width" */
    .app-window {
        box-shadow: none;
        border: none;
        border-top: 1px solid #eee;
    }

    /* 4. Toolbar Otimizada para Toque */
    .toolbar {
        padding: 10px 5px;
        gap: 8px;
        justify-content: space-between; /* Distribui os botões */
    }

    .btn-tool {
        flex: 1 0 45%; /* Botões ocupam 45% da largura (2 por linha) */
        justify-content: center;
        padding: 10px; /* Área de toque maior */
        margin-bottom: 5px;
        font-size: 12px;
    }

    /* Esconde os separadores verticais no mobile */
    .separator { display: none; }

    /* Input e Select ocupam linha inteira */
    .select-method, .checkbox-container {
        flex: 1 0 100%;
        margin: 5px 0;
        justify-content: center;
        padding: 8px;
        border: 1px solid #ddd;
        border-radius: 4px;
    }

    /* 5. Editor de Texto */
    .crypto-editor {
        font-size: 16px; /* Evita zoom automático do iPhone ao digitar */
        padding: 10px;
        min-height: 200px;
    }

    /* 6. Ajustes da Modal */
    .modal-window {
        width: 95%;
        height: 90%;
    }
    
    .modal-body {
        background: #333; /* Fundo escuro para ver melhor a imagem */
    }
    
    .preview-image {
        max-width: 100%;
        height: auto;
    }
    
    .modal-footer {
        flex-direction: column; /* Botões um embaixo do outro */
    }
    
    .modal-footer .btn-tool {
        width: 100%;
        flex: none;
    }
}