/**
 * STYLE.CSS - RV PDV System
 * Estilos principais e componentes reutilizáveis
 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --cor-primaria: #667eea;
    --cor-secundaria: #764ba2;
    --cor-sucesso: #28a745;
    --cor-perigo: #dc3545;
    --cor-aviso: #ffc107;
    --cor-info: #17a2b8;
    --cor-fundo: #f5f5f5;
    --cor-texto: #333;
    --cor-texto-claro: #999;
    --cor-borda: #ddd;
    --sombra-leve: 0 2px 5px rgba(0, 0, 0, 0.05);
    --sombra-media: 0 5px 15px rgba(0, 0, 0, 0.1);
}

html, body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--cor-texto);
    background-color: var(--cor-fundo);
    height: 100%;
}

/* ===================================================================
   TIPOGRAFIA
   =================================================================== */

h1, h2, h3, h4, h5, h6 {
    color: var(--cor-texto);
    font-weight: 600;
}

h1 {
    font-size: 28px;
    margin-bottom: 10px;
}

h2 {
    font-size: 24px;
    margin-bottom: 10px;
}

h3 {
    font-size: 18px;
    margin-bottom: 15px;
}

p {
    line-height: 1.6;
    margin-bottom: 10px;
}

a {
    color: var(--cor-primaria);
    text-decoration: none;
    transition: color 0.3s;
}

a:hover {
    color: var(--cor-secundaria);
}

/* ===================================================================
   FORMULÁRIOS
   =================================================================== */

input, select, textarea {
    font-family: inherit;
    font-size: 14px;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--cor-primaria);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
select,
textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--cor-borda);
    border-radius: 5px;
    background: white;
    transition: all 0.3s;
}

input[type="checkbox"],
input[type="radio"] {
    cursor: pointer;
    margin-right: 5px;
}

/* ===================================================================
   BOTÕES
   =================================================================== */

.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
    text-decoration: none;
    text-align: center;
    vertical-align: middle;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--sombra-media);
}

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

.btn-primary {
    background: linear-gradient(135deg, var(--cor-primaria) 0%, var(--cor-secundaria) 100%);
    color: white;
}

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

.btn-success {
    background: var(--cor-sucesso);
    color: white;
}

.btn-danger {
    background: var(--cor-perigo);
    color: white;
}

.btn-warning {
    background: var(--cor-aviso);
    color: #333;
}

.btn-info {
    background: var(--cor-info);
    color: white;
}

.btn-small {
    padding: 5px 12px;
    font-size: 12px;
}

.btn-block {
    width: 100%;
    display: block;
}

/* ===================================================================
   ALERTAS
   =================================================================== */

.alert {
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
    border-left: 4px solid;
}

.alert-success {
    background: #d4edda;
    border-left-color: var(--cor-sucesso);
    color: #155724;
}

.alert-danger {
    background: #f8d7da;
    border-left-color: var(--cor-perigo);
    color: #721c24;
}

.alert-warning {
    background: #fff3cd;
    border-left-color: var(--cor-aviso);
    color: #856404;
}

.alert-info {
    background: #d1ecf1;
    border-left-color: var(--cor-info);
    color: #0c5460;
}

/* ===================================================================
   TABELAS
   =================================================================== */

table {
    width: 100%;
    border-collapse: collapse;
}

table th {
    background: #f5f5f5;
    padding: 12px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid var(--cor-borda);
    color: var(--cor-texto-claro);
    font-size: 13px;
}

table td {
    padding: 12px;
    border-bottom: 1px solid var(--cor-borda);
}

table tr:hover {
    background: #fafafa;
}

table tr:last-child td {
    border-bottom: none;
}

/* ===================================================================
   BADGES
   =================================================================== */

.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.badge-success {
    background: #d4edda;
    color: #155724;
}

.badge-danger {
    background: #f8d7da;
    color: #721c24;
}

.badge-warning {
    background: #fff3cd;
    color: #856404;
}

.badge-info {
    background: #d1ecf1;
    color: #0c5460;
}

.badge-primary {
    background: #cfe2ff;
    color: #084298;
}

/* ===================================================================
   CARTÕES (CARDS)
   =================================================================== */

.card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: var(--sombra-leve);
    margin-bottom: 20px;
}

.card h3 {
    margin-top: 0;
}

/* ===================================================================
   MODAIS
   =================================================================== */

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 8px;
    max-width: 500px;
    width: 90%;
    box-shadow: var(--sombra-media);
    animation: slideDown 0.3s ease;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 24px;
    cursor: pointer;
    color: var(--cor-texto-claro);
}

/* ===================================================================
   LOADING/SPINNER
   =================================================================== */

.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--cor-borda);
    border-top-color: var(--cor-primaria);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* ===================================================================
   GRID
   =================================================================== */

.grid {
    display: grid;
    gap: 20px;
}

.grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.grid-4 {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

/* ===================================================================
   FLEXBOX
   =================================================================== */

.flex {
    display: flex;
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.flex-column {
    display: flex;
    flex-direction: column;
}

/* ===================================================================
   ESPAÇAMENTO
   =================================================================== */

.mt-1 { margin-top: 5px; }
.mt-2 { margin-top: 10px; }
.mt-3 { margin-top: 15px; }
.mt-4 { margin-top: 20px; }
.mt-5 { margin-top: 30px; }

.mb-1 { margin-bottom: 5px; }
.mb-2 { margin-bottom: 10px; }
.mb-3 { margin-bottom: 15px; }
.mb-4 { margin-bottom: 20px; }
.mb-5 { margin-bottom: 30px; }

.p-1 { padding: 5px; }
.p-2 { padding: 10px; }
.p-3 { padding: 15px; }
.p-4 { padding: 20px; }
.p-5 { padding: 30px; }

/* ===================================================================
   UTILIDADES
   =================================================================== */

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

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

.text-muted {
    color: var(--cor-texto-claro);
}

.text-small {
    font-size: 12px;
}

.text-bold {
    font-weight: bold;
}

.d-none {
    display: none;
}

.d-block {
    display: block;
}

.d-inline {
    display: inline;
}

.d-inline-block {
    display: inline-block;
}

.cursor-pointer {
    cursor: pointer;
}

.overflow-hidden {
    overflow: hidden;
}

.overflow-auto {
    overflow: auto;
}

/* ===================================================================
   RESPONSIVO
   =================================================================== */

@media (max-width: 768px) {
    .grid-2, .grid-3, .grid-4 {
        grid-template-columns: 1fr;
    }
    
    table {
        font-size: 12px;
    }
    
    table th, table td {
        padding: 8px;
    }
}

/* ===================================================================
   ANIMAÇÕES
   =================================================================== */

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideDown {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

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

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* ===================================================================
   DARK MODE (OPCIONAL)
   =================================================================== */

@media (prefers-color-scheme: dark) {
    :root {
        --cor-fundo: #1a1a1a;
        --cor-texto: #e0e0e0;
        --cor-texto-claro: #999;
        --cor-borda: #333;
    }
    
    body {
        background: var(--cor-fundo);
    }
    
    .card {
        background: #2a2a2a;
    }
    
    table th {
        background: #2a2a2a;
    }
    
    table tr:hover {
        background: #333;
    }
    
    input, select, textarea {
        background: #2a2a2a;
        color: var(--cor-texto);
        border-color: var(--cor-borda);
    }
}
