/* =========================================
   LFMS - Mobile Navbar Responsive Styles
   Enhanced mobile experience for header/navbar
   ========================================= */

/* =========================================
   MOBILE HEADER OPTIMIZATIONS
   ========================================= */
@media (max-width: 768px) {
    .main-header {
        height: 56px;
        padding: 0 8px;
    }

    .logo-header {
        padding: 8px 12px;
        min-width: auto;
    }

    .navbar-brand img {
        height: 24px;
    }

    .nav-toggle {
        margin-left: auto;
        display: flex;
        gap: 8px;
    }

    .nav-toggle .btn {
        padding: 8px;
        width: 36px;
        height: 36px;
        border-radius: 6px;
    }

    .nav-toggle .btn i {
        font-size: 16px;
    }

    .topbar-toggler.more {
        display: none;
    }
}

/* =========================================
   MOBILE NAVBAR LAYOUT
   ========================================= */
@media (max-width: 768px) {
    .navbar-header {
        padding: 0 !important;
    }

    .topbar-nav {
        margin: 0;
        padding: 0;
    }

    .topbar-nav .nav-item {
        margin: 0 2px;
    }

    .topbar-nav .nav-link {
        padding: 10px;
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 8px;
        transition: all 0.2s ease;
    }

    .topbar-nav .nav-link:hover {
        background-color: rgba(74, 111, 165, 0.1);
        transform: scale(1.05);
    }

    .topbar-nav .nav-link i {
        font-size: 18px;
    }

    /* Notification badge positioning */
    .topbar-nav .nav-link .notification {
        position: absolute;
        top: 6px;
        right: 6px;
        font-size: 10px;
        padding: 2px 6px;
        min-width: 16px;
        height: 16px;
        line-height: 12px;
    }
}

/* =========================================
   MOBILE DROPDOWN IMPROVEMENTS
   ========================================= */
@media (max-width: 768px) {
    .dropdown-menu {
        border: none;
        border-radius: 12px;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
        margin-top: 8px;
        padding: 8px 0;
        min-width: 280px;
        max-width: calc(100vw - 32px);
    }

    .dropdown-menu::before {
        content: '';
        position: absolute;
        top: -6px;
        right: 16px;
        width: 0;
        height: 0;
        border-left: 6px solid transparent;
        border-right: 6px solid transparent;
        border-bottom: 6px solid white;
    }

    .dropdown-item {
        padding: 12px 16px;
        font-size: 14px;
        display: flex;
        align-items: center;
        gap: 12px;
    }

    .dropdown-item i {
        width: 16px;
        text-align: center;
    }

    .dropdown-item:hover {
        background-color: rgba(74, 111, 165, 0.08);
        color: var(--primary-color);
    }

    /* Messages dropdown specific */
    .messages-notif-box {
        max-height: 300px;
    }

    .message-notif-scroll {
        max-height: 280px;
    }

    .notif-center .notif-content {
        flex: 1;
    }

    .notif-center .subject {
        font-weight: 600;
        font-size: 14px;
    }

    .notif-center .block {
        font-size: 12px;
        color: var(--text-secondary);
        margin: 2px 0;
    }

    .notif-center .time {
        font-size: 11px;
        color: var(--text-light);
    }

    /* Notifications dropdown specific */
    .notif-box {
        max-height: 350px;
    }

    .notif-scroll {
        max-height: 330px;
    }

    /* Quick actions dropdown specific */
    .quick-actions {
        min-width: 320px;
        max-width: calc(100vw - 32px);
    }

    .quick-actions-items .col-6 {
        padding: 4px;
    }

    .quick-actions-item {
        padding: 16px 8px;
        border-radius: 8px;
        transition: all 0.2s ease;
        text-align: center;
    }

    .quick-actions-item:hover {
        background-color: rgba(74, 111, 165, 0.1);
        transform: translateY(-2px);
    }

    .quick-actions-item .avatar-item {
        width: 48px;
        height: 48px;
        margin: 0 auto 8px;
        border-radius: 12px;
    }

    .quick-actions-item .avatar-item i {
        font-size: 20px;
    }

    .quick-actions-item .text {
        font-size: 12px;
        font-weight: 500;
    }
}

/* =========================================
   MOBILE USER PROFILE DROPDOWN
   ========================================= */
@media (max-width: 768px) {
    .topbar-user .dropdown-toggle {
        padding: 8px;
        min-width: 44px;
        min-height: 44px;
    }

    .avatar-sm {
        width: 32px;
        height: 32px;
    }

    .avatar-title {
        font-size: 14px;
    }

    .dropdown-user {
        min-width: 240px;
        padding: 8px 0;
    }

    .dropdown-user .dropdown-item {
        padding: 14px 16px;
        font-size: 14px;
    }

    .dropdown-user .dropdown-divider {
        margin: 8px 0;
    }
}

/* =========================================
   MOBILE SEARCH DROPDOWN
   ========================================= */
@media (max-width: 768px) {
    .dropdown-search {
        min-width: calc(100vw - 32px);
        margin-top: 8px;
    }

    .dropdown-search .input-group .form-control {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 12px 16px;
        border-radius: 8px;
    }

    .dropdown-search .btn {
        padding: 12px 16px;
        border-radius: 0 8px 8px 0;
    }
}

/* =========================================
   MODERN ICON STYLING - Lucide Icons
   ========================================= */
.lucide-icon {
    width: 1em;
    height: 1em;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
    display: inline-block;
    vertical-align: middle;
    transition: all 0.2s ease-in-out;
}

/* Navbar Icons */
.topbar-nav .lucide-icon {
    width: 20px;
    height: 20px;
    stroke-width: 2.5;
}

@media (max-width: 768px) {
    .topbar-nav .lucide-icon {
        width: 18px;
        height: 18px;
    }
}

/* Notification Badge Positioning */
.notification {
    position: absolute;
    top: -2px;
    right: -2px;
    font-size: 10px;
    padding: 2px 5px;
    border-radius: 10px;
    min-width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

/* Dropdown Icons */
.dropdown-menu .lucide-icon {
    width: 16px;
    height: 16px;
    stroke-width: 2;
}

/* Quick Actions Icons */
.quick-actions-item .lucide-icon {
    width: 24px;
    height: 24px;
    stroke-width: 2;
}

@media (max-width: 768px) {
    .quick-actions-item .lucide-icon {
        width: 20px;
        height: 20px;
    }
}

/* User Avatar Icon */
.avatar-title .lucide-icon {
    width: 16px;
    height: 16px;
    stroke-width: 2.5;
    stroke: currentColor;
}

/* Button Icons */
.btn .lucide-icon {
    width: 16px;
    height: 16px;
    stroke-width: 2.5;
}

/* Hover Effects */
.nav-link:hover .lucide-icon,
.dropdown-item:hover .lucide-icon {
    stroke-width: 2.8;
    transform: scale(1.05);
}

/* Focus States */
.nav-link:focus .lucide-icon,
.dropdown-item:focus .lucide-icon {
    stroke-width: 2.8;
}
@media (max-width: 576px) {
    .main-header {
        height: 52px;
        padding: 0 4px;
    }

    .logo-header {
        padding: 6px 8px;
    }

    .navbar-brand img {
        height: 20px;
    }

    .nav-toggle .btn {
        width: 32px;
        height: 32px;
        padding: 6px;
    }

    .nav-toggle .btn i {
        font-size: 14px;
    }

    .topbar-nav .nav-link {
        padding: 8px;
        min-width: 40px;
        min-height: 40px;
    }

    .topbar-nav .nav-link i {
        font-size: 16px;
    }

    .topbar-nav .nav-link .notification {
        font-size: 9px;
        padding: 1px 5px;
        min-width: 14px;
        height: 14px;
        line-height: 12px;
    }

    .dropdown-menu {
        min-width: 250px;
        max-width: calc(100vw - 16px);
        margin: 4px 8px;
    }

    .quick-actions {
        min-width: 280px;
    }

    .quick-actions-items .col-6 {
        padding: 2px;
    }

    .quick-actions-item {
        padding: 12px 6px;
    }

    .quick-actions-item .avatar-item {
        width: 40px;
        height: 40px;
        margin-bottom: 6px;
    }

    .quick-actions-item .avatar-item i {
        font-size: 16px;
    }
}

/* =========================================
   ENHANCED TABLE RESPONSIVENESS UTILITIES
   ========================================= */

/* Scroll detection for table indicators */
.table-responsive-scroll-detector {
    position: relative;
}

.table-responsive-scroll-detector::after {
    content: '⟷ Swipe to scroll';
    position: absolute;
    bottom: -20px;
    right: 0;
    font-size: 10px;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.9);
    padding: 2px 6px;
    border-radius: 3px;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.table-responsive-scroll-detector.has-scroll::after {
    opacity: 0.7;
}

/* Enhanced mobile card styles */
.mobile-cards-container {
    display: none;
}

@media (max-width: 768px) {
    .mobile-cards-container {
        display: block;
    }

    .table-responsive.mobile-cards .table {
        display: none;
    }

    .table-responsive.mobile-cards .mobile-cards-container {
        display: block;
    }
}

/* Priority column indicators */
.table th[data-priority="1"]::before,
.table th[data-priority="2"]::before,
.table th[data-priority="3"]::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: middle;
}

.table th[data-priority="1"]::before {
    background-color: #48bb78; /* High priority - green */
}

.table th[data-priority="2"]::before {
    background-color: #ed8936; /* Medium priority - orange */
}

.table th[data-priority="3"]::before {
    background-color: #f56565; /* Low priority - red */
}

/* Table action button groups */
.table-action-group {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

@media (max-width: 768px) {
    .table-action-group {
        flex-direction: column;
    }

    .table-action-group .btn {
        width: 100%;
        margin-bottom: 4px;
    }
}

/* Loading states for tables */
.table-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.6;
}

.table-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--border-color);
    border-top: 2px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* =========================================
   TOUCH-FRIENDLY INTERACTIONS
   ========================================= */
@media (max-width: 768px) {
    .dropdown-toggle {
        -webkit-tap-highlight-color: rgba(74, 111, 165, 0.2);
    }

    .dropdown-item {
        -webkit-tap-highlight-color: rgba(74, 111, 165, 0.1);
    }

    /* Prevent text selection on touch */
    .nav-link,
    .dropdown-item {
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
    }
}

/* =========================================
   LANDSCAPE MOBILE ADJUSTMENTS
   ========================================= */
@media (max-width: 768px) and (orientation: landscape) {
    .main-header {
        height: 48px;
    }

    .dropdown-menu {
        max-height: 200px;
        overflow-y: auto;
    }

    .messages-notif-box,
    .notif-box {
        max-height: 180px;
    }

    .message-notif-scroll,
    .notif-scroll {
        max-height: 160px;
    }
}
