/* ==========================================
   CSS PREMIUM - LPN FINDER
   ========================================== */

/* Importando uma fonte moderna (Inter) */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    /* Paleta de Cores Tailwind */
    --bg-body: #f1f5f9;       /* Fundo cinza bem claro */
    --card-bg: #ffffff;       /* Fundo branco puro */
    --text-main: #0f172a;     /* Texto quase preto */
    --text-muted: #64748b;    /* Texto secundário/cinza */
    --border-color: #e2e8f0;  /* Linhas divisórias */
    
    /* Cores de Ação */
    --primary: #2563eb;       /* Azul moderno */
    --primary-hover: #1d4ed8;
    --accent: #f59e0b;        /* Amarelo/Laranja para destaque (Câmera) */
    --accent-hover: #d97706;
    --success: #10b981;       /* Verde sucesso */
    --success-hover: #059669;
}

* { 
    box-sizing: border-box; 
    margin: 0; 
    padding: 0; 
}

body {
    font-family: 'Inter', system-ui, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* Container Principal */
.container { 
    max-width: 960px; 
    margin: 0 auto; 
    padding: 2.5rem 1.5rem; 
}

/* Cabeçalho */
header { 
    text-align: center; 
    margin-bottom: 3rem; 
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.025em;
    margin-bottom: 0.5rem;
}

header p {
    font-size: 1.1rem;
    color: var(--text-muted);
}

/* Grid de Cartões */
.actions { 
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 2rem; 
    margin-bottom: 2rem; 
}

/* Design dos Cartões */
.card {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-color);
    display: flex; 
    flex-direction: column; 
    gap: 1.25rem;
    transition: box-shadow 0.3s ease;
}

.card:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
}

.card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-main);
    border-bottom: 2px solid var(--bg-body);
    padding-bottom: 0.75rem;
    margin-bottom: 0.5rem;
}

/* Input de Arquivo Customizado */
input[type="file"] { 
    padding: 0.75rem; 
    border: 2px dashed #cbd5e1; 
    border-radius: 12px; 
    background-color: #f8fafc;
    color: var(--text-muted);
    cursor: pointer;
    transition: border-color 0.3s;
}

input[type="file"]:hover {
    border-color: var(--primary);
}

/* Estiliza o botão feio padrão do input file */
input[type="file"]::file-selector-button {
    background-color: #e2e8f0;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    color: var(--text-main);
    font-weight: 500;
    cursor: pointer;
    margin-right: 1rem;
    transition: background-color 0.2s;
}

input[type="file"]::file-selector-button:hover {
    background-color: #cbd5e1;
}

/* Busca Manual */
.manual-search { 
    display: flex; 
    gap: 0.75rem; 
}

.manual-search input {
    flex: 1; 
    padding: 0.875rem 1rem; 
    border: 2px solid var(--border-color);
    border-radius: 12px; 
    font-size: 1rem; 
    outline: none; 
    width: 100%;
    transition: all 0.2s ease;
    background-color: #f8fafc;
}

.manual-search input:focus { 
    border-color: var(--primary);
    background-color: var(--card-bg);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

/* Divisor "ou" */
.divider {
    text-align: center; 
    color: var(--text-muted); 
    font-size: 0.875rem;
    font-weight: 500;
    position: relative; 
    margin: 0.5rem 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.divider::before, .divider::after {
    content: ""; 
    position: absolute; 
    top: 50%;
    width: 42%; 
    height: 1px; 
    background: var(--border-color);
}
.divider::before { left: 0; }
.divider::after { right: 0; }

/* Botões Globais */
button {
    background: var(--primary); 
    color: white; 
    border: none; 
    padding: 1rem;
    font-size: 1rem; 
    font-weight: 600; 
    border-radius: 12px;
    cursor: pointer; 
    transition: all 0.2s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}

button:hover { 
    background: var(--primary-hover); 
    transform: translateY(-1px);
}

button:active {
    transform: translateY(1px);
}

button:disabled { 
    background: #94a3b8; 
    cursor: not-allowed; 
    transform: none;
}

/* Botão de Câmera Destacado */
#btnScanPhoto {
    background: var(--text-main); /* Botão escuro para dar contraste forte */
    font-size: 1.1rem;
    padding: 1.2rem;
}

#btnScanPhoto:hover {
    background: #334155;
}

/* Botão de Download */
#btnDownload {
    background: var(--success) !important;
    width: 100%;
    max-width: 400px;
    margin: 1.5rem auto 0 auto;
}

#btnDownload:hover {
    background: var(--success-hover) !important;
}

/* Textos de Status */
.status { 
    font-size: 0.95rem; 
    font-weight: 500; 
    min-height: 24px; 
    color: var(--text-muted); 
    margin-top: 0.5rem;
    padding: 0.75rem;
    background-color: #f8fafc;
    border-radius: 8px;
    text-align: center;
    border: 1px solid var(--border-color);
}

/* Seção de Resultado e Canvas */
.preview-section { 
    margin-top: 3rem; 
    text-align: center; 
    animation: slideUpFade 0.5s ease-out forwards;
}

.preview-section h2 {
    color: var(--text-main);
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.canvas-container {
    overflow-x: auto;
    border: 8px solid white;
    background: white;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    border-radius: 16px;
}

canvas { 
    display: block; 
    margin: 0 auto; 
    max-width: 100%; 
    height: auto; 
    border-radius: 8px;
}

/* Animação para quando o documento aparecer */
@keyframes slideUpFade {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================
   RESPONSIVIDADE (CELULARES E TABLETS)
   ========================================== */
@media (max-width: 768px) {
    .container { 
        padding: 1.5rem 1rem; 
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .actions { 
        grid-template-columns: 1fr; 
        gap: 1.5rem;
    }
    
    .card {
        padding: 1.5rem;
    }
    
    .manual-search {
        flex-direction: column;
    }
    
    .manual-search button {
        width: 100%;
    }
    
    .divider::before, .divider::after {
        width: 35%;
    }
}
