/* Estilos personalizados do sistema */

:root {
    --primary-color: #007bff;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
}

body {
    background-color: #f5f5f5;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.navbar-brand {
    font-weight: bold;
    font-size: 1.5rem;
}

.card {
    border: none;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.card-header {
    background: linear-gradient(135deg, var(--primary-color), #0056b3);
    color: white;
    border-radius: 10px 10px 0 0 !important;
    border: none;
    font-weight: 600;
}

.card-header h5, .card-header h6 {
    margin: 0;
    font-weight: 600;
}

.btn-group-sm .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

.badge {
    font-size: 0.75rem;
    padding: 0.5em 0.75em;
}

.table th {
    border-top: none;
    font-weight: 600;
    color: var(--dark-color);
    background-color: var(--light-color);
}

.table-hover tbody tr:hover {
    background-color: rgba(0,123,255,0.1);
}

.alert {
    border: none;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* Cards de resumo */
.card.bg-primary,
.card.bg-success,
.card.bg-warning,
.card.bg-danger {
    border: none;
    border-radius: 15px;
    transition: transform 0.3s ease;
}

.card.bg-primary:hover,
.card.bg-success:hover,
.card.bg-warning:hover,
.card.bg-danger:hover {
    transform: translateY(-5px);
}

/* Botões de ação */
.btn-action {
    margin: 2px;
    border-radius: 20px;
    transition: all 0.3s ease;
}

.btn-action:hover {
    transform: scale(1.1);
}

/* Modal personalizado */
.modal-content {
    border: none;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.modal-header {
    background: linear-gradient(135deg, var(--primary-color), #0056b3);
    color: white;
    border-radius: 15px 15px 0 0;
    border: none;
}

.modal-footer {
    border: none;
    border-radius: 0 0 15px 15px;
}

/* Formulários */
.form-control {
    border-radius: 10px;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,0.25);
}

.form-label {
    font-weight: 600;
    color: var(--dark-color);
}

/* Dashboard */
.chart-container {
    position: relative;
    height: 300px;
    margin: 20px 0;
}

/* Responsividade Mobile */
@media (max-width: 768px) {
    .container {
        padding: 5px;
    }
    
    .card {
        margin-bottom: 10px;
        border-radius: 8px;
    }
    
    .card-header {
        padding: 10px 15px;
        font-size: 0.9rem;
    }
    
    .card-body {
        padding: 15px;
    }
    
    /* Navbar mobile */
    .navbar-brand {
        font-size: 1.2rem;
    }
    
    .navbar-text {
        font-size: 0.8rem;
        margin-right: 10px !important;
    }
    
    /* Botões mobile */
    .btn-group-sm .btn {
        padding: 0.15rem 0.3rem;
        font-size: 0.75rem;
        margin: 1px;
    }
    
    .btn {
        font-size: 0.85rem;
        padding: 0.5rem 0.75rem;
    }
    
    /* Tabelas mobile */
    .table-responsive {
        font-size: 0.8rem;
        border-radius: 8px;
    }
    
    .table th, .table td {
        padding: 0.5rem 0.3rem;
        vertical-align: middle;
    }
    
    /* Cards de resumo mobile */
    .row .col-md-3 {
        margin-bottom: 10px;
    }
    
    .card.bg-primary,
    .card.bg-success,
    .card.bg-warning,
    .card.bg-danger {
        padding: 15px;
    }
    
    .card.bg-primary h4,
    .card.bg-success h4,
    .card.bg-warning h4,
    .card.bg-danger h4 {
        font-size: 1.5rem;
    }
    
    .card.bg-primary p,
    .card.bg-success p,
    .card.bg-warning p,
    .card.bg-danger p {
        font-size: 0.8rem;
    }
    
    /* Formulários mobile */
    .form-control {
        font-size: 16px; /* Evita zoom no iOS */
        padding: 10px 12px;
    }
    
    .form-label {
        font-size: 0.9rem;
        margin-bottom: 5px;
    }
    
    /* Modal mobile */
    .modal-dialog {
        margin: 10px;
        max-width: calc(100% - 20px);
    }
    
    .modal-content {
        border-radius: 10px;
    }
    
    .modal-header {
        padding: 15px;
    }
    
    .modal-body {
        padding: 15px;
    }
    
    .modal-footer {
        padding: 10px 15px;
    }
    
    /* Badges mobile */
    .badge {
        font-size: 0.7rem;
        padding: 0.4em 0.6em;
    }
    
    /* Lista de avisos mobile */
    .list-group-item {
        padding: 10px;
        margin-bottom: 5px;
        border-radius: 8px;
    }
    
    .list-group-item h6 {
        font-size: 0.9rem;
        margin-bottom: 5px;
    }
    
    .list-group-item p {
        font-size: 0.8rem;
        margin-bottom: 5px;
    }
    
    .list-group-item small {
        font-size: 0.7rem;
    }
    
    /* Botões de ação mobile */
    .btn-group {
        flex-wrap: wrap;
    }
    
    .btn-group .btn {
        margin: 1px;
        min-width: 35px;
    }
    
    /* Alertas mobile */
    .alert {
        padding: 10px 15px;
        margin-bottom: 10px;
        border-radius: 8px;
    }
    
    .alert h5 {
        font-size: 1rem;
        margin-bottom: 5px;
    }
    
    .alert ul {
        margin-bottom: 0;
        padding-left: 20px;
    }
    
    .alert li {
        font-size: 0.85rem;
        margin-bottom: 3px;
    }
    
    /* Notificações mobile */
    .notificacao-aviso {
        top: 10px !important;
        right: 10px !important;
        left: 10px !important;
        max-width: none !important;
        width: auto !important;
    }
    
    .notificacao-content {
        padding: 12px;
    }
    
    .notificacao-header {
        font-size: 0.9rem;
        margin-bottom: 8px;
    }
    
    .notificacao-body p {
        font-size: 0.85rem;
        margin-bottom: 6px;
    }
    
    .notificacao-body small {
        font-size: 0.75rem;
    }
    
    /* Menu lateral mobile */
    .d-grid .btn {
        margin-bottom: 5px;
        font-size: 0.85rem;
    }
    
    /* Gráficos mobile */
    .chart-container {
        height: 250px;
        margin: 15px 0;
    }
    
    /* Filtros mobile */
    .form-control-sm {
        font-size: 0.8rem;
        padding: 0.4rem 0.6rem;
    }
    
    /* Espaçamentos mobile */
    .mb-3 {
        margin-bottom: 1rem !important;
    }
    
    .mb-4 {
        margin-bottom: 1.5rem !important;
    }
    
    .mt-4 {
        margin-top: 1.5rem !important;
    }
    
    /* Texto mobile */
    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.3rem; }
    h3 { font-size: 1.2rem; }
    h4 { font-size: 1.1rem; }
    h5 { font-size: 1rem; }
    h6 { font-size: 0.9rem; }
    
    /* Ocultar elementos desnecessários no mobile */
    .d-none-mobile {
        display: none !important;
    }
    
    /* Melhorar scroll horizontal */
    .table-responsive {
        -webkit-overflow-scrolling: touch;
    }
    
    /* Botões de ação em tabelas mobile */
    .table .btn-group {
        display: flex;
        flex-direction: column;
        gap: 2px;
    }
    
    .table .btn-group .btn {
        width: 100%;
        margin: 1px 0;
        font-size: 0.7rem;
        padding: 0.25rem 0.5rem;
    }
}

/* Melhorias para telas muito pequenas */
@media (max-width: 480px) {
    .container {
        padding: 2px;
    }
    
    .card-body {
        padding: 10px;
    }
    
    .btn {
        font-size: 0.8rem;
        padding: 0.4rem 0.6rem;
    }
    
    .table th, .table td {
        padding: 0.3rem 0.2rem;
        font-size: 0.75rem;
    }
    
    .badge {
        font-size: 0.65rem;
        padding: 0.3em 0.5em;
    }
    
    .form-control {
        font-size: 16px;
        padding: 8px 10px;
    }
    
    .modal-dialog {
        margin: 5px;
        max-width: calc(100% - 10px);
    }
    
    .notificacao-aviso {
        top: 5px !important;
        right: 5px !important;
        left: 5px !important;
    }
    
    .notificacao-content {
        padding: 10px;
    }
    
    .chart-container {
        height: 200px;
    }
}

/* Orientação landscape no mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .navbar {
        padding: 0.25rem 1rem;
    }
    
    .container {
        padding: 5px;
    }
    
    .card {
        margin-bottom: 8px;
    }
    
    .card-body {
        padding: 10px;
    }
    
    .table th, .table td {
        padding: 0.3rem 0.2rem;
    }
    
    .btn {
        padding: 0.3rem 0.5rem;
        font-size: 0.8rem;
    }
}

/* Classes específicas para mobile */
.mobile-device {
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

.mobile-device .btn {
    min-height: 44px;
    touch-action: manipulation;
}

.mobile-device .form-control {
    font-size: 16px !important;
    -webkit-appearance: none;
    border-radius: 8px;
}

.mobile-device .table-responsive {
    -webkit-overflow-scrolling: touch;
    border-radius: 8px;
}

.mobile-device .modal-dialog {
    margin: 10px;
    max-height: calc(100vh - 20px);
    overflow-y: auto;
}

.mobile-device .navbar-brand {
    font-size: 1.1rem;
}

.mobile-device .card-header h5,
.mobile-device .card-header h6 {
    font-size: 1rem;
    margin-bottom: 0;
}

/* Melhorias para touch */
.touch-device .btn {
    padding: 12px 16px;
    font-size: 16px;
    border-radius: 8px;
}

.touch-device .btn-group .btn {
    padding: 8px 12px;
}

.touch-device .form-control {
    padding: 12px 16px;
    border-radius: 8px;
    border: 2px solid #dee2e6;
}

.touch-device .form-control:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Animações suaves para mobile */
@media (prefers-reduced-motion: no-preference) {
    .mobile-device .card {
        transition: transform 0.2s ease, box-shadow 0.2s ease;
    }
    
    .mobile-device .card:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    }
    
    .mobile-device .btn {
        transition: all 0.2s ease;
    }
    
    .mobile-device .btn:active {
        transform: scale(0.98);
    }
}

/* Melhorias para acessibilidade */
@media (prefers-reduced-motion: reduce) {
    .mobile-device * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Indicadores de carregamento mobile */
.mobile-device .btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.mobile-device .btn .fa-spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Melhorias para scroll */
.mobile-device .scroll-stopped {
    overflow: hidden;
}

/* Estilos para orientação landscape */
.landscape-mobile .navbar {
    padding: 0.2rem 0.5rem;
}

.landscape-mobile .container {
    padding: 2px;
}

.landscape-mobile .card-body {
    padding: 8px;
}

.landscape-mobile .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
}

.landscape-mobile .table th,
.landscape-mobile .table td {
    padding: 0.2rem 0.1rem;
    font-size: 0.7rem;
}

/* Melhorias para notificações mobile */
.mobile-device .notificacao-aviso {
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
}

.mobile-device .notificacao-content {
    padding: 16px;
}

.mobile-device .notificacao-header {
    font-size: 1rem;
    font-weight: 600;
}

.mobile-device .notificacao-body p {
    font-size: 0.9rem;
    line-height: 1.4;
}

.mobile-device .notificacao-footer .btn {
    padding: 8px 16px;
    font-size: 0.9rem;
    border-radius: 6px;
}

/* Animações */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

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

/* Loading spinner */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

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

/* Status badges */
.status-presente {
    background-color: var(--success-color) !important;
}

.status-atraso {
    background-color: var(--warning-color) !important;
}

.status-falta {
    background-color: var(--danger-color) !important;
}

.status-atestado {
    background-color: var(--info-color) !important;
}

.status-ferias {
    background-color: var(--primary-color) !important;
}

/* Sidebar */
.sidebar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: white;
}

.sidebar .nav-link {
    color: rgba(255,255,255,0.8);
    transition: all 0.3s ease;
}

.sidebar .nav-link:hover {
    color: white;
    background-color: rgba(255,255,255,0.1);
    border-radius: 10px;
}

.sidebar .nav-link.active {
    color: white;
    background-color: rgba(255,255,255,0.2);
    border-radius: 10px;
}

/* Tabelas responsivas */
.table-responsive {
    border-radius: 10px;
    overflow: hidden;
}

/* Botões de ação na tabela */
.table .btn-group {
    white-space: nowrap;
}

/* Cards de estatísticas */
.stats-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    transition: transform 0.3s ease;
}

.stats-card:hover {
    transform: translateY(-5px);
}

.stats-card h3 {
    font-size: 2.5rem;
    font-weight: bold;
    margin: 0;
}

.stats-card p {
    margin: 0;
    opacity: 0.9;
}

/* Alertas personalizados */
.alert-custom {
    border-left: 5px solid;
    border-radius: 10px;
    padding: 15px 20px;
    margin-bottom: 20px;
}

.alert-custom.alert-info {
    border-left-color: var(--info-color);
    background-color: rgba(23, 162, 184, 0.1);
}

.alert-custom.alert-warning {
    border-left-color: var(--warning-color);
    background-color: rgba(255, 193, 7, 0.1);
}

.alert-custom.alert-danger {
    border-left-color: var(--danger-color);
    background-color: rgba(220, 53, 69, 0.1);
}

/* Loading overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-content {
    background: white;
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .btn {
        display: none !important;
    }
}
