/* Navigation styles */
.navigation {
    display: none; /* Hidden by default, shown after login */
    background: linear-gradient(135deg, #1483f1, #0d6efd);
    padding: 0;
    box-shadow: 0 4px 15px rgba(20, 131, 241, 0.3);
    margin-bottom: 2rem;
    position: sticky;
    top: 0;
    z-index: 1000;
    min-height: 70px;
    box-sizing: border-box;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0 1rem;
    min-height: 70px;
    box-sizing: border-box;
    position: relative;
}

.nav-headers {
    display: flex;
    align-items: center;
    gap: 0;
    height: 100%;
    box-sizing: border-box;
}

.nav-header {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
    height: 100%;
    display: flex;
    align-items: center;
    box-sizing: border-box;
}

.nav-header-link {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    padding: 1.2rem 2rem;
    height: 100%;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
    border-radius: 0;
    position: relative;
    overflow: hidden;
    box-sizing: border-box;
    white-space: nowrap;
}

.nav-header-link:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.nav-header-link:hover::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: white;
    animation: slideIn 0.3s ease;
}

.current-page {
    color: white;
    background: rgba(255, 255, 255, 0.15);
    padding: 1.2rem 2rem;
    height: 100%;
    display: flex;
    align-items: center;
    position: relative;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
    white-space: nowrap;
}

.current-page::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: white;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.6);
}

/* Mobile menu toggle button */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 1001;
}

.mobile-menu-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

/* Mobile navigation overlay */
.mobile-nav-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1002;
}

.mobile-nav-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100%;
    background: linear-gradient(135deg, #1483f1, #0d6efd);
    transition: right 0.3s ease;
    z-index: 1003;
    padding: 1rem 0;
    box-shadow: -4px 0 15px rgba(0, 0, 0, 0.3);
}

.mobile-nav-menu.open {
    right: 0;
}

.mobile-nav-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1rem 1rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.mobile-nav-title {
    color: white;
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0;
}

.mobile-nav-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
}

.mobile-nav-items {
    padding: 1rem 0;
}

.mobile-nav-item {
    display: block;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    padding: 1rem 1.5rem;
    font-size: 1.1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
}

.mobile-nav-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-left-color: white;
}

.mobile-nav-item.current {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border-left-color: white;
}

.mobile-search-container {
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.mobile-search-input {
    width: 100%;
    padding: 0.75rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.mobile-search-button {
    width: 100%;
    background: white;
    color: #1483f1;
    border: none;
    padding: 0.75rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
}

.refresh-button {
    background: white;
    color: #1483f1;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    margin: 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.refresh-button:hover {
    background: #f8f9fa;
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

#updateRoutesButton {
    display: none;
}

/* Search functionality styles */
.search-container {
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
}

#nodeSearchInput {
    padding: 8px 12px;
    border: none;
    border-radius: 20px;
    font-size: 14px;
    width: 300px;
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    transition: all 0.3s ease;
}

#nodeSearchInput:focus {
    outline: none;
    background: white;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.5);
    width: 350px;
}

#nodeSearchInput::placeholder {
    color: #666;
}

#searchButton {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    white-space: nowrap;
}

#searchButton:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-height: 300px;
    overflow-y: auto;
    z-index: 1001;
    display: none;
}

.search-result-item {
    padding: 12px 16px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.search-result-item:hover {
    background-color: #f5f5f5;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-name {
    font-weight: 600;
    color: #333;
}

.search-result-details {
    font-size: 12px;
    color: #666;
    margin-top: 2px;
}

/* Responsive Design Media Queries */

/* Tablet styles */
@media screen and (max-width: 1024px) {
    .nav-container {
        padding: 0 0.75rem;
        gap: 0.75rem;
    }

    .nav-header {
        font-size: 1.1rem;
    }

    .nav-header-link,
    .current-page {
        padding: 1rem 1.5rem;
    }

    #nodeSearchInput {
        width: 220px;
    }

    #nodeSearchInput:focus {
        width: 250px;
    }

    #updateRoutesButton {
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
    }
}

/* Mobile landscape styles */
@media screen and (max-width: 768px) {
    .navigation {
        min-height: 60px;
    }

    .nav-container {
        min-height: 60px;
        padding: 0 1rem;
        justify-content: space-between;
    }

    .mobile-menu-toggle {
        display: block;
    }

    .nav-headers {
        display: none;
    }

    .search-container {
        display: none;
    }

    #updateRoutesButton {
        display: block !important;
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
        border-radius: 20px;
        margin: 0;
        margin-right: 0.5rem;
    }

    .mobile-nav-menu {
        display: block;
    }

    #map {
        top: 60px;
    }

    .floating-form {
        top: 70px;
    }
}

/* Mobile portrait styles */
@media screen and (max-width: 480px) {
    .navigation {
        min-height: 56px;
    }

    .nav-container {
        min-height: 56px;
        padding: 0 0.75rem;
        justify-content: space-between;
        align-items: center;
    }

    .mobile-nav-title {
        font-size: 1.1rem;
    }

    .mobile-nav-item {
        padding: 0.75rem 1rem;
        font-size: 1rem;
    }

    #updateRoutesButton {
        padding: 0.4rem 0.8rem !important;
        font-size: 0.8rem !important;
        border-radius: 18px !important;
        margin-right: 0.25rem !important;
    }

    #map {
        top: 56px;
    }

    .floating-form {
        top: 66px;
        left: 0.5rem;
        right: 0.5rem;
        width: auto;
    }

    .large-input {
        width: 100%;
        box-sizing: border-box;
    }
}

/* Very small screens */
@media screen and (max-width: 360px) {
    .mobile-nav-menu {
        width: 100%;
        right: -100%;
    }

    .mobile-nav-menu.open {
        right: 0;
    }
}

@keyframes slideIn {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}

/* Route Stats Styles */
.route-stats-container {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    color: white;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.route-stats-text {
    white-space: nowrap;
}

.route-stats-text.needs-update {
    color: #ffc107;
    font-weight: 600;
}

.route-stats-text.all-clean {
    color: #90EE90;
}

/* Sync Button Styles */
.sync-button {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    padding: 0.6rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.sync-button:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.sync-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Mobile adjustments for new elements */
@media screen and (max-width: 768px) {
    .route-stats-container {
        display: none;
    }
    
    .sync-button {
        display: none;
    }
}
