/* Premium Profile Dropdown - Frosted Aurora Design */
#dropdownProfileButton img {
    width: 32px;
    height: 32px;
    border: 2px solid #fff;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

#dropdownProfileButton:hover img {
    transform: scale(1.1);
    border-color: #3295fd;
}

.dropdown-menu {
    border: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1) !important;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.9) !important;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 1rem !important;
    padding: 1rem !important;
    transform-origin: top right;
    /* Only animate when shown to avoid flickering during reflows */
    visibility: hidden;
    opacity: 0;
    display: block;
    transition:
        visibility 0s 0.3s,
        opacity 0.3s ease;
}

.dropdown-menu.show {
    visibility: visible;
    opacity: 1;
    transition: opacity 0.3s ease;
    animation: aurora-fade-in 0.3s ease-out;
}

.dropdown-item {
    transition: all 0.2s ease;
    border-radius: 0.5rem !important;
    padding: 0.6rem 1rem !important;
}

.dropdown-item:hover {
    background: linear-gradient(310deg, #072654 0%, #3295fd 100%) !important;
    color: #fff !important;
    transform: translateX(5px);
}

.dropdown-item:hover * {
    color: #fff !important;
}

@keyframes aurora-fade-in {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-10px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Hide scrollbar for Chrome, Safari and Opera */
*::-webkit-scrollbar {
    display: none;
}

/* Hide scrollbar for IE, Edge and Firefox */
* {
    -ms-overflow-style: none; /* IE and Edge */
    scrollbar-width: none; /* Firefox */
}

/* Hide Perfect Scrollbar rail */
.ps__rail-x,
.ps__rail-y {
    display: none !important;
}

/* Sidebar Icon & Arrow Transitions */
.navbar-nav .nav-link .icon {
    transition: all 0.2s ease;
}

.navbar-nav .nav-link .icon i {
    color: #344767 !important;
    transition: all 0.2s ease;
}

.navbar-nav .nav-link.active .icon i {
    color: #fff !important;
}

.navbar-nav .nav-link:hover .icon {
    background-image: linear-gradient(
        310deg,
        #072654 0%,
        #3295fd 100%
    ) !important;
}

.navbar-nav .nav-link:hover .icon i,
.navbar-nav .nav-link:hover .fa-chevron-down {
    color: #fff !important;
}

.nav-link[aria-expanded="true"] .fa-chevron-down {
    transform: rotate(180deg);
}

.fa-chevron-down {
    transition: transform 0.3s ease;
}

/* Responsive Enhancements */
@media (max-width: 991.98px) {
    .main-content {
        padding: 0 1rem;
    }

    .navbar-vertical.navbar-expand-xs {
        max-width: 250px !important;
    }

    /* Fixed profile image on mobile */
    #dropdownProfileButton img {
        width: 30px;
        height: 30px;
    }
}

/* Table Responsiveness */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Standardizing DataTables Style */
.dataTables_wrapper .dataTables_length select,
.dataTables_wrapper .dataTables_filter input {
    border-radius: 8px !important;
    border: 1px solid #d2d6da !important;
    padding: 0.4rem 0.75rem !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    border-radius: 8px !important;
    border: none !important;
    margin: 0 2px !important;
    padding: 5px 10px !important;
    cursor: pointer;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: linear-gradient(310deg, #072654 0%, #3295fd 100%) !important;
    color: #fff !important;
    border: none !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: #f8f9fa !important;
    color: #3295fd !important;
    border: none !important;
}

.dataTables_info {
    font-size: 0.875rem;
    color: #67748e;
}

/* Project Specific Styles */
.project-avatar {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1.2rem;
    color: #fff;
    box-shadow:
        0 4px 6px -1px rgba(0, 0, 0, 0.1),
        0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
}

tr:hover .project-avatar {
    transform: scale(1.1) rotate(5deg);
}

.status-badge {
    padding: 0.5em 1em;
    border-radius: 8px;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.5px;
    display: inline-block;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.action-btn {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    margin: 0 2px;
    transition: all 0.2s ease;
    background: #fff;
    border: 1px solid #e9ecef;
    color: #a0a0a0;
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.action-btn.view:hover {
    color: #17ad37;
    border-color: #17ad37;
}

.action-btn.edit:hover {
    color: #3295fd;
    border-color: #3295fd;
}

/* Project Show Specific Styles */
.avatar i {
    font-size: 1.5rem;
}
.bg-light-soft {
    background-color: #f8f9fa;
}
.shadow-blur {
    box-shadow:
        inset 0 0 1px 1px hsla(0, 0%, 100%, 0.9),
        0 20px 27px 0 rgba(0, 0, 0, 0.05) !important;
}
.progress-bar {
    transition: width 1s ease-in-out;
}

/* Daily Update Form Styles */
.form-control-sm {
    height: unset !important;
    padding: 0.5rem 0.75rem !important;
}
textarea.form-control-sm {
    min-height: 40px;
}
#updates-table th {
    border-bottom: 0 !important;
}
#updates-table td {
    vertical-align: top !important;
}

/* Daily Update Edit Specific Styles */
.form-control-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #8392ab;
    margin-bottom: 0.5rem;
}
.shadow-info {
    box-shadow:
        0 4px 20px 0 rgba(0, 0, 0, 0.14),
        0 7px 10px -5px rgba(26, 115, 232, 0.4) !important;
}

/* Animation Helpers */
.counter {
    display: inline-block;
}

[data-aos] {
    pointer-events: none;
}

.aos-animate {
    pointer-events: auto;
}

/* Staggered Delay Helpers */
.delay-100 {
    animation-delay: 100ms;
}
.delay-200 {
    animation-delay: 200ms;
}
.delay-300 {
    animation-delay: 300ms;
}
.delay-400 {
    animation-delay: 400ms;
}
.delay-500 {
    animation-delay: 500ms;
}

/* Progress Bar Pulse Animation */
@keyframes progress-bar-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(50, 149, 253, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(50, 149, 253, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(50, 149, 253, 0);
    }
}

.progress-bar-animated {
    animation: progress-bar-pulse 2s infinite;
}

/* Card Hover Glow */
.card-hover-glow {
    transition: all 0.3s ease;
}

.card-hover-glow:hover {
    box-shadow: 0 10px 20px rgba(50, 149, 253, 0.15) !important;
    transform: translateY(-5px);
}
.dark-blue {
    background-color: #072654;
}
.text-color-blue {
    color: #072654;
}
.text-color-lightblue {
    color: #3295fd;
}
.backgroundcolor {
    background-color: #f8f9fa;
}

/* --- Global Theme Overrides for Custom Palette --- */

/* Primary Overrides (#072654 & #3295FD linear gradients) */
.bg-gradient-primary {
    background-image: linear-gradient(
        310deg,
        #072654 0%,
        #3295fd 100%
    ) !important;
}

.bg-primary {
    background-color: #072654 !important;
}

.btn-primary,
.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
    background-color: #072654 !important;
    border-color: #072654 !important;
    color: #fff !important;
}

.btn-outline-primary {
    color: #072654 !important;
    border-color: #072654 !important;
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
    background-color: #072654 !important;
    color: #fff !important;
}

.text-primary {
    color: #072654 !important;
}

/* Primary Light Backgrounds */
.bg-primary-soft {
    background-color: rgba(7, 38, 84, 0.1) !important;
}

/* Info Overrides (#3295FD) */
.bg-gradient-info {
    background-image: linear-gradient(
        310deg,
        #3295fd 0%,
        #072654 100%
    ) !important;
}

.bg-info {
    background-color: #3295fd !important;
}

.btn-info,
.btn-info:hover,
.btn-info:focus,
.btn-info:active {
    background-color: #3295fd !important;
    border-color: #3295fd !important;
    color: #fff !important;
}

.text-info {
    color: #3295fd !important;
}

/* Global specific overrides for specific Soft UI specific active states */
.navbar-vertical .navbar-nav .nav-link.active .icon {
    background-image: linear-gradient(
        310deg,
        #072654 0%,
        #3295fd 100%
    ) !important;
    box-shadow:
        0 4px 6px -1px rgba(7, 38, 84, 0.2),
        0 2px 4px -1px rgba(7, 38, 84, 0.1) !important;
}

.form-check-input:checked {
    background-color: #072654 !important;
    border-color: #072654 !important;
}

.nav-pills .nav-link.active,
.nav-pills .show > .nav-link {
    background-color: #f8f9fa !important;
    color: #072654 !important;
    box-shadow: 0 2px 4px rgba(7, 38, 84, 0.1) !important;
}

/* ==========================================================================
   Liquid Responsive Design System base on user's structure 
   This ensures flexible fluid scaling for all components across sizes
   ========================================================================== */

/* 1. Fluid Base & Containers */
img,
video,
canvas,
svg {
    max-width: 100%;
    height: auto;
}

.container-fluid {
    width: 100%;
    padding-right: clamp(1rem, 5vw, 2rem);
    padding-left: clamp(1rem, 5vw, 2rem);
    margin-right: auto;
    margin-left: auto;
}

/* 2. Liquid Table & Forms Enhancements */
.table-responsive {
    min-width: 100%;
    overflow-x: auto;
    /* Hide scrollbar visually but keep functionality */
    scrollbar-width: thin;
    scrollbar-color: rgba(7, 38, 84, 0.2) transparent;
}

.table-responsive::-webkit-scrollbar {
    height: 6px;
}
.table-responsive::-webkit-scrollbar-track {
    background: transparent;
}
.table-responsive::-webkit-scrollbar-thumb {
    background-color: rgba(7, 38, 84, 0.2);
    border-radius: 10px;
}

/* Support for the new padded wrapper approach */
.table-responsive.p-3 {
    box-sizing: border-box;
}

table.dataTable {
    width: 100% !important;
    min-width: 600px; /* Force scroll on extremely small devices to preserve layout */
    margin-top: 1rem !important;
    margin-bottom: 1rem !important;
}

/* 3. Daily Update Dynamic Table Inputs */
/* Ensures that inputs inside tables flex and don't break width */
.update-row td {
    min-width: 140px; /* Minimum width to prevent input squishing */
}
.update-row td:nth-child(6) {
    min-width: 118px; /* Larger area for textboxes */
}

/* 4. Responsive DataTables Controls */
.dataTables_wrapper .row {
    align-items: center;
    width: 100%;
    margin: 0;
}

@media (max-width: 767.98px) {
    /* Stack DataTables headers & footers automatically */
    .dataTables_wrapper .col-sm-12 {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        margin-bottom: 1rem;
    }

    .dataTables_wrapper .dataTables_length,
    .dataTables_wrapper .dataTables_filter {
        text-align: center;
        width: 100%;
        margin-bottom: 0.5rem;
    }

    .dataTables_wrapper .dataTables_info,
    .dataTables_wrapper .dataTables_paginate {
        text-align: center;
        width: 100%;
        margin-top: 0.5rem;
        justify-content: center;
        display: flex;
    }

    /* Improve pagination buttons for touch */
    .dataTables_wrapper .dataTables_paginate .paginate_button {
        padding: 0.6rem 1rem !important;
        margin: 2px !important;
        font-size: 0.875rem;
    }

    /* Prevent cards from sticking to screen edges */
    .card {
        margin-bottom: 1.5rem;
        border-radius: 1rem;
    }

    /* Make typography liquid */
    h4,
    h5,
    h6 {
        font-size: clamp(1rem, 4vw, 1.25rem);
    }
}

/* 5. Liquid Form Inputs & Buttons */
.form-control,
.form-select {
    width: 100%;
    max-width: 100%;
}

.btn {
    white-space: normal;
    word-wrap: break-word;
}

/* Utility Classes */
.text-ellipsis {
    display: inline-block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.hours-spent {
    width: 100px;
}
.work-done {
    width: 100%;
    min-width: 300px;
}

.max-width-100 {
    max-width: 100px;
}
.max-width-150 {
    max-width: 150px;
}
.max-width-200 {
    max-width: 200px;
}
.max-width-300 {
    max-width: 300px;
}

/* Image Preview Container */
.preview-container {
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    overflow: hidden;
}

/* Premium Select2 Soft UI Styling */
.select2-container--bootstrap-5 .select2-selection {
    border: 1px solid #d2d6da !important;
    border-radius: 0.5rem !important; /* Matches form-control */
    padding: 0.5rem 0.75rem !important;
    min-height: 40px !important;
    transition: all 0.2s ease;
    background-color: #fff !important;
    display: flex !important;
    align-items: center !important;
}

.select2-container--bootstrap-5.select2-container--focus .select2-selection {
    border-color: #3295fd !important;
    box-shadow: 0 0 0 2px rgba(50, 149, 253, 0.2) !important;
    outline: 0 !important;
}

/* Handle is-invalid state */
.is-invalid + .select2-container--bootstrap-5 .select2-selection {
    border-color: #ea0606 !important;
}

.is-invalid + .select2-container--bootstrap-5.select2-container--focus .select2-selection {
    box-shadow: 0 0 0 2px rgba(234, 6, 6, 0.2) !important;
}

/* Multi-select Specific Adjustments */
.select2-container--bootstrap-5 .select2-selection--multiple {
    padding: 0.25rem 0.5rem !important;
    min-height: 40px !important;
    display: block !important; /* Reset to block for wrapping */
}

.select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__rendered {
    display: flex !important;
    flex-wrap: wrap !important;
    padding: 0 !important;
    margin: 0 !important;
    list-style: none !important;
    width: 100% !important;
}

/* Multi-select Tags (Chips) with Premium Gradient */
.select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__choice {
    background-image: linear-gradient(310deg, #072654 0%, #3295fd 100%) !important;
    color: #fff !important;
    border: none !important;
    border-radius: 6px !important;
    padding: 2px 10px !important;
    margin: 2px 4px 2px 0 !important;
    font-weight: 600 !important;
    font-size: 0.75rem !important;
    display: flex !important;
    align-items: center !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06) !important;
    transition: all 0.2s ease !important;
    height: 24px !important;
}

.select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__choice:hover {
    transform: translateY(-1px);
    box-shadow: 0 7px 14px rgba(50, 50, 93, 0.1), 0 3px 6px rgba(0, 0, 0, 0.08) !important;
}

.select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__choice__remove {
    color: #fff !important;
    border-right: 1px solid rgba(255, 255, 255, 0.2) !important;
    padding-right: 5px !important;
    margin-right: 5px !important;
    transition: all 0.2s ease !important;
    background: transparent !important;
    border-left: none !important;
    font-size: 0.8rem !important;
}

.select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__choice__remove:hover {
    background-color: rgba(255, 255, 255, 0.2) !important;
    color: #fff !important;
}

.select2-container--bootstrap-5 .select2-selection--multiple .select2-search {
    display: inline-block !important;
    flex-grow: 1 !important;
}

.select2-container--bootstrap-5 .select2-selection--multiple .select2-search .select2-search__field {
    margin-top: 0 !important;
    padding: 0.25rem 0 !important;
    font-family: inherit !important;
    font-size: 0.875rem !important;
    height: 28px !important;
}

/* Small variant support */
.select2--small .select2-selection {
    min-height: 32px !important;
    padding: 0.25rem 0.5rem !important;
    font-size: 0.75rem !important;
}

.select2--small .select2-selection--multiple .select2-selection__choice {
    height: 20px !important;
    font-size: 0.65rem !important;
    padding: 1px 8px !important;
}

/* Dropdown Premium Styling */
.select2-container--bootstrap-5 .select2-dropdown {
    border: none !important;
    border-radius: 1rem !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1) !important;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.98) !important;
    overflow: hidden !important;
    margin-top: 5px !important;
    border: 1px solid rgba(0, 0, 0, 0.05) !important;
}

.select2-container--bootstrap-5 .select2-results__option--highlighted[aria-selected] {
    background: linear-gradient(310deg, #072654 0%, #3295fd 100%) !important;
    color: #fff !important;
}

.select2-container--bootstrap-5 .select2-results__option {
    padding: 0.6rem 1rem !important;
    font-size: 0.875rem !important;
    transition: all 0.2s ease !important;
}

.select2-container--bootstrap-5 .select2-search__field {
    border-radius: 0.5rem !important;
    border: 1px solid #d2d6da !important;
    padding: 0.4rem 0.75rem !important;
}

/* Premium CKEditor 5 Soft UI Styling */
:root {
    --ck-border-radius: 0.75rem !important;
    --ck-color-base-border: #d2d6da !important;
    --ck-color-focus-border: #3295fd !important;
    --ck-color-shadow-drop: rgba(0, 0, 0, 0.05) !important;
    --ck-color-shadow-inner: rgba(0, 0, 0, 0.05) !important;
    --ck-color-button-default-hover-background: #f8f9fa !important;
    --ck-color-button-on-background: #f8f9fa !important;
    --ck-color-button-on-color: #072654 !important;
    --ck-spacing-standard: 10px !important;
}

.ck-editor__editable {
    min-height: 200px !important;
    border-radius: 0 0 0.75rem 0.75rem !important;
    transition: all 0.2s ease !important;
    font-size: 0.875rem !important;
    color: #67748e !important;
    padding: 1rem 1.25rem !important;
}

.ck-editor__top {
    border-radius: 0.75rem 0.75rem 0 0 !important;
    overflow: hidden !important;
}

.ck.ck-toolbar {
    border-radius: 0.75rem 0.75rem 0 0 !important;
    background-color: #fff !important;
    border-bottom: 1px solid #e9ecef !important;
}

.ck.ck-editor__main > .ck-editor__editable.ck-focused {
    border-color: #3295fd !important;
    box-shadow: 0 0 0 2px rgba(50, 149, 253, 0.2) !important;
}

.ck.ck-content h2, .ck.ck-content h3, .ck.ck-content h4 {
    color: #072654 !important;
    font-weight: 700 !important;
}

.ck.ck-content p {
    margin-bottom: 1rem !important;
}

/* Rich Text Content Styling for Task Descriptions */
.text-sm blockquote, 
.task-description blockquote {
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    border-left: 4px solid #3295fd;
    background-color: #f8f9fa;
    font-style: italic;
    color: #4a5568;
    border-radius: 0 0.5rem 0.5rem 0;
}

.text-sm code,
.task-description code {
    background-color: #f1f5f9;
    color: #e83e8c;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 85%;
}

.text-sm pre,
.task-description pre {
    background-color: #1a202c;
    color: #f8f9fa;
    padding: 1rem;
    border-radius: 0.75rem;
    overflow-x: auto;
    margin-bottom: 1rem;
}

.text-sm pre code,
.task-description pre code {
    background-color: transparent;
    color: inherit;
    padding: 0;
    font-size: 100%;
}

.text-sm ul, .text-sm ol,
.task-description ul, .task-description ol {
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}

/* 6. Fix Navbar & Sidebar Collapses gracefully */
@media (max-width: 1199.98px) {
    .sidenav {
        transform: translateX(-100%);
        transition: transform 0.3s ease-in-out;
    }
    .sidenav.show {
        transform: translateX(0);
    }
    .g-sidenav-show .main-content {
        margin-left: 0 !important;
    }
}

/* Sidebar Logo Styling Overrides */
.sidenav-header {
    height: auto !important;
    min-height: 85px !important;
    display: flex !important;
    align-items: center !important;
}

.navbar-vertical .navbar-brand {
    padding: 0.5rem 1.5rem !important;
    margin: 0 !important;
}

.sidebar-logo {
    width: 200px !important;
    height: auto !important;
    max-width: 100% !important;
    object-fit: contain !important;
}
