/* Modern Sidebar Navigation - Battle Page Style */

.navbar-toggler {
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    padding: 0.5rem;
}

.top-row {
    height: 3.5rem;
    background: linear-gradient(180deg, rgba(26, 31, 46, 0.95) 0%, rgba(15, 20, 25, 0.95) 100%);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(59, 130, 246, 0.25);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.navbar-brand {
    font-size: 1.1rem;
    font-weight: 700;
    color: #e0e6ed;
    letter-spacing: 0.02em;
}

.oi {
    width: 2rem;
    font-size: 1.1rem;
    vertical-align: text-top;
    top: -2px;
}

.nav-section {
    margin-bottom: 0.75rem;
}

.nav-section-title {
    color: #ffffff;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.2s, color 0.2s;
    border-radius: 6px;
    margin: 0 0.5rem 0.75rem 0.5rem;
    background: rgba(10, 15, 20, 0.7);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.nav-section-title:hover {
    background: rgba(15, 20, 30, 0.8);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.12);
}

.nav-section-toggle {
    font-size: 0.7rem;
    color: #94a3b8;
    transition: transform 0.2s, color 0.2s;
}

.nav-section-title:hover .nav-section-toggle {
    color: #3b82f6;
}

.nav-section-content {
    animation: slideDown 0.2s ease-out;
    padding: 0;
    margin-bottom: 0.5rem;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
    }
    to {
        opacity: 1;
        max-height: 500px;
    }
}

.nav-item {
    font-size: 0.85rem;
    padding: 0;
    margin-bottom: 0.15rem;
}

.nav-item ::deep a {
    color: #cbd5e1;
    border-radius: 6px;
    min-height: 2.5rem;
    display: flex;
    align-items: center;
    padding: 0.65rem 1rem;
    transition: all 0.2s;
    font-weight: 500;
    gap: 0.75rem;
    margin: 0 0.5rem 0.35rem 0.5rem;
    position: relative;
    line-height: 1.5;
    background: rgba(15, 20, 25, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(8px);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    text-decoration: none;
    cursor: pointer;
}

.nav-icon {
    font-size: 1.1rem;
    width: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    vertical-align: middle;
    flex-shrink: 0;
}

/* Individual icon files */
.nav-icon-world-map {
    background-image: url('/images/icons/world-map.webp');
}

.nav-icon-diplomacy {
    background-image: url('/images/icons/diplomacy.webp');
}

.nav-icon-government {
    background-image: url('/images/icons/government.webp');
}

.nav-icon-battlefronts {
    background-image: url('/images/icons/battle-icon.webp');
}

.nav-icon-production {
    background-image: url('/images/icons/production.webp');
}

.nav-icon-logistics {
    background-image: url('/images/icons/logistics.webp');
}

.nav-icon-military-production {
    background-image: url('/images/icons/military-production.webp');
}

.nav-icon-unit-designer {
    background-image: url('/images/icons/generalHQ-icon.webp');
}

.nav-icon-personnel {
    background-image: url('/images/icons/personnel.webp');
}

.nav-icon-communications {
    background-image: url('/images/icons/communications.webp');
}

.nav-icon-research {
    background-image: url('/images/icons/research.webp');
}

.nav-icon-settings {
    background-image: url('/images/icons/settings.webp');
}

.nav-text {
    flex: 1;
}

.nav-item ::deep a.active {
    background: rgba(59, 130, 246, 0.25);
    border: 1px solid rgba(59, 130, 246, 0.4);
    border-left: 3px solid #3b82f6;
    color: #60a5fa;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.nav-item ::deep a:hover:not(.active) {
    background: rgba(59, 130, 246, 0.15);
    border-color: rgba(59, 130, 246, 0.3);
    color: #e2e8f0;
    box-shadow: 0 2px 6px rgba(59, 130, 246, 0.2);
    transform: translateY(-1px);
}

.nav-threat-warning {
    position: absolute;
    bottom: 1rem;
    left: 0.5rem;
    right: 0.5rem;
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.4);
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.threat-warning-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.threat-warning-text {
    flex: 1;
}

.threat-warning-label {
    color: #ef4444;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 0.25rem;
}

.threat-warning-value {
    color: #ef4444;
    font-size: 1.1rem;
    font-weight: 900;
    letter-spacing: 0.05em;
}

@media (min-width: 641px) {
    .navbar-toggler {
        display: none;
    }

    .collapse {
        /* Never collapse the sidebar for wide screens */
        display: block !important;
    }
    
    .nav-scrollable {
        overflow-y: auto;
        height: calc(100vh - 3.5rem);
        padding: 0.75rem 0;
        position: relative;
        padding-bottom: 120px;
    }
    
    /* Ensure sidebar is always visible on desktop */
    .sidebar {
        display: flex !important;
        flex-direction: column;
    }
}

.sidebar-header {
    background-color: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.page {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-color: transparent;
    z-index: 1;
}

main {
    flex: 1;
    background-color: transparent;
}

.sidebar {
    background: rgba(20, 25, 35, 0.65);
    backdrop-filter: blur(15px);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3);
    position: relative;
}

.top-row {
    background: linear-gradient(180deg, rgba(26, 31, 46, 0.95) 0%, rgba(15, 20, 25, 0.95) 100%);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(59, 130, 246, 0.25);
    justify-content: flex-end;
    height: 3.5rem;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.top-row ::deep a, .top-row ::deep .btn-link {
    white-space: nowrap;
    margin-left: 1.5rem;
    text-decoration: none;
    color: #e0e6ed;
}

.top-row ::deep a:hover, .top-row ::deep .btn-link:hover {
    text-decoration: underline;
    color: #fbbf24;
}

.top-row ::deep a:first-child {
    overflow: hidden;
    text-overflow: ellipsis;
}

.top-row .navbar-brand {
    color: #e0e6ed;
    font-weight: 700;
}

.top-row .text-muted {
    color: #a0a8b8 !important;
    font-size: 0.9rem;
}

.top-row .btn-outline-danger {
    border-color: rgba(239, 68, 68, 0.5);
    color: #ef4444;
    font-size: 0.85rem;
    padding: 0.4rem 0.75rem;
}

.top-row .btn-outline-danger:hover {
    background-color: rgba(239, 68, 68, 0.2);
    border-color: #ef4444;
    color: #ef4444;
}

.content {
    background-color: transparent;
    color: #e0e6ed;
    position: relative;
    z-index: 1;
}

@media (max-width: 640.98px) {
    .top-row {
        justify-content: space-between;
    }

    .top-row ::deep a, .top-row ::deep .btn-link {
        margin-left: 0;
    }

    .nav-threat-warning {
        position: relative;
        bottom: auto;
        left: auto;
        right: auto;
        margin: 1rem 0.5rem;
    }

    .nav-scrollable {
        padding-bottom: 0;
    }
}

@media (min-width: 641px) {
    .page {
        flex-direction: row;
    }

    .sidebar {
        width: 260px;
        height: 100vh;
        position: sticky;
        top: 0;
    }

    .top-row {
        position: sticky;
        top: 0;
        z-index: 1;
    }

    main > div {
        padding-left: 1.5rem !important;
        padding-right: 1.5rem !important;
    }

    .content {
        padding: 1rem 1.5rem !important;
    }
}

/* Nav divider */
.nav-scrollable hr {
    border-color: rgba(255, 255, 255, 0.1) !important;
    margin: 0.5rem 0.75rem !important;
}
