/* Responsive CSS for Mobile Devices */

/* Reset and Base Styles */
* {
    box-sizing: border-box;
}

/* Tamanho de fonte base um pouco menor */
html,
body {
    font-size: 15px;
    /* ~6% menor que 16px */
}

/* Ajustes sutis em elementos comuns */
.table {
    font-size: 0.95rem;
}

.navbar,
.dropdown-menu {
    font-size: 0.95rem;
}

.card,
.modal {
    font-size: 0.95rem;
}

/* Mobile-first approach */
@media screen and (max-width: 768px) {

    /* General mobile styles */
    body {
        font-size: 14px;
        padding: 10px;
    }

    /* Login container mobile adjustments */
    .login-container {
        padding: 20px !important;
        margin: 10px !important;
        width: calc(100% - 20px) !important;
        max-width: none !important;
    }

    /* Form elements mobile optimization */
    input[type="email"],
    input[type="password"],
    .btn-login {
        padding: 15px !important;
        font-size: 16px !important;
        /* Prevents zoom on iOS */
    }

    /* Attendance card mobile adjustments */
    .attendance-card {
        margin: 0 !important;
        max-width: 100% !important;
    }

    /* Container adjustments */
    .container {
        padding-left: 10px !important;
        padding-right: 10px !important;
    }

    /* Card body padding */
    .card-body {
        padding: 15px !important;
    }

    /* Navigation mobile styles */
    .navbar {
        padding: 10px !important;
    }

    .navbar-brand {
        font-size: 1.1rem !important;
    }

    .nav-link {
        padding: 8px 12px !important;
    }

    /* Clock display mobile */
    .clock {
        font-size: 1.8rem !important;
        margin: 15px 0 !important;
    }

    /* Table responsive */
    .table-responsive {
        border: none;
    }

    .table {
        font-size: 12px;
    }

    .table th,
    .table td {
        padding: 8px 4px !important;
        white-space: nowrap;
    }

    /* Button adjustments */
    .btn {
        padding: 10px 15px !important;
        font-size: 14px !important;
    }

    .btn-group {
        display: flex;
        flex-direction: column;
        width: 100%;
    }

    .btn-group .btn {
        margin-bottom: 5px;
        border-radius: 4px !important;
    }

    /* Form groups mobile */
    .form-group {
        margin-bottom: 15px !important;
    }

    /* Row adjustments */
    .row {
        margin-left: -5px !important;
        margin-right: -5px !important;
    }

    .col-md-6,
    .col-md-4,
    .col-md-8,
    .col-md-12 {
        padding-left: 5px !important;
        padding-right: 5px !important;
        margin-bottom: 15px;
    }

    /* Card adjustments */
    .card {
        margin-bottom: 15px !important;
    }

    .card-header {
        padding: 10px 15px !important;
        font-size: 14px !important;
    }

    /* Alert messages */
    .alert {
        padding: 10px !important;
        margin-bottom: 15px !important;
        font-size: 14px !important;
    }

    /* Status indicators */
    .status-indicator {
        width: 12px !important;
        height: 12px !important;
    }

    /* Hide unnecessary elements on mobile */
    .d-none-mobile {
        display: none !important;
    }
}

/* Tablet styles */
@media screen and (min-width: 769px) and (max-width: 1024px) {
    .login-container {
        max-width: 500px !important;
    }

    .attendance-card {
        max-width: 900px !important;
    }

    .container {
        padding-left: 20px !important;
        padding-right: 20px !important;
    }
}

/* Large screens */
@media screen and (min-width: 1025px) {
    .login-container {
        max-width: 400px !important;
    }

    .attendance-card {
        max-width: 1000px !important;
    }
}

/* Landscape orientation adjustments */
@media screen and (orientation: landscape) and (max-height: 500px) {
    .login-container {
        padding: 15px !important;
    }

    .clock {
        font-size: 1.5rem !important;
        margin: 10px 0 !important;
    }
}

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {

    .btn,
    .nav-link,
    input[type="submit"],
    button {
        min-height: 44px;
        /* Apple's recommended touch target size */
        min-width: 44px;
    }

    .table th,
    .table td {
        padding: 12px 8px !important;
    }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2),
(min-resolution: 192dpi) {
    .status-indicator {
        border: 1px solid rgba(0, 0, 0, 0.1);
    }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Dark mode support — desativado: o tema é gerido por theme.css */
/* Se desejar suporte a dark mode no futuro, implemente-o em theme.css */

/* Tabelas: contraste de texto e linhas alternadas (tema claro) */
.table {
    color: #212529 !important;
}

.table th,
.table td {
    color: #212529 !important;
}

/* Corrigir cabeçalho escuro: garantir texto branco sobre fundo escuro */
.table-dark,
.table-dark th,
.table-dark thead,
.table-dark thead th,
.table-dark thead tr th {
    color: #ffffff !important;
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: #f7f7f9 !important;
    color: #212529 !important;
}

.table-striped tbody tr:nth-of-type(even) {
    background-color: #ffffff !important;
    color: #212529 !important;
}

.table-hover tbody tr:hover {
    background-color: #eef2f7 !important;
    color: #212529 !important;
}

.table .badge {
    color: #fff !important;
    /* garantir contraste dos badges */
}

/* Print styles */
@media print {

    .navbar,
    .btn,
    .card-header {
        display: none !important;
    }

    .card {
        border: none !important;
        box-shadow: none !important;
    }

    body {
        background: white !important;
        color: black !important;
    }
}