/* Custom CSS for SR-Reporting project */

/* General styling */
body {
    font-family: 'Segoe UI', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f9f9f9;
    margin: 0;
    padding: 0;
    /* Fix text-size-adjust compatibility */
    -webkit-text-size-adjust: 100%;
    -moz-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header styling */
header {
    background-color: #2c3e50;
    color: #fff;
    padding: 1rem 0;
}

/* Navigation */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1rem;
}

nav a {
    color: #fff;
    text-decoration: none;
    margin: 0 0.5rem;
    padding: 0.5rem;
    border-radius: 4px;
}

nav a:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Form styling */
form {
    background-color: #fff;
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.form-group {
    margin-bottom: 15px;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

input[type="text"],
input[type="email"],
input[type="password"],
textarea,
select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

/* Button styling - enhancing Bootstrap's buttons */
.btn {
    font-weight: 500;
    border: 0;
    border-radius: 4px;
    transition: all 0.2s ease;
    padding: 10px 18px;
    letter-spacing: 0.3px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12);
    min-width: 100px;
    text-align: center;
    margin: 0 5px;
    font-size: 14px;
    text-transform: uppercase;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.12);
}

/* Keep Bootstrap's color scheme but enhance the appearance */
.btn-primary {
    background-color: #0d6efd;
}

.btn-primary:hover {
    background-color: #0b5ed7;
}

.btn-secondary {
    background-color: #6c757d;
}

.btn-secondary:hover {
    background-color: #5c636a;
}

.btn-success {
    background-color: #198754;
}

.btn-success:hover {
    background-color: #157347;
}

.btn-danger {
    background-color: #dc3545;
}

.btn-danger:hover {
    background-color: #bb2d3b;
}

/* Small buttons */
.btn-sm {
    padding: 6px 12px;
    font-size: 0.875rem;
    border-radius: 0.2rem;
    min-width: 80px;
}

/* Table styling */
.table-container {
    overflow-x: auto;
    max-height: 600px;  /* Fixed height for the container */
    overflow-y: auto;  /* Enable vertical scrolling */
    margin-bottom: 20px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
}

/* Style the scrollbar */
.table-container::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.table-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.table-container::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.table-container::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Style the table header to be sticky */
.table-container thead th {
    position: sticky;
    top: 0;
    background-color: #f8f9fa;
    z-index: 10;
    border-bottom: 2px solid #dee2e6;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 0;
}

th, td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #ddd;
    color: #333; /* Ensure text is visible with dark color */
}

th {
    background-color: #f2f2f2;
    font-weight: 600;
    color: #333; /* Ensure header text is visible with dark color */
    /* Fix text-align compatibility */
    text-align: -webkit-match-parent;
    text-align: match-parent;
    text-align: inherit;
}

tr:hover {
    background-color: #f5f5f5;
}

/* Pagination styling */
.pagination {
    display: flex;
    justify-content: center;
    margin: 20px 0;
    padding: 0;
    list-style: none;
}

.pagination li {
    margin: 0 5px;
}

.pagination a {
    display: block;
    padding: 8px 12px;
    border-radius: 4px;
    text-decoration: none;
    background-color: #f8f9fa;
    color: #007bff;
    border: 1px solid #dee2e6;
}

.pagination .active a {
    background-color: #007bff;
    color: white;
    border-color: #007bff;
}

.pagination a:hover {
    background-color: #e9ecef;
}

/* Alert/message styling */
.alert {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Login form specific styles */
.login-form {
    max-width: 400px;
    margin: 40px auto;
}

/* Dashboard specific styles */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background-color: #fff;
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.stat-card h3 {
    margin-top: 0;
    color: #2c3e50;
}

/* Button groups styling */
.btn-group, .action-buttons {
    display: flex;
    gap: 10px;
    margin: 20px 0;
    justify-content: flex-start;
    align-items: center;
}

/* Style specifically for action buttons at the bottom of forms */
.action-btn {
    min-width: 120px;
    padding: 12px 24px;
    font-weight: 600;
}

/* Back button style */
.btn-back {
    background-color: #6c757d;
    color: white;
    border: 2px solid #5a6268;
}

.btn-back:hover {
    background-color: #5a6268;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* Accept button style */
.btn-accept {
    background-color: #28a745;
    color: white;
    border: 2px solid #218838;
}

.btn-accept:hover {
    background-color: #218838;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* Reject button style */
.btn-reject {
    background-color: #dc3545;
    color: white;
    border: 2px solid #c82333;
}

.btn-reject:hover {
    background-color: #c82333;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* Custom background colors */
.text-bg-purple {
    background-color: #6f42c1;
    color: #fff;
}

/* Footer styling */
html {
    position: relative;
    min-height: 100%;
}

body {
    margin-bottom: 60px; /* Height of the footer */
}

.footer {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 40px; /* Set to a smaller value to make it thinner */
    line-height: 40px; /* Vertically center the text */
    background-color: #f8f9fa;
    border-top: 1px solid #dee2e6;
    z-index: 1030;
}

.footer .container {
    padding: 0 15px;
}

.footer .text-muted {
    font-size: 0.85rem;
}

/* Main content wrapper needs to have padding bottom to prevent content from being hidden by footer */
main {
    padding-bottom: 60px;
}

/* Responsive design */
@media (max-width: 768px) {
    .dashboard-stats {
        grid-template-columns: 1fr;
    }
    
    nav {
        flex-direction: column;
    }
    
    nav a {
        margin: 5px 0;
    }
    
    .footer {
        height: 30px;
        line-height: 30px;
    }
    
    body {
        margin-bottom: 40px;
    }
}

/* More specific styling for action buttons in table cells */
.table td.d-flex.align-items-center .btn {
    margin: 0 2px !important; /* Reduce horizontal margin, use !important to override general .btn margin */
    padding: 0.25rem 0.5rem !important; /* Equivalent to Bootstrap's py-1 px-2, use !important */
    min-width: auto !important; /* Allow buttons to be as small as their content + padding, use !important */
    vertical-align: middle; /* Helps align items if they are not baseline aligned by default */
}

/* Ensure form elements within these cells don't add extra margins and interfere */
.table td.d-flex.align-items-center form {
    margin: 0 !important; /* Remove form margin */
    padding: 0 !important; /* Remove default form padding */
    background-color: transparent !important; /* Remove default form background */
    box-shadow: none !important; /* Remove default form shadow */
    display: inline-flex; /* To help with alignment of the button inside */
    align-items: center; /* Align items vertically */
}

/* Ensure the button inside the form also aligns well */
.table td.d-flex.align-items-center form .btn {
    margin: 0 !important; /* Remove any margin from .btn if it's inside this specific form */
}

/* User list action buttons - horizontal, modern look */
.table .d-flex.gap-2.flex-wrap.align-items-center.justify-content-start {
    gap: 0.5rem !important;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
}
.table .d-flex.gap-2.flex-wrap.align-items-center.justify-content-start .btn {
    margin: 0 !important;
    min-width: 110px;
    font-size: 0.95rem;
    text-transform: none;
    box-shadow: 0 1px 2px rgba(0,0,0,0.07);
}
@media (max-width: 600px) {
    .table .d-flex.gap-2.flex-wrap.align-items-center.justify-content-start {
        flex-direction: column;
        align-items: stretch;
    }
    .table .d-flex.gap-2.flex-wrap.align-items-center.justify-content-start .btn {
        width: 100%;
        margin-bottom: 6px;
    }
}

/* Fix Font Awesome rotation compatibility */
.fa-rotate-90 {
    filter: rotate(90deg);
    -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=1)";
}

.fa-rotate-180 {
    filter: rotate(180deg);
    -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=2)";
}

.fa-rotate-270 {
    filter: rotate(270deg);
    -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=3)";
}

.fa-flip-horizontal {
    filter: scaleX(-1);
    -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1)";
}

.fa-flip-vertical {
    filter: scaleY(-1);
}

.fa-flip-both,
.fa-flip-horizontal.fa-flip-vertical {
    filter: scaleX(-1) scaleY(-1);
    -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)";
}

/* Fix form-check-input color-adjust compatibility */
.form-check-input {
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
}

/* Replace inline styles with CSS classes */
.activity-feed-container {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #dee2e6;
    border-radius: 0.25rem;
}

.table-container-scrollable {
    max-height: 400px;
    overflow-y: auto;
}

.table-container-medium {
    max-height: 500px;
    overflow-y: auto;
}

.chart-container {
    height: 300px;
}

.hidden {
    display: none;
}

.inline-form {
    display: inline;
}

.rounded-image {
    max-height: 350px;
}

.rejection-note {
    background-color: #f8d7da;
    padding: 15px;
    border-radius: 5px;
    margin-top: 20px;
}

.rejection-note h4 {
    color: #721c24;
    margin-top: 0;
}

.margin-top-0 {
    margin-top: 0;
}

/* Dashboard card hover effects */
.card a.text-white,
.card a.text-decoration-none {
    transition: all 0.3s ease;
}

.card a.text-white:hover,
.card a.text-decoration-none:hover {
    text-decoration: none;
    opacity: 0.9;
}

.card a.text-white .card-body,
.card a.text-decoration-none .card-body {
    transition: all 0.3s ease;
}

.card a.text-white:hover .card-body,
.card a.text-decoration-none:hover .card-body {
    transform: translateY(-2px);
}

.card a.text-white .display-4,
.card a.text-white .display-6,
.card a.text-decoration-none .display-4,
.card a.text-decoration-none .display-6 {
    transition: all 0.3s ease;
}

.card a.text-white:hover .display-4,
.card a.text-white:hover .display-6,
.card a.text-decoration-none:hover .display-4,
.card a.text-decoration-none:hover .display-6 {
    transform: scale(1.05);
}

/* Make cards clickable */
.card a {
    cursor: pointer;
}

/* Ensure text doesn't wrap in cards */
.card-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Password visibility toggle - integrated look */
.password-input-wrapper {
    position: relative;
    width: 100%;
}

.password-input-wrapper .form-control {
    padding-right: 40px; /* Make space for the icon */
}

.password-input-wrapper .toggle-password-icon {
    position: absolute;
    top: 50%;
    right: 15px;
    transform: translateY(-50%);
    cursor: pointer;
    color: #6c757d; /* Muted color */
    z-index: 5;
}
