/**
 * ESTILO.CSS - Estilos Base do Sistema Layout Contábil
 * Versão: 2.0 - Mobile First
 */

/* ========== RESET E BASE ========== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.5;
    color: #333;
    background: linear-gradient(135deg, #a8e6cf 0%, #88d8a3 100%);
    min-height: 100vh;
    padding: 20px;
}

/* ========== CONTAINER ========== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
}

/* ========== TIPOGRAFIA ========== */
h1 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.8rem;
}

h2 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.4rem;
}

h3 {
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 1.2rem;
}

label {
    display: block;
    margin: 15px 0 5px;
    font-weight: 600;
    color: #495057;
}

/* ========== FORMULÁRIOS ========== */
input[type="text"],
input[type="password"],
input[type="email"],
input[type="date"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px; /* Evita zoom no iOS */
    transition: border-color 0.3s, box-shadow 0.3s;
    background: #fff;
    color: #333;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #28a745;
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.15);
}

input::placeholder,
textarea::placeholder {
    color: #adb5bd;
}

textarea {
    resize: vertical;
    min-height: 150px;
    font-family: 'Consolas', 'Monaco', monospace;
}

/* ========== BOTÕES ========== */
button,
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

button:hover,
.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

button:active,
.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: #28a745;
    color: white;
}

.btn-primary:hover {
    background: #218838;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-info {
    background: #17a2b8;
    color: white;
}

.btn-info:hover {
    background: #138496;
}

/* ========== ALERTAS ========== */
.error,
.alert-error {
    background: #f8d7da;
    color: #721c24;
    padding: 15px 20px;
    border-radius: 8px;
    margin: 15px 0;
    border: 1px solid #f5c6cb;
}

.success,
.alert-success {
    background: #d4edda;
    color: #155724;
    padding: 15px 20px;
    border-radius: 8px;
    margin: 15px 0;
    border: 1px solid #c3e6cb;
}

.warning,
.alert-warning {
    background: #fff3cd;
    color: #856404;
    padding: 15px 20px;
    border-radius: 8px;
    margin: 15px 0;
    border: 1px solid #ffeeba;
}

/* ========== TABELAS ========== */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
}

th, td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}

th {
    background: #f8f9fa;
    font-weight: 600;
    color: #495057;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

tr:hover {
    background: #f8f9fa;
}

/* ========== LAYOUTS GRID ========== */
.layouts-container {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    margin: 15px 0;
    background: #fafafa;
}

.layouts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.layout-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.layout-checkbox:hover {
    border-color: #28a745;
    background: #f0fff0;
}

.layout-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.layout-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.layout-controls button {
    padding: 8px 16px;
    font-size: 13px;
    background: #e9ecef;
    color: #495057;
}

.layout-controls button:hover {
    background: #dee2e6;
}

/* ========== RESPONSIVO MOBILE ========== */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .container {
        padding: 15px;
        border-radius: 10px;
    }
    
    h1 {
        font-size: 1.5rem;
        text-align: center;
    }
    
    h2 {
        font-size: 1.2rem;
    }
    
    input[type="text"],
    input[type="password"],
    input[type="email"],
    input[type="date"],
    input[type="number"],
    select,
    textarea {
        padding: 14px 12px;
    }
    
    button,
    .btn {
        width: 100%;
        padding: 14px 20px;
        font-size: 16px;
    }
    
    .layouts-grid {
        grid-template-columns: 1fr;
    }
    
    .layout-controls {
        flex-direction: column;
    }
    
    table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    th, td {
        padding: 10px 8px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 5px;
    }
    
    .container {
        padding: 10px;
        border-radius: 8px;
    }
    
    h1 {
        font-size: 1.3rem;
    }
    
    th, td {
        padding: 8px 5px;
        font-size: 12px;
    }
    
    .layout-checkbox {
        padding: 12px 10px;
    }
}

/* ========== UTILITÁRIOS ========== */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

.flex {
    display: flex;
}

.flex-wrap {
    flex-wrap: wrap;
}

.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }

.hidden {
    display: none !important;
}

/* ========== ANIMAÇÕES ========== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.3s ease;
}

/* ========== SCROLLBAR PERSONALIZADA ========== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* ========== PRINT ========== */
@media print {
    body {
        background: white;
        padding: 0;
    }
    
    .container {
        box-shadow: none;
        padding: 0;
    }
    
    button,
    .btn,
    .no-print {
        display: none !important;
    }
}
