/* Custom styles for Interface de Acesso */

/* Theme variables */
:root {
    /* Default theme (Blue) */
    --primary-color: #0d6efd;
    --primary-color-dark: #0b5ed7;
    --primary-color-darker: #0a58ca;
    --primary-color-light: rgba(13, 110, 253, 0.25);
    --primary-color-very-light: rgba(13, 110, 253, 0.05);

    --secondary-color: #6c757d;
    --success-color: #198754;
    --info-color: #0dcaf0;
    --warning-color: #ffc107;
    --danger-color: #dc3545;

    --bg-color: #f8f9fa;
    --bg-color-alt: #f1f1f1;
    --text-color: #212529;
    --text-color-light: #6c757d;
    --border-color: #e9ecef;

    --shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --shadow-md: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);

    --font-family: 'Roboto', sans-serif;
    --border-radius: 0.5rem;
    --border-radius-sm: 0.25rem;
}

/* Theme: Green */
.theme-green {
    --primary-color: #198754;
    --primary-color-dark: #157347;
    --primary-color-darker: #146c43;
    --primary-color-light: rgba(25, 135, 84, 0.25);
    --primary-color-very-light: rgba(25, 135, 84, 0.05);
}

/* Theme: Purple */
.theme-purple {
    --primary-color: #6f42c1;
    --primary-color-dark: #6610f2;
    --primary-color-darker: #5a01d7;
    --primary-color-light: rgba(111, 66, 193, 0.25);
    --primary-color-very-light: rgba(111, 66, 193, 0.05);
}

/* Theme: Orange */
.theme-orange {
    --primary-color: #fd7e14;
    --primary-color-dark: #e96b02;
    --primary-color-darker: #d56203;
    --primary-color-light: rgba(253, 126, 20, 0.25);
    --primary-color-very-light: rgba(253, 126, 20, 0.05);
}

/* Theme: Dark */
.theme-dark {
    --primary-color: #343a40;
    --primary-color-dark: #212529;
    --primary-color-darker: #1a1e21;
    --primary-color-light: rgba(52, 58, 64, 0.25);
    --primary-color-very-light: rgba(52, 58, 64, 0.05);
    --bg-color: #212529;
    --bg-color-alt: #343a40;
    --text-color: #f8f9fa;
    --text-color-light: #adb5bd;
    --border-color: #495057;
}

/* Global styles */
body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-color);
}

/* Header styles */
.navbar {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    background-color: var(--primary-color) !important;
}

.navbar-dark .navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.85);
}

.navbar-dark .navbar-nav .nav-link:hover,
.navbar-dark .navbar-nav .nav-link:focus {
    color: rgba(255, 255, 255, 1);
}

.navbar-dark .navbar-toggler {
    border-color: rgba(255, 255, 255, 0.1);
}

.navbar-brand {
    font-weight: 700;
}

.dropdown-menu {
    background-color: var(--bg-color-alt);
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    color: var(--text-color);
}

.dropdown-item {
    color: var(--text-color);
}

.dropdown-item:hover, .dropdown-item:focus {
    background-color: var(--primary-color-very-light);
    color: var(--text-color);
}

/* Card styles */
.card {
    border-radius: var(--border-radius);
    border: none;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    background-color: var(--bg-color-alt);
    color: var(--text-color);
}

.card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-5px);
}

.card-header {
    border-top-left-radius: var(--border-radius) !important;
    border-top-right-radius: var(--border-radius) !important;
    font-weight: 600;
}

/* Button styles */
.btn {
    border-radius: var(--border-radius-sm);
    padding: 0.5rem 1.5rem;
    font-weight: 500;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: var(--primary-color-dark);
    border-color: var(--primary-color-darker);
}

/* Form styles */
.form-control {
    border-radius: var(--border-radius-sm);
    padding: 0.5rem 1rem;
    background-color: var(--bg-color);
    color: var(--text-color);
    border-color: var(--border-color);
}

.form-control:focus {
    box-shadow: 0 0 0 0.25rem var(--primary-color-light);
    background-color: var(--bg-color);
    color: var(--text-color);
}

.form-select {
    background-color: var(--bg-color);
    color: var(--text-color);
    border-color: var(--border-color);
}

.form-select:focus {
    box-shadow: 0 0 0 0.25rem var(--primary-color-light);
    background-color: var(--bg-color);
    color: var(--text-color);
}

/* Dashboard stats cards */
.card.bg-primary, .card.bg-success, .card.bg-info, .card.bg-warning {
    color: white;
}

.card .display-4 {
    font-weight: 700;
}

/* Custom color classes */
.bg-primary {
    background-color: var(--primary-color) !important;
}

.bg-secondary {
    background-color: var(--secondary-color) !important;
}

.bg-success {
    background-color: var(--success-color) !important;
}

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

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

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

.text-primary {
    color: var(--primary-color) !important;
}

.text-purple {
    color: #6f42c1 !important;
}

.border-primary {
    border-color: var(--primary-color) !important;
}

/* Footer styles */
.footer {
    margin-top: 3rem;
    padding: 1.5rem 0;
    background-color: var(--bg-color);
    border-top: 1px solid var(--border-color);
}

.footer .text-muted {
    color: var(--text-color-light) !important;
}

/* Login and registration forms */
.login-form, .registration-form {
    max-width: 400px;
    margin: 0 auto;
    background-color: var(--bg-color-alt);
    color: var(--text-color);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
}

/* Theme selector */
.theme-selector {
    display: flex;
    gap: 0.5rem;
    margin: 1rem 0;
}

.theme-option {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s ease;
}

.theme-option:hover, .theme-option.active {
    transform: scale(1.1);
    border-color: var(--text-color);
}

.theme-option.blue {
    background-color: #0d6efd;
}

.theme-option.green {
    background-color: #198754;
}

.theme-option.purple {
    background-color: #6f42c1;
}

.theme-option.orange {
    background-color: #fd7e14;
}

.theme-option.dark {
    background-color: #343a40;
}

/* Theme dropdown styles */
.dropdown-item.theme-option {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
    transition: all 0.2s ease;
}

.dropdown-item.theme-option:hover {
    transform: translateX(5px);
}

.dropdown-item.theme-option.active::after {
    content: "\f00c";
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    margin-left: auto;
    color: var(--success-color);
}

/* Mobile optimizations for theme selector */
@media (max-width: 768px) {
    .dropdown-item.theme-option {
        padding: 0.75rem 1rem;
    }
    
    .dropdown-item.theme-option i {
        font-size: 1.1rem;
        width: 20px;
        text-align: center;
        margin-right: 0.75rem;
    }
    
    /* Add a fixed position theme toggle for easy access */
    .theme-toggle-fixed {
        position: fixed;
        bottom: 20px;
        right: 20px;
        width: 50px;
        height: 50px;
        border-radius: 50%;
        background-color: var(--primary-color);
        color: white;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
        z-index: 1040;
        border: none;
        font-size: 1.25rem;
    }
    
    .theme-toggle-fixed:hover, .theme-toggle-fixed:focus {
        background-color: var(--primary-color-dark);
    }
    
    /* Ensure dropdown is wide enough on mobile */
    #themeDropdown + .dropdown-menu {
        min-width: 200px;
    }
}

/* Responsive adjustments */
@media (max-width: 992px) {
    .container {
        max-width: 100%;
        padding-left: 15px;
        padding-right: 15px;
    }

    .navbar-collapse {
        background-color: var(--primary-color);
        padding: 1rem;
        border-radius: var(--border-radius);
        box-shadow: var(--shadow-sm);
        position: absolute;
        top: 56px;
        left: 0;
        right: 0;
        z-index: 1000;
        margin: 0 15px;
    }
    
    .navbar-nav .nav-item {
        margin-bottom: 0.5rem;
    }
    
    .navbar-nav .dropdown-menu {
        border: none;
        background-color: rgba(0, 0, 0, 0.1);
        box-shadow: none;
        padding: 0.5rem;
    }
    
    .navbar-dark .navbar-nav .nav-link {
        padding: 0.5rem;
        border-radius: var(--border-radius-sm);
    }
    
    .navbar-dark .navbar-nav .nav-link:hover,
    .navbar-dark .navbar-nav .nav-link:focus {
        background-color: rgba(255, 255, 255, 0.1);
    }
}

@media (max-width: 768px) {
    .card {
        margin-bottom: 1rem;
    }

    .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }

    .btn-group .btn {
        width: auto;
        margin-bottom: 0;
    }

    .table-responsive {
        overflow-x: auto;
    }

    .login-form, .registration-form {
        padding: 1.5rem;
        width: 90%;
        max-width: none;
    }
    
    /* Improve form layouts */
    .form-group {
        margin-bottom: 1rem;
    }
    
    .form-label {
        font-weight: 500;
        margin-bottom: 0.25rem;
    }
    
    .form-control, .form-select {
        padding: 0.75rem;
        font-size: 1rem;
        height: auto;
    }
    
    /* Make form columns stack on mobile */
    .row .col-md-6, .row .col-md-4, .row .col-md-3 {
        margin-bottom: 1rem;
    }
    
    /* Adjust form actions */
    .form-actions {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .form-actions .btn {
        margin-left: 0 !important;
    }
}

@media (max-width: 576px) {
    body {
        font-size: 0.9rem;
    }

    .card-body {
        padding: 1rem;
    }

    .login-form, .registration-form {
        padding: 1rem;
    }
}

/* Status badges */
.badge {
    padding: 0.5em 0.75em;
    font-weight: 500;
}

/* Table styles */
.table {
    color: var(--text-color);
    border-color: var(--border-color);
}

.table th {
    font-weight: 600;
    background-color: var(--bg-color);
    color: var(--text-color);
    border-color: var(--border-color);
}

.table td {
    border-color: var(--border-color);
}

.table-hover tbody tr:hover {
    background-color: var(--primary-color-very-light);
    color: var(--text-color);
}

/* Responsive table styles for mobile */
@media (max-width: 768px) {
    /* Card-based tables for mobile */
    .table-responsive-card {
        border: 0;
    }
    
    .table-responsive-card thead {
        display: none; /* Hide table header on mobile */
    }
    
    .table-responsive-card tbody tr {
        display: block;
        margin-bottom: 1rem;
        border: 1px solid var(--border-color);
        border-radius: var(--border-radius);
        background-color: var(--bg-color-alt);
        box-shadow: var(--shadow-sm);
    }
    
    .table-responsive-card tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.75rem;
        text-align: right;
        border-bottom: 1px solid var(--border-color);
    }
    
    .table-responsive-card tbody td:last-child {
        border-bottom: 0;
    }
    
    .table-responsive-card tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        text-align: left;
        margin-right: auto;
    }
    
    /* Action buttons in tables */
    .table-responsive-card .btn-group {
        display: flex;
        justify-content: flex-end;
        width: 100%;
    }
    
    .table-responsive-card .btn-group .btn {
        flex: 0 0 auto;
        margin-left: 0.25rem;
    }
    
    /* Standard responsive tables */
    .table-responsive {
        border: 0;
    }
    
    .table-responsive .table {
        min-width: 650px; /* Ensure table is wide enough to scroll */
    }
    
    /* Compact tables for mobile */
    .table-sm td, .table-sm th {
        padding: 0.5rem;
    }
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-color-alt);
}

::-webkit-scrollbar-thumb {
    background: var(--text-color-light);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-color);
}

