/* Mobile Navigation Icons */
.mobile-nav-icons {
    display: none;
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    padding: 10px 15px;
    transition: all 0.3s ease;
}

.mobile-nav-icons.show {
    display: block;
}

.mobile-nav-container {
    display: flex;
    justify-content: space-around;
    align-items: center;
    max-width: 100%;
    margin: 0 auto;
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #333;
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.3s ease;
    min-width: 60px;
}

.mobile-nav-item:hover {
    background: rgba(13, 110, 253, 0.1);
    color: #0d6efd;
    transform: translateY(-2px);
}

.mobile-nav-item.active {
    background: rgba(13, 110, 253, 0.15);
    color: #0d6efd;
}

.mobile-nav-icon {
    font-size: 20px;
    margin-bottom: 4px;
    transition: all 0.3s ease;
}

.mobile-nav-item:hover .mobile-nav-icon {
    transform: scale(1.1);
}

.mobile-nav-label {
    font-size: 10px;
    font-weight: 500;
    text-align: center;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 50px;
}

/* Dark theme support */
[data-theme="dark"] .mobile-nav-icons {
    background: rgba(31, 41, 55, 0.95);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .mobile-nav-item {
    color: #f9fafb;
}

[data-theme="dark"] .mobile-nav-item:hover {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
}

[data-theme="dark"] .mobile-nav-item.active {
    background: rgba(59, 130, 246, 0.25);
    color: #3b82f6;
}

/* Modern theme support */
[data-theme="modern"] .mobile-nav-icons {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(15px);
    border-bottom: 1px solid rgba(99, 102, 241, 0.1);
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.1);
}

[data-theme="modern"] .mobile-nav-item:hover {
    background: rgba(99, 102, 241, 0.1);
    color: #6366f1;
}

[data-theme="modern"] .mobile-nav-item.active {
    background: rgba(99, 102, 241, 0.15);
    color: #6366f1;
}

/* Elegant theme support */
[data-theme="elegant"] .mobile-nav-icons {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(15px);
    border-bottom: 1px solid rgba(30, 64, 175, 0.1);
    box-shadow: 0 4px 20px rgba(30, 64, 175, 0.1);
}

[data-theme="elegant"] .mobile-nav-item:hover {
    background: rgba(30, 64, 175, 0.1);
    color: #1e40af;
}

[data-theme="elegant"] .mobile-nav-item.active {
    background: rgba(30, 64, 175, 0.15);
    color: #1e40af;
}

/* Show only on mobile screens */
@media (max-width: 768px) {
    .mobile-nav-icons {
        display: block;
    }
    
    /* Adjust navbar height for mobile nav */
    .navbar {
        margin-bottom: 0;
    }
    
    /* Add padding to body to account for fixed mobile nav */
    body {
        padding-top: 120px;
    }
    
    /* Adjust main content */
    .main-content {
        margin-top: 0;
    }
}

/* Specific adjustments for small screens */
@media (max-width: 411px) {
    /* Reduce navbar brand size for small screens */
    .navbar-brand {
        font-size: 1.1rem !important;
        font-weight: 600;
    }
    
    /* Reduce navbar height */
    .navbar {
        min-height: 50px;
        padding: 0.3rem 0.8rem;
    }
    
    /* Adjust body padding for smaller navbar */
    body {
        padding-top: 110px;
    }
    
    /* Make navbar more compact */
    .navbar-nav .nav-link {
        padding: 0.3rem 0.5rem;
        font-size: 0.8rem;
    }
    
    /* Hide navbar text on very small screens, show only icons */
    .navbar-nav .nav-link span {
        display: none;
    }
    
    .navbar-nav .nav-link i {
        font-size: 1.1rem;
    }
}

/* Ultra small screens adjustments */
@media (max-width: 375px) {
    /* Even smaller navbar brand */
    .navbar-brand {
        font-size: 1rem !important;
        font-weight: 700;
    }
    
    /* Minimal navbar height */
    .navbar {
        min-height: 45px;
        padding: 0.2rem 0.6rem;
    }
    
    /* Adjust body padding for minimal navbar */
    body {
        padding-top: 100px;
    }
    
    /* Very compact navbar links */
    .navbar-nav .nav-link {
        padding: 0.2rem 0.4rem;
        font-size: 0.75rem;
    }
    
    /* Ensure navbar doesn't take too much space */
    .navbar-collapse {
        padding-top: 0.2rem;
    }
}

/* Hide on larger screens */
@media (min-width: 769px) {
    .mobile-nav-icons {
        display: none !important;
    }
    
    body {
        padding-top: 0;
    }
}

/* Animation for smooth appearance */
@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.mobile-nav-icons.show {
    animation: slideDown 0.3s ease-out;
}

/* Pulse animation for active items */
@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

.mobile-nav-item.active .mobile-nav-icon {
    animation: pulse 2s infinite;
}

/* Responsive adjustments for smaller screens */
@media (max-width: 480px) {
    .mobile-nav-container {
        padding: 0 5px;
    }
    
    .mobile-nav-item {
        padding: 6px 8px;
        min-width: 50px;
    }
    
    .mobile-nav-icon {
        font-size: 18px;
    }
    
    .mobile-nav-label {
        font-size: 9px;
        max-width: 45px;
    }
}

/* Extra small screens (iPhone SE, S8+ and similar) */
@media (max-width: 411px) {
    .mobile-nav-icons {
        top: 60px; /* Reduce top spacing */
        padding: 8px 10px; /* Reduce padding */
    }
    
    .mobile-nav-container {
        padding: 0 2px; /* Minimal padding */
        gap: 2px; /* Reduce gap between items */
    }
    
    .mobile-nav-item {
        padding: 4px 6px; /* Smaller padding */
        min-width: 42px; /* Smaller minimum width */
        border-radius: 6px; /* Smaller border radius */
    }
    
    .mobile-nav-icon {
        font-size: 16px; /* Smaller icons */
        margin-bottom: 2px; /* Reduce margin */
    }
    
    .mobile-nav-label {
        font-size: 8px; /* Smaller text */
        max-width: 38px; /* Smaller max width */
        line-height: 1.1; /* Tighter line height */
        font-weight: 500; /* Slightly bolder for readability */
    }
    
    /* Reduce navbar height for smaller screens */
    .navbar {
        padding: 0.5rem 1rem;
    }
    
    .navbar-brand {
        font-size: 1.2rem; /* Smaller brand text */
    }
    
    .navbar-nav .nav-link {
        padding: 0.5rem 0.75rem; /* Smaller nav links */
        font-size: 0.9rem;
    }
}

/* Ultra small screens (iPhone SE and similar) */
@media (max-width: 375px) {
    .mobile-nav-icons {
        top: 55px; /* Further reduce top spacing */
        padding: 6px 8px; /* Minimal padding */
    }
    
    .mobile-nav-container {
        padding: 0 1px; /* Minimal padding */
        gap: 1px; /* Minimal gap */
    }
    
    .mobile-nav-item {
        padding: 3px 5px; /* Very small padding */
        min-width: 38px; /* Very small minimum width */
        border-radius: 4px; /* Smaller border radius */
    }
    
    .mobile-nav-icon {
        font-size: 14px; /* Very small icons */
        margin-bottom: 1px; /* Minimal margin */
    }
    
    .mobile-nav-label {
        font-size: 7px; /* Very small text */
        max-width: 32px; /* Very small max width */
        line-height: 1.0; /* Minimal line height */
        font-weight: 600; /* Bolder for readability */
    }
    
    /* Further reduce navbar for ultra small screens */
    .navbar {
        padding: 0.4rem 0.8rem;
    }
    
    .navbar-brand {
        font-size: 1.1rem; /* Even smaller brand text */
    }
    
    .navbar-nav .nav-link {
        padding: 0.4rem 0.6rem; /* Smaller nav links */
        font-size: 0.85rem;
    }
    
    /* Adjust body padding for ultra small screens */
    body {
        padding-top: 100px; /* Reduce body padding */
    }
}

/* Ensure mobile nav doesn't interfere with other elements */
.mobile-nav-icons + .container,
.mobile-nav-icons + .main-content {
    margin-top: 0;
}

/* Fix for admin pages */
.admin-layout .mobile-nav-icons {
    top: 60px;
}

/* Smooth scrolling for anchor links */
html {
    scroll-behavior: smooth;
}
