/* Arquivo: assets/css/style.css */

/* --- Reset e Base --- */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    background-color: #f0f2f5;
    color: #333;
    overflow-x: hidden;
    -webkit-tap-highlight-color: transparent; /* Remove flash azul no toque em mobile */
}

/* --- Sistema de Telas (SPA) --- */
.screen {
    display: none;
    padding: 20px;
    padding-bottom: 80px; /* Espaço para rolagem no mobile */
    min-height: 100vh;
    box-sizing: border-box;
}

.screen.active {
    display: block;
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- Cards e Containers --- */
.card {
    background: white;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.card h3 {
    margin-top: 0;
    font-size: 18px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
    color: #444;
}

/* --- Formulários --- */
.form-group {
    margin-bottom: 15px;
}

.form-label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px; /* 16px evita zoom automático no iPhone ao digitar */
    box-sizing: border-box;
    background-color: #fff;
    transition: border-color 0.2s;
}

.form-control:focus {
    border-color: #007bff;
    outline: none;
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

/* --- Botões --- */
.btn {
    display: block;
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    text-align: center;
    margin-top: 10px;
    color: white;
    transition: opacity 0.2s, transform 0.1s;
    text-decoration: none; /* Para links com classe btn */
    box-sizing: border-box;
}

.btn:active {
    transform: scale(0.98);
}

.btn:disabled, .btn-disabled {
    background-color: #ccc !important;
    color: #666 !important;
    cursor: not-allowed;
    transform: none;
}

.btn-primary { background-color: #007bff; }
.btn-success { background-color: #28a745; }
.btn-danger { background-color: #dc3545; }
.btn-secondary { background-color: #6c757d; }
.btn-warning { background-color: #ffc107; color: #000; }

/* --- Lista de Documentos --- */
.doc-item {
    background: #f8f9fa;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid #e9ecef;
}

.doc-info {
    font-size: 14px;
    color: #333;
}

.doc-type {
    font-weight: bold;
    color: #007bff;
    font-size: 12px;
    text-transform: uppercase;
}

/* --- Modal de Recorte --- */
#crop-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: #000;
    flex-direction: column;
}

#crop-container {
    flex: 1;
    position: relative;
    overflow: hidden;
    background: #111;
    display: flex;
    justify-content: center;
    align-items: center;
}

#image-to-crop {
    max-width: 100%;
    max-height: 80vh;
    display: block;
}

#crop-controls {
    height: 70px; /* Um pouco maior para facilitar o toque */
    background: #000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    border-top: 1px solid #333;
}

/* Status de Sincronização */
#sync-status {
    font-weight: 500;
    transition: background-color 0.3s;
}

/* --- Modal Debug (Sync Logs) --- */
#debug-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.55);
    padding: 14px;
    box-sizing: border-box;
}

#debug-modal .debug-card {
    max-width: 920px;
    margin: 0 auto;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 18px 60px rgba(0,0,0,0.25);
    overflow: hidden;
}

#debug-modal .debug-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-bottom: 1px solid #eee;
    background: #f8f9fa;
}

#debug-modal .debug-head h3 {
    margin: 0;
    font-size: 15px;
}

#debug-modal .debug-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

#debug-modal .debug-body {
    padding: 12px 14px;
}

#debug-modal pre {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 12px;
    line-height: 1.35;
    background: #0b1020;
    color: #e6e6e6;
    padding: 12px;
    border-radius: 12px;
    max-height: 65vh;
    overflow: auto;
}

#debug-modal .btn-mini {
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 10px;
    padding: 8px 10px;
    font-size: 12px;
    cursor: pointer;
}

#debug-modal .btn-mini:active {
    transform: translateY(1px);
}