/* SIR System Custom Styles */

/* Root Variables for Color Scheme */
:root {
    --primary-color: #2196F3;
    --primary-light: #64B5F6;
    --primary-dark: #1976D2;
    --secondary-color: #4CAF50;
    --accent-color: #FFC107;
    --background-light: #f5f9fc;
    --text-dark: #212529;
    --text-muted: #6c757d;
    --border-color: #e0e0e0;
}

/* Top Bar Styles */
.top-bar {
    background: linear-gradient(to right, var(--primary-color), var(--primary-light));
    border-bottom: 1px solid var(--border-color);
    padding: 0.75rem 1.5rem;
    color: white;
}

.top-bar-content {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 1rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.user-icon {
    font-size: 1.5rem;
}

.user-name {
    font-weight: 500;
    font-size: 1rem;
}

/* NavBar Styles */
.sidebar {
    background: linear-gradient(180deg, #E3F2FD 0%, #BBDEFB 50%, #90CAF9 100%);
}

.top-row {
    background: linear-gradient(to right, #64B5F6, #42A5F5);
    border-bottom: 2px solid rgba(0, 0, 0, 0.1);
}

.navbar-brand {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1565C0 !important;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.5);
}

.nav-link {
    color: #1976D2 !important;
    font-weight: 500;
    padding: 0.75rem 1rem;
    border-radius: 0.25rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-link:hover {
    background: rgba(33, 150, 243, 0.15);
    color: #0D47A1 !important;
    transform: translateX(4px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.nav-link:focus {
    outline: 2px solid #1976D2;
    outline-offset: 2px;
    background: rgba(33, 150, 243, 0.2);
    color: #0D47A1 !important;
}

.nav-link.active {
    background: rgba(33, 150, 243, 0.25);
    color: #0D47A1 !important;
    font-weight: 600;
    border-left: 4px solid #1976D2;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.nav-link-logout {
    color: #D32F2F !important;
}

.nav-link-logout:hover {
    background: rgba(244, 67, 54, 0.15);
    color: #B71C1C !important;
    box-shadow: 0 2px 4px rgba(244, 67, 54, 0.2);
}

.nav-divider {
    height: 1px;
    background: rgba(25, 118, 210, 0.2);
    margin: 0.5rem 1rem;
}

/* Dashboard Card Styles */
.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.dashboard-card {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.dashboard-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.card-icon {
    font-size: 3rem;
    line-height: 1;
}

.card-content h4 {
    margin: 0;
    font-size: 0.875rem;
    color: #6c757d;
    font-weight: normal;
}

.card-value {
    margin: 0.5rem 0 0 0;
    font-size: 2rem;
    font-weight: bold;
    color: #212529;
}

/* Date Summary Table Styles */
.date-summary-container {
    margin-top: 1.5rem;
    background: white;
    border-radius: 0.5rem;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.date-summary-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 1rem;
}

.date-summary-table thead {
    background: linear-gradient(to right, var(--primary-color), var(--primary-light));
    color: white;
}

.date-summary-table thead th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    border: none;
}

.date-summary-table tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s;
}

.date-summary-table tbody tr:hover {
    background-color: #f8f9fa;
}

.date-summary-table tbody td {
    padding: 1rem;
    vertical-align: middle;
}

.date-summary-table .text-center {
    text-align: center;
}

/* Tri-State Checkbox Styles */
.tri-state-checkbox {
    margin: 1rem 0;
    padding: 0.5rem;
    border-radius: 0.25rem;
    transition: background-color 0.2s;
}

.tri-state-checkbox:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
    background-color: #f0f8ff;
}

.tri-state-checkbox > label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.tri-state-options {
    display: flex;
    gap: 1.5rem;
}

.tri-state-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    transition: background-color 0.2s;
}

.tri-state-option:hover {
    background-color: #f8f9fa;
}

.tri-state-option input[type="radio"] {
    margin: 0;
    cursor: pointer;
}

.tri-state-option input[type="radio"]:checked + span {
    font-weight: 600;
    color: #007bff;
}

.tri-state-option span {
    cursor: pointer;
    user-select: none;
}

/* Login Page Styles */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 50%, #90caf9 100%);
    padding: 1rem;
}

.login-card {
    background: white;
    padding: 2.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 400px;
}

.login-card h2 {
    text-align: center;
    margin-bottom: 1.5rem;
    color: #212529;
}

.login-card .form-group {
    margin-bottom: 1rem;
}

.login-card .btn-block {
    width: 100%;
    margin-top: 1rem;
}

/* Data Entry Styles */
.data-entry-container {
    padding: 1rem 0;
}

.date-selector {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 2rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 0.5rem;
}

.date-selector label {
    font-weight: 500;
    margin: 0;
}

.date-selector input[type="date"] {
    flex: 0 0 200px;
}

/* Focus Styles for Form Elements */
.form-control:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(33, 150, 243, 0.25);
    background-color: #f0f8ff;
    transition: all 0.2s ease-in-out;
}

/* Button Focus Styles */
.btn:focus,
button:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
    box-shadow: 0 0 0 0.25rem rgba(33, 150, 243, 0.25);
    transform: scale(1.02);
    transition: all 0.2s ease-in-out;
}

.btn-primary:focus {
    outline-color: var(--primary-dark);
    box-shadow: 0 0 0 0.25rem rgba(25, 118, 210, 0.35);
}

.btn-success:focus {
    outline-color: var(--secondary-color);
    box-shadow: 0 0 0 0.25rem rgba(76, 175, 80, 0.35);
}

.btn-secondary:focus {
    outline-color: #6c757d;
    box-shadow: 0 0 0 0.25rem rgba(108, 117, 125, 0.25);
}

/* Remove focus styles when not using keyboard */
.form-control:focus:not(:focus-visible),
input:focus:not(:focus-visible),
select:focus:not(:focus-visible),
textarea:focus:not(:focus-visible),
.btn:focus:not(:focus-visible),
button:focus:not(:focus-visible) {
    outline: none;
    box-shadow: none;
}

/* Active (pressed) state for buttons */
.btn:active,
button:active {
    transform: scale(0.98);
    transition: transform 0.1s;
}

/* Checkbox Styles */
.checkbox-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0;
}

.checkbox-container input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.checkbox-container input[type="checkbox"]:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.checkbox-label {
    font-weight: 500;
    color: var(--text-dark);
    cursor: pointer;
}

.date-selector button {
    margin-left: auto;
}

.entry-form-container {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.entry-form-container h4 {
    margin-bottom: 1.5rem;
    color: #212529;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.form-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

.entry-list-container {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    padding: 2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.entry-list-container h4 {
    margin-bottom: 1.5rem;
    color: #212529;
}

.entry-list-container table {
    margin-bottom: 0;
}

/* Badge Styles */
.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 0.25rem;
}

.badge-success {
    background-color: #28a745;
    color: white;
}

.badge-danger {
    background-color: #dc3545;
    color: white;
}

.badge-secondary {
    background-color: #6c757d;
    color: white;
}

/* Button Styles Enhancement */
.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 0.25rem;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.2s;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background-color: #545b62;
}

.btn-success {
    background-color: var(--secondary-color);
    color: white;
}

.btn-success:hover {
    background-color: #388e3c;
}

.btn-danger {
    background-color: #dc3545;
    color: white;
}

.btn-danger:hover {
    background-color: #bd2130;
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

/* Form Control Styles */
.form-control {
    display: block;
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 1rem;
    line-height: 1.5;
    color: #495057;
    background-color: #fff;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
    transition: border-color 0.15s ease-in-out;
}

.form-control:focus {
    border-color: #80bdff;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,.25);
}

.form-control:disabled {
    background-color: #e9ecef;
    opacity: 1;
}

/* Alert Styles */
.alert {
    padding: 0.75rem 1.25rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    border-radius: 0.25rem;
}

.alert-success {
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
}

.alert-danger {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

/* Table Styles */
.table {
    width: 100%;
    margin-bottom: 1rem;
    color: #212529;
    border-collapse: collapse;
}

.table thead th {
    border-bottom: 2px solid #dee2e6;
    padding: 0.75rem;
    text-align: left;
}

.table tbody td {
    padding: 0.75rem;
    border-bottom: 1px solid #dee2e6;
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(0,0,0,.05);
}

/* User Management Styles */
.user-management-container {
    padding: 1rem 0;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.page-header h3 {
    margin: 0;
    color: #212529;
}

.user-form-card {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.user-form-card h4 {
    margin-bottom: 1.5rem;
    color: #212529;
}

.user-table {
    width: 100%;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.user-table thead {
    background-color: #f8f9fa;
}

.user-table thead th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: #495057;
    border-bottom: 2px solid #dee2e6;
}

.user-table tbody td {
    padding: 1rem;
    border-bottom: 1px solid #dee2e6;
    vertical-align: middle;
}

.user-table tbody tr:last-child td {
    border-bottom: none;
}

.user-table tbody tr:hover {
    background-color: #f8f9fa;
}

.status-badge {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 1rem;
    text-align: center;
}

.status-active {
    background-color: #d4edda;
    color: #155724;
}

.status-inactive {
    background-color: #f8d7da;
    color: #721c24;
}

.action-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.btn-action {
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    transition: background-color 0.2s, transform 0.1s;
}

.btn-action:hover {
    background-color: #f8f9fa;
    transform: scale(1.1);
}

.btn-action:active {
    transform: scale(0.95);
}

.btn-edit:hover {
    background-color: #e7f3ff;
}

.btn-activate:hover, .btn-deactivate:hover {
    background-color: #fff3cd;
}

.btn-reset:hover {
    background-color: #e2e6ea;
}

.btn-delete:hover {
    background-color: #f8d7da;
}

/* Modal Styles */
.modal-backdrop {
    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: 1050;
}

.modal-dialog {
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-dialog-confirm {
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    max-width: 400px;
    width: 90%;
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid #dee2e6;
}

.modal-header h5 {
    margin: 0;
    font-size: 1.25rem;
    color: #212529;
}

.modal-header-confirm {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #dee2e6;
}

.modal-header-confirm h5 {
    margin: 0;
    font-size: 1.1rem;
    color: #212529;
}

.modal-body {
    padding: 1.5rem;
}

.modal-body-confirm {
    padding: 1.5rem;
}

.modal-body-confirm p {
    margin: 0;
    color: #495057;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #dee2e6;
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

.modal-footer-confirm {
    padding: 1rem 1.5rem;
    border-top: 1px solid #dee2e6;
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

.alert-warning {
    color: #856404;
    background-color: #fff3cd;
    border-color: #ffeaa7;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    /* Layout adjustments */
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .dashboard-cards {
        grid-template-columns: 1fr;
    }
    
    /* Date selector mobile */
    .date-selector {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }
    
    .date-selector label {
        font-size: 0.875rem;
    }
    
    .date-selector input[type="date"],
    .date-selector button {
        flex: 1 1 auto;
        width: 100%;
        font-size: 0.875rem;
    }
    
    /* Form container mobile */
    .entry-form-container,
    .entry-list-container,
    .user-form-card {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    .entry-form-container h4 {
        font-size: 1.25rem;
    }
    
    /* Page header mobile */
    .page-header {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }
    
    .page-header h3 {
        font-size: 1.5rem;
    }
    
    .page-header button {
        width: 100%;
        margin: 0;
    }
    
    /* Top bar mobile */
    .top-bar {
        padding: 0.5rem 1rem;
    }
    
    .top-bar-content {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .user-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .user-actions button {
        width: 100%;
    }
    
    /* Table mobile */
    .user-table,
    .table {
        font-size: 0.75rem;
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .user-table thead th,
    .user-table tbody td {
        padding: 0.4rem;
        font-size: 0.75rem;
    }
    
    /* Action buttons mobile */
    .action-buttons {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.25rem;
    }
    
    .btn-action {
        font-size: 1rem;
        padding: 0.2rem 0.4rem;
    }
    
    .form-actions {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .form-actions button {
        width: 100%;
    }
    
    /* Login card mobile */
    .login-card {
        padding: 1.5rem;
        margin: 1rem;
    }
    
    .login-card h2 {
        font-size: 1.5rem;
    }
    
    /* Dashboard cards mobile */
    .dashboard-card {
        padding: 1rem;
    }
    
    .card-icon {
        font-size: 2rem;
    }
    
    .card-value {
        font-size: 1.5rem;
    }
    
    /* Tri-state checkbox mobile */
    .tri-state-options {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .tri-state-option {
        padding: 0.5rem;
        border: 1px solid var(--border-color);
        border-radius: 0.25rem;
    }
    
    /* Modal mobile */
    .modal-dialog,
    .modal-dialog-confirm {
        width: 95%;
        margin: 0.5rem;
    }
    
    /* Data entry list mobile */
    .entry-list-container table {
        display: block;
        overflow-x: auto;
    }
}

/* Small mobile devices */
@media (max-width: 480px) {
    body {
        font-size: 14px;
    }
    
    .btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.875rem;
    }
    
    .form-control {
        font-size: 0.875rem;
        padding: 0.4rem 0.6rem;
    }
    
    .login-card {
        padding: 1rem;
        margin: 0.5rem;
    }
    
    h3 {
        font-size: 1.25rem;
    }
    
    h4 {
        font-size: 1.1rem;
    }
}
