/* Sistema de Gestão de Jornada - Estilos */

:root {
    --primary-color: #0d6efd;
    --success-color: #198754;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
}

body {
    background-color: #f8f9fa;
}

/* Navbar */
.navbar-brand i {
    margin-right: 8px;
}

.navbar-nav .nav-link {
    padding: 0.5rem 1rem;
    border-radius: 4px;
    margin: 0 2px;
}

.navbar-nav .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.navbar-nav .nav-link.active {
    background-color: rgba(255, 255, 255, 0.2);
}

.navbar-nav .nav-link i {
    margin-right: 6px;
}

/* Cards */
.card {
    border: none;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    transition: box-shadow 0.15s ease-in-out;
}

.card:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.card-header {
    background-color: white;
    border-bottom: 1px solid #e9ecef;
    font-weight: 500;
}

/* Tables */
.table th {
    font-weight: 600;
    color: #495057;
    border-top: none;
}

.table-hover tbody tr:hover {
    background-color: #f1f3f4;
}

/* Status badges */
.badge-status-presente {
    background-color: var(--success-color);
}

.badge-status-ausente,
.badge-status-falta {
    background-color: var(--danger-color);
}

.badge-status-atrasado {
    background-color: var(--warning-color);
    color: #000;
}

.badge-status-folga {
    background-color: #6c757d;
}

.badge-status-pendente {
    background-color: var(--warning-color);
    color: #000;
}

.badge-status-justificada {
    background-color: #17a2b8;
}

.badge-status-aprovada {
    background-color: var(--success-color);
}

.badge-status-rejeitada {
    background-color: var(--danger-color);
}

/* Buttons */
.btn-action {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

.btn-group-actions .btn {
    margin-right: 4px;
}

/* Login page */
#loginPage {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 50%, #1e3c72 100%);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    z-index: 1000;
}

#loginPage::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100' viewBox='0 0 100 100'%3E%3Ccircle cx='50' cy='50' r='40' fill='none' stroke='rgba(255,255,255,0.05)' stroke-width='2'/%3E%3Cline x1='50' y1='50' x2='50' y2='20' stroke='rgba(255,255,255,0.08)' stroke-width='2' stroke-linecap='round'/%3E%3Cline x1='50' y1='50' x2='70' y2='50' stroke='rgba(255,255,255,0.08)' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
    background-size: 150px 150px;
    opacity: 0.5;
}

#loginPage::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 60%);
    animation: float 20s ease-in-out infinite;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(10%, 10%) rotate(5deg); }
    50% { transform: translate(5%, -5%) rotate(-5deg); }
    75% { transform: translate(-10%, 5%) rotate(3deg); }
}

.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    position: relative;
    z-index: 1;
}

.login-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-logo {
    margin-bottom: 30px;
    text-align: center;
}

.login-logo img {
    height: 100px;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.3));
}

#loginPage .card {
    width: 100%;
    max-width: 400px;
    position: relative;
    z-index: 1;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
    border-radius: 12px;
}

#loginPage .card-body {
    padding: 2.5rem;
}

#loginPage .text-primary {
    color: #1e3c72 !important;
}

#loginPage .btn-primary {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    border: none;
    padding: 0.75rem 1.5rem;
    font-weight: 500;
    transition: transform 0.2s, box-shadow 0.2s;
}

#loginPage .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(30, 60, 114, 0.3);
}

#loginPage .form-control {
    padding: 0.75rem 1rem;
    border-radius: 8px;
}

#loginPage .form-control:focus {
    border-color: #2a5298;
    box-shadow: 0 0 0 0.2rem rgba(42, 82, 152, 0.25);
}

/* Dashboard cards */
.card.bg-primary,
.card.bg-success,
.card.bg-warning,
.card.bg-danger {
    border: none;
}

/* List group */
.list-group-item {
    border-left: none;
    border-right: none;
}

.list-group-item:first-child {
    border-top: none;
}

/* Forms */
.form-label {
    font-weight: 500;
    color: #495057;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* Responsive */
@media (max-width: 768px) {
    .card-body h2 {
        font-size: 1.5rem;
    }

    .table-responsive {
        font-size: 0.875rem;
    }
}

/* Loading state */
.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Animations */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* Planilha de Jornadas */
.planilha-container {
    position: relative;
}

#tabelaPlanilha {
    font-size: 0.75rem;
    border-collapse: separate;
    border-spacing: 0;
}

#tabelaPlanilha thead {
    position: sticky;
    top: 0;
    z-index: 10;
    background: white;
}

#tabelaPlanilha thead th {
    position: sticky;
    top: 0;
    background: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    white-space: nowrap;
    text-align: center;
    vertical-align: middle;
    padding: 4px 6px;
}

#tabelaPlanilha thead tr:first-child th {
    background: #e9ecef;
    font-weight: 600;
}

#tabelaPlanilha thead tr:nth-child(2) th {
    background: #f8f9fa;
    font-size: 0.7rem;
}

#tabelaPlanilha thead tr:nth-child(3) th {
    background: #fff;
    font-size: 0.65rem;
    color: #6c757d;
}

#tabelaPlanilha .col-fixed {
    position: sticky;
    left: 0;
    background: white;
    z-index: 5;
    border-right: 2px solid #dee2e6;
}

#tabelaPlanilha thead .col-fixed {
    z-index: 15;
}

#tabelaPlanilha .col-numero {
    width: 30px;
    text-align: center;
}

#tabelaPlanilha .col-matricula {
    width: 100px;
}

#tabelaPlanilha .col-nome {
    width: 180px;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#tabelaPlanilha .col-empresa {
    width: 60px;
}

#tabelaPlanilha tbody td {
    padding: 2px 4px;
    vertical-align: middle;
}

#tabelaPlanilha tbody tr:hover {
    background-color: #f1f3f4;
}

#tabelaPlanilha .input-hora {
    width: 50px;
    padding: 2px 4px;
    font-size: 0.7rem;
    text-align: center;
    border: 1px solid #ced4da;
    border-radius: 3px;
}

#tabelaPlanilha .input-hora:focus {
    border-color: #0d6efd;
    outline: none;
    box-shadow: 0 0 0 2px rgba(13, 110, 253, 0.15);
}

#tabelaPlanilha .input-obs {
    width: 40px;
    padding: 2px 4px;
    font-size: 0.65rem;
    text-align: center;
    border: 1px solid #ced4da;
    border-radius: 3px;
}

#tabelaPlanilha .input-codigo {
    width: 42px;
    padding: 1px 2px;
    font-size: 0.7rem;
    text-align: center;
    border: 1px solid #ced4da;
    border-radius: 3px;
    background-color: #fff;
}

#tabelaPlanilha .hora-real {
    font-size: 0.6rem;
    color: #6c757d;
    text-align: center;
    margin-top: 1px;
    line-height: 1;
}

#tabelaPlanilha .hora-real-int {
    color: #0d6efd;
}

#tabelaOcorrencias .batidas-info {
    font-size: 0.72rem;
    color: #6c757d;
    line-height: 1.2;
    margin-top: 2px;
    font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}

#tabelaOcorrencias .hora-abrev {
    color: #6c757d;
    font-size: 0.85em;
    margin-left: 4px;
}

#tabelaPlanilha .input-codigo:focus {
    border-color: #0d6efd;
    outline: none;
    box-shadow: 0 0 0 2px rgba(13, 110, 253, 0.15);
}

#tabelaPlanilha .dia-domingo {
    background-color: #fff3cd !important;
}

#tabelaPlanilha .dia-sabado {
    background-color: #e2e3e5 !important;
}

#tabelaPlanilha .celula-folga {
    background-color: #cfe2ff !important;
}

#tabelaPlanilha .celula-editada {
    background-color: #d1e7dd !important;
}

.grupo-dia {
    border-left: 1px solid #dee2e6;
}

.grupo-dia:first-of-type {
    border-left: none;
}

/* Estilos para preview de importação */
#previewConteudo .dept-preview {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 12px;
}

#previewConteudo .dept-preview h6 {
    margin-bottom: 8px;
    color: #0d6efd;
}

#previewConteudo .badge-novo {
    background-color: #198754;
}

#previewConteudo .badge-existente {
    background-color: #6c757d;
}

/* Print styles */
@media print {
    .navbar,
    .btn,
    .modal {
        display: none !important;
    }

    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }

    #tabelaPlanilha .input-hora,
    #tabelaPlanilha .input-obs,
    #tabelaPlanilha .input-codigo {
        border: none;
        background: transparent;
    }
}
