/*
==========================================
Custom UI Stylesheet
------------------------------------------
CONTENTS:
01. Navigation
02. Forms
03. Colors
04. Buttons & Icons
05. Fonts
06. Margins & Padding
07. Footer
08. Properties & Cards
09. Modals
10. Steps
11. Display (Visibility)
12. Images & iFrames
13. Hover & Popover
14. Carousel (including Attachment Modal)
15. Select2 & Upload Overlay
16. Messenger
17. Signature
18. Return Button
19. Tables
20. Columns (Responsive)
21. Mobile Menu
22. Dashboards
23. Quill
24. Suppliers
25. Toasts & Badges
==========================================
*/

/* 01. Navigation */
.nav-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

/* Navigation Divider */
.nav-divider {
    width: 1px;
    height: 40px;
    background-color: rgba(0, 0, 0, 0.2);
    margin: 0 15px;
    align-self: center;
}

/* Ensure the nav-item containing the divider aligns properly with navigation items */
.nav-divider-container {
    display: flex;
    align-items: center;
    justify-content: center;
    height: auto;
}

.nav-divider-container .nav-divider {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Dark mode support for divider */
@media (prefers-color-scheme: dark) {
    .nav-divider {
        background-color: rgba(255, 255, 255, 0.2);
    }
}

/* Multi-level Dropdown Support */
.dropdown-submenu {
    position: absolute;
    left: 100%;
    top: 0;
    margin-top: -1px;
    display: none;
}

/* Ensure proper positioning for nested dropdowns */
.dropdown-menu .dropdown-menu {
    margin-left: 0;
    margin-right: 0;
}

/* Arrow indicator for items with submenus */
.dropdown-item .bi-chevron-right {
    font-size: 0.75rem;
    transition: transform 0.2s ease;
}

/* Hover effects for multi-level dropdowns */
.dropend:hover .dropdown-submenu {
    display: block;
}

/* Ensure proper z-index for nested dropdowns */
.dropdown-submenu {
    z-index: 1001;
}

.dropdown-menu {
    z-index: 1000;
}
.nav-icon {
    font-size: 1.5rem;
    color: var(--dark-color, #000);
}
.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.dropdown-item:hover {
    background-color: var(--light-color, #f8f9fa);
}
.nav-link.active {
    color: var(--primary-color, #0d6efd);
    font-weight: bold;
}
.navbar-brand, .logo {
    height: 70px;
    margin-bottom: -1em;
    z-index: 100;
}
.home-logo-nav {
    margin-top: 2em;
    margin-bottom: 6em;
}

.home-logo {
    height: 100px;
}

.navbar-toggler {
    transition: transform 0.3s ease;
    margin-top: 1.2em;
}
.navbar-toggler.toggled {
    transform: rotate(180deg);
    color: var(--primary-color, #022C1A);
}

/* 02. Forms */
.form-switch { padding-left: 0 !important; }
.form-check .form-check-input { margin-left: 0 !important; }
.form-switch .form-check-input { width: 4em; height: 2em; }
.form-check-input:checked {
    background-color: var(--primary-color, #035631);
    border-color: var(--primary-color, #035631);
}
.form-check-input:focus {
    border-color: rgba(3, 86, 49, 0.645);
    outline: 0;
    box-shadow: 0 0 0 .25rem rgba(3, 86, 49, 0.645);
    background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='rgba(0,0,0,0.25)'/></svg>");
}

/* 03. Colors */
.background-colour { background-color: var(--primary-color, #022C1A); }
.bg-purple { background-color: #6f42c1 !important; color: #fff !important; }

/* 04. Buttons & Icons */
.buttonhide { display: none; }
.btn { border-radius: 0; }
.btn-primary {
    --bs-btn-color: #fff;
    --bs-btn-bg: var(--primary-color, #022C1A);
    --bs-btn-border-color: var(--primary-color, #022C1A);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: var(--primary-dark, #035631);
    --bs-btn-hover-border-color: var(--primary-dark, #035631);
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: var(--primary-dark, #035631);
    --bs-btn-active-border-color: var(--primary-dark, #035631);
    --bs-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
}

/* 05. Fonts */
footer { font-size: 14px; }

/* 06. Margins & Padding */
.mt-n3 { margin-top: -40px; }
.m01 { margin: 0.1em; }
.npoad { padding: 0 !important; }

/* 07. Footer & Page Structure */
html, body { height: 100%; margin: 0; padding: 0; }
body { display: flex; flex-direction: column; }
main { flex: 1; }
footer { margin-top: auto; }

/* 08. Properties & Cards */
.ui-state-highlight { height: 40px; background-color: #f0f0f0; border: 1px dashed #ddd; }
.pcard-preview { max-height: 200px; }

/* 09. Modals */
.modal { z-index: 1050; transition: all 0.3s ease; }
.modal-backdrop { z-index: 1040; }
.modal-backdrop.stacked { background-color: rgba(0, 0, 0, 0.5); }

.modal-fullscreen .modal-body {
    padding: 0;
    height: 100%;
    overflow: hidden;
}
.modal-fullscreen .modal-body { height: calc(100vh - 20px); }
.viewer-frame, .modal-pdf-frame, .iframeviewer {
    width: 100%;
    height: 80vh;
    border: none;
}
.attachmentframe { height: 80vh; width: 87vh; }
.modal-image-preview { max-width: 100%; height: auto; display: block; margin: 0 auto; }
.emailPreviewFrame { min-height: 600px; width: 100%; border: 1px solid #ccc; }
#sessionWarningModal {
    display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.6); justify-content: center; align-items: center; z-index: 10000;
}
#sessionWarningModal .modal-content {
    background: #fff; padding: 30px; border-radius: 8px; max-width: 400px; text-align: center;
}
#stayLoggedInBtn { margin-top: 20px; padding: 10px 20px; font-size: 16px; cursor: pointer; }




/* 10. Steps */
.step[data-step="2"], .step[data-step="3"], .step[data-step="4"],
.step[data-step="5"], .step[data-step="6"] { display: none; }

/* 11. Display (Visibility) */
.hidden { display: none !important; }
.visible { display: block; }

/* 12. Images & iFrames */
#previewModal .carousel-item img.preview-img {
    display: block; margin: auto; max-width: 75%;
    transition: transform 0.3s ease; cursor: default;
}

/* 13. Hover & Popover */
.popover { min-width: 20em; }
.popover .popover-header {
    background-color: var(--primary-color, #022C1A) !important;
    color: white !important;
    border-bottom: none;
}
.popover .popover-body { font-size: 0.9rem; color: #333; }

/* 14. Carousel (Including Attachment Modal) */
.modal-body.carousel { padding: 0; }
#carouselImages .carousel-item {
    justify-content: center; align-items: center; height: 80vh; overflow: hidden;
}
#carouselImages img, #carouselImages video, #carouselImages embed {
    max-height: 100%; width: auto; display: block; margin: 0 auto; object-fit: contain;
    transition: transform 0.3s ease;
}
@media (max-width: 768px) { #carouselImages .carousel-item { height: 60vh; } }

/* 15. Select2 & Upload Overlay */
.select2-container .select2-selection--single {
    height: calc(2.25rem + 2px); padding: 0.375rem 0.75rem;
    font-size: 1rem; line-height: 1.5; color: #495057;
    background-color: #fff; border: 1px solid #ced4da;
}
.select2-container--default .select2-selection--single .select2-selection__rendered { color: #495057; line-height: 1.5; }
.select2-container--default .select2-selection--single .select2-selection__arrow { height: calc(2.25rem + 2px); right: 0.75rem; }
.select2-container--default .select2-selection--single:focus {
    border-color: #80bdff; outline: 0; box-shadow: 0 0 0 0.2rem rgba(0,123,255,0.25);
}
.select2-container--default .select2-results__option { font-size: 1rem; }
.file-drop-area.drag-over { border-color: #0d6efd !important; background: #e7f1ff; }
.upload-overlay {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(255,255,255,0.85); display: none;
    align-items: center; justify-content: center; z-index: 9999;
}
.upload-overlay.d-flex { display: flex !important; }

/* 16. Messenger */
.message-item {
    display: flex; align-items: center; padding: 10px;
    border-bottom: 1px solid #ddd; cursor: pointer;
}
.message-item.unread { background-color: #f9f9f9; font-weight: bold; }
.message-item:hover { background-color: #f1f1f1; }
.message-sender { flex: 1; font-weight: bold; }
.message-preview { flex: 3; color: #666; }
.message-date { flex: 1; text-align: right; color: #999; }

/* 17. Signature */
.signature-container {
    width: 100%; min-height: 200px; border: 1px solid #ccc;
    display: flex; align-items: center; justify-content: center;
    background-color: #fff;
}
.signature-pad { width: 100%; height: 200px; }
.signature-image { max-width: 100%; height: 200px; object-fit: contain; }

/* 18. Return Button */
#returnToTopBtn {
    display: none; position: fixed; bottom: 40px; right: 30px; z-index: 99;
    font-size: 18px; border: none; outline: none;
    background-color: var(--primary-color, #045531); color: white; cursor: pointer;
    padding: 12px 16px; border-radius: 50%;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    transition: all 0.3s ease-in-out;
}
#returnToTopBtn:hover { background-color: var(--primary-dark, #033f26); }

/* 19. Tables */
.table-container-scroll input:focus {
    outline: none; box-shadow: none;
    border-left: 3px solid #0d6efd;
    transition: border-color 0.2s;
}
.text-small { font-size: 0.875rem; }

/* 20. Columns (Responsive) */
@media (min-width: 992px) {
    .col-lg-custom { flex: 0 0 20%; max-width: 20%; }
}

/* 21. Mobile Menu */
#mobileMenuOverlay {
    display: none; position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background-color: white; z-index: 1050; overflow-y: auto; padding: 2rem 1rem;
}
#mobileMenuOverlay.active { display: block; }
.mobile-menu-tile {
    border: 2px solid var(--primary-color, #022C1A); border-radius: 10px;
    padding: 0.65rem; display: flex; flex-direction: column;
    align-items: center; text-align: center; cursor: pointer;
    background: var(--light-color, #f8f9fa); transition: all 0.3s ease; font-size: 0.65rem;
}
.mobile-menu-tile i { font-size: 1.3rem; margin-bottom: 0.3rem; color: var(--primary-color, #022C1A); }
.mobile-menu-tile strong { font-size: 0.75rem; }
.mobile-submenu-container { display: none; }
.mobile-submenu-container.active { display: block; }
.mobile-submenu a, .submenu-tile {
    display: block; padding: 0.65rem; margin: 0.3rem 0;
    background: var(--primary-lighter, #e9f5f1); border: 2px solid var(--primary-color, #022C1A); border-radius: 8px;
    color: var(--primary-color, #022C1A); text-decoration: none; font-weight: 600;
    font-size: 0.75rem; text-align: center; transition: background 0.2s ease;
}
.mobile-submenu a:hover, .submenu-tile:hover { background-color: var(--primary-light, #d3ebe2); }
#mobileBackButton { display: none; margin-top: 2rem; text-align: center; }
#mobileBackButton.active { display: block; cursor: pointer; color: var(--primary-color, #022C1A); font-size: 1.2rem; }
.hidden-submenu { display: none; }
@media (max-width: 768px) {
    #mobileMenuParentTiles, #mobileSubmenuContainer { padding-top: 7rem; }
    .navbar-toggler {
        position: fixed; top: 1rem; right: 1rem; z-index: 1060;
        background: white; border-radius: 8px; box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }
}
@media (min-width: 769px) {
    .navbar-toggler { position: static !important; box-shadow: none !important; background: none !important; }
}
.navbar-toggler-icon { position: relative; z-index: 1061; }
#mobileSubmenuParentTile .mobile-menu-tile { transform: scale(0.85); }

/* 22. Dashboards */
.tao_dashboard.card, .contractor_dashboard.card, .maintenance_dashboard.card {
    transition: transform 0.2s ease-in-out;
}
.tao_dashboard.card:hover, .contractor_dashboard.card:hover, .maintenance_dashboard.card:hover {
    transform: translateY(-4px);
}
.tao_dashboard .card-body i, .contractor_dashboard .card-body i, .maintenance_dashboard .card-body i {
    font-size: 1.8rem; display: block; margin-bottom: 8px;
}
@media (max-width: 767px) {
    .tao_dashboard p.fs-4, .contractor_dashboard p.fs-4 { font-size: 1.25rem !important; }
}

/* 23. Quill */
.quill-wrapper { margin-bottom: 1rem; }
.custom-quill-editor { min-height: 150px; box-sizing: border-box; }
.ql-container { box-sizing: border-box; width: 100%; }

/* 24. Suppliers */
#productSortableTable tr { cursor: move; }

/* 25. Toasts & Badges */
.z-toast { z-index: 1100; }
.flag-button img { display: inline-block; vertical-align: middle; border-radius: 2px; }
.bg-amber { background-color: #FFBF00; color: #222; }

/* Click-to-call functionality */
.click-to-call {
    cursor: pointer;
}


/* --- END --- */
