/* Custom styles for the Restaurant Checklist System */

/* Body and general styling */
body {
    background-color: #f8f9fa;
    color: #212529;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Footer styling */
footer {
    margin-top: auto;
    background-color: #f8f9fa !important;
    border-top: 2px solid #dee2e6 !important;
    padding: 1rem 0 !important;
    font-size: 0.875rem;
}



/* Card enhancements */
.card {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    border: 1px solid var(--bs-border-color);
}

.card-header {
    background-color: var(--bs-secondary-bg);
    border-bottom: 1px solid var(--bs-border-color);
}

/* Form styling */
.form-control:focus,
.form-select:focus {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 0.2rem rgba(var(--bs-primary-rgb), 0.25);
}

.form-control.is-invalid {
    border-color: var(--bs-danger);
}

/* Button enhancements */
.btn {
    border-radius: 0.375rem;
    transition: all 0.15s ease-in-out;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-group .btn {
    transform: none;
}

.btn-group .btn:hover {
    transform: none;
}

/* Clickable list item hover effect */
.checklist-item-hover {
    padding: 0.5rem;
    margin-left: -0.5rem;
    margin-right: -0.5rem;
    border-radius: 0.375rem;
    transition: background-color 0.15s ease-in-out;
}

.checklist-item-hover:hover {
    background-color: rgba(13, 110, 253, 0.08);
}

/* Clickable table row */
.clickable-row {
    cursor: pointer;
    transition: background-color 0.15s ease-in-out;
}

.clickable-row:hover {
    background-color: rgba(13, 110, 253, 0.08) !important;
}

/* Navigation */
.navbar-brand {
    font-weight: 600;
}

.navbar-nav .nav-link {
    transition: color 0.15s ease-in-out;
}

/* Breadcrumb styling */
.breadcrumb {
    background-color: transparent;
    padding: 0;
    margin: 0;
    font-size: 0.875rem;
}

.breadcrumb-item {
    color: #6c757d;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: ">";
    color: #adb5bd;
    margin: 0 0.5rem;
}

.breadcrumb-item a {
    color: #0d6efd;
    transition: color 0.15s ease-in-out;
}

.breadcrumb-item a:hover {
    color: #0a58ca;
    text-decoration: none;
}

.breadcrumb-item.active {
    color: #495057;
    font-weight: 500;
}

.breadcrumb .fas {
    font-size: 0.8125rem;
}

/* Alert styling */
.alert {
    border: none;
    border-radius: 0.5rem;
}

/* Table enhancements */
.table th {
    border-top: none;
    border-bottom: 2px solid var(--bs-border-color);
    font-weight: 600;
    background-color: var(--bs-secondary-bg);
}

/* Help Center Styling */
.help-section .feature-card,
.help-section .nav-tip,
.help-section .next-step-card {
    transition: all 0.2s ease-in-out;
    height: 100%;
}

.help-section .feature-card:hover,
.help-section .nav-tip:hover,
.help-section .next-step-card:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.help-section .feature-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.help-section .nav-tip {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
}

.help-section .next-step-card {
    background: linear-gradient(135deg, #f3e5f5 0%, #e1bee7 100%);
}

.help-section h5 {
    color: #495057;
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 1rem;
}

.help-section h6 {
    color: #6c757d;
    font-weight: 500;
}

.help-section .alert h6 {
    color: inherit;
}

.help-section .list-group-item {
    transition: all 0.15s ease-in-out;
}

.help-section .list-group-item:hover {
    background-color: var(--bs-primary);
    color: white;
    transform: translateX(5px);
}

.table-responsive {
    border-radius: 0.375rem;
}

/* Badge styling */
.badge {
    font-size: 0.75em;
    padding: 0.375em 0.5em;
}

/* Modal enhancements */
.modal-content {
    border: none;
    border-radius: 0.5rem;
}

.modal-header {
    border-bottom: 1px solid var(--bs-border-color);
    background-color: var(--bs-secondary-bg);
}

.modal-footer {
    border-top: 1px solid var(--bs-border-color);
    background-color: var(--bs-secondary-bg);
}

/* Field styling for dynamic forms */
.field-item {
    background-color: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 0.375rem;
    padding: 1rem;
    margin-bottom: 1rem;
    transition: border-color 0.15s ease-in-out;
}

.field-item:hover {
    border-color: var(--bs-primary);
}

.field-header {
    display: flex;
    justify-content-between;
    align-items-center;
    margin-bottom: 0.5rem;
}

.drag-handle {
    cursor: move;
    color: var(--bs-secondary);
}

.drag-handle:hover {
    color: var(--bs-primary);
}

/* Signature pad styling */
.signature-pad {
    border: 2px dashed var(--bs-border-color);
    border-radius: 0.375rem;
    background-color: var(--bs-body-bg);
    cursor: crosshair;
    transition: border-color 0.15s ease-in-out;
}

.signature-pad:hover {
    border-color: var(--bs-primary);
}

/* Image preview */
.image-preview {
    border-radius: 0.375rem;
    border: 1px solid var(--bs-border-color);
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

/* Response content styling */
.response-content {
    margin-top: 0.5rem;
}

.response-content .bg-light {
    background-color: var(--bs-secondary-bg) !important;
    border: 1px solid var(--bs-border-color);
}

/* Statistics cards */
.card .fa-3x {
    opacity: 0.8;
}

/* Utility classes */
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Loading states */
.btn.loading {
    position: relative;
    color: transparent !important;
}

.btn.loading::after {
    content: '';
    position: absolute;
    width: 1rem;
    height: 1rem;
    top: 50%;
    left: 50%;
    margin-left: -0.5rem;
    margin-top: -0.5rem;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Responsive adjustments */
@media (max-width: 768px) {
    .btn-group {
        display: flex;
        flex-direction: column;
    }
    
    .btn-group .btn {
        border-radius: 0.375rem !important;
        margin-bottom: 0.25rem;
    }
    
    .table-responsive {
        font-size: 0.875rem;
    }
    
    .signature-pad {
        height: 150px;
    }
}

/* Print styles */
@media print {
    .navbar,
    .btn,
    .modal,
    .alert {
        display: none !important;
    }
    
    .card {
        border: 1px solid #000 !important;
        box-shadow: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
}

/* Accessibility improvements */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus indicators */
.btn:focus,
.form-control:focus,
.form-select:focus {
    outline: 2px solid var(--bs-primary);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .card {
        border: 2px solid var(--bs-border-color);
    }
    
    .btn {
        border: 2px solid currentColor;
    }
}

/* Bottom Navigation Bar */
.bottom-navbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    background-color: #ffffff;
    border-top: 1px solid #dee2e6;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1040;
    padding: 0.25rem 0;
    display: block !important;
}

.bottom-nav-container {
    display: flex;
    justify-content: space-around;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 0.5rem;
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #6c757d;
    padding: 0.35rem 0.25rem;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
    cursor: pointer;
    min-width: 55px;
    background: none;
    border: none;
}

.bottom-nav-item:hover {
    color: #0d6efd;
    background-color: #f8f9fa;
}

.bottom-nav-item i {
    font-size: 1.25rem;
    margin-bottom: 0.15rem;
}

.bottom-nav-item span {
    font-size: 0.65rem;
    text-align: center;
    white-space: nowrap;
}

/* Add padding to main when bottom nav is present */
body main {
    padding-bottom: 1rem;
}

body:has(.bottom-navbar) main {
    padding-bottom: 70px !important;
}

/* User Menu Overlay */
.user-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1050;
    display: none;
    align-items: flex-end;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

.user-menu-overlay.active {
    display: flex;
}

.user-menu-content {
    background-color: #ffffff;
    border-radius: 1rem 1rem 0 0;
    width: 100%;
    max-width: 500px;
    padding: 1.5rem;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    animation: slideUp 0.3s ease;
    max-height: 80vh;
    overflow-y: auto;
}

.user-menu-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #dee2e6;
    font-size: 1.1rem;
    font-weight: 600;
}

.user-menu-header i {
    font-size: 1.5rem;
}

.user-menu-info {
    padding: 1rem 0;
}

.user-menu-link {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    color: #212529;
    text-decoration: none;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
    margin: 0.25rem 0;
}

.user-menu-link:hover {
    background-color: #f8f9fa;
    color: #0d6efd;
}

.user-menu-link.text-danger:hover {
    background-color: #f8d7da;
    color: #dc3545;
}

.user-menu-link.text-warning:hover {
    background-color: #fff3cd;
    color: #ffc107;
}

.user-menu-close {
    width: 100%;
    padding: 0.75rem;
    margin-top: 1rem;
    background-color: #6c757d;
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.user-menu-close:hover {
    background-color: #5a6268;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

/* Responsive adjustments for bottom nav */

/* Small mobile devices - icon only with larger touch targets */
@media (max-width: 480px) {
    .bottom-navbar {
        padding: 0.4rem 0;
    }
    
    .bottom-nav-container {
        padding: 0 0.25rem;
        gap: 0.15rem;
    }
    
    .bottom-nav-item {
        min-width: 48px;
        min-height: 48px;
        padding: 0.4rem 0.2rem;
        flex: 1;
        max-width: 70px;
    }
    
    .bottom-nav-item i {
        font-size: 1.4rem;
        margin-bottom: 0.1rem;
    }
    
    .bottom-nav-item span {
        font-size: 0.6rem;
        line-height: 1;
    }
    
    body:has(.bottom-navbar) main {
        padding-bottom: 75px !important;
    }
    
    /* Hide profile, admin, and developer on mobile */
    .bottom-nav-item.hide-mobile {
        display: none !important;
    }
}

/* Medium mobile/tablet devices */
@media (min-width: 481px) and (max-width: 768px) {
    .bottom-navbar {
        padding: 0.35rem 0;
    }
    
    .bottom-nav-container {
        gap: 0.25rem;
    }
    
    .bottom-nav-item {
        min-width: 55px;
        padding: 0.4rem 0.3rem;
    }
    
    .bottom-nav-item i {
        font-size: 1.3rem;
        margin-bottom: 0.15rem;
    }
    
    .bottom-nav-item span {
        font-size: 0.65rem;
    }
    
    /* Hide profile, admin, and developer on tablet */
    .bottom-nav-item.hide-mobile {
        display: none !important;
    }
}

/* Desktop */
@media (min-width: 992px) {
    .bottom-nav-item span {
        font-size: 0.75rem;
    }
    
    .bottom-nav-item {
        min-width: 65px;
    }
}
