/* ==================== */
/* === CSS ПЕРЕМЕННЫЕ === */
/* ==================== */
:root {
    --bs-nav-tabs-border-color: #bc9c25 !important;
}

/* ==================== */
/* === НАВИГАЦИЯ ======= */
/* ==================== */

.logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.site-name {
    font-family: var(--font-family-heading);
    font-weight: var(--font-weight-semi);
    font-size: var(--font-size-3xl);
    color: var(--nexus-white);
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
    letter-spacing: var(--letter-spacing-wide);
    transition: var(--transition);
    min-width: 250px;
    display: inline-block;
    padding: 0;
    margin: 0;
    line-height: 1.2;
    align-self: center;
}

.site-name:hover {
    color: var(--nexus-orange-hover);
}

.nav-links {
    gap: var(--spacing-sm);
}

.user-actions {
    gap: var(--spacing-sm);
}

.profile-link {
    display: inline-flex;
    align-items: center;
    color: var(--nexus-text-light) !important;
}

.header-avatar {
    width: var(--avatar-size);
    height: var(--avatar-size);
    border: var(--border-width-avatar) solid var(--nexus-orange-hover);
    border-radius: 50%;
}

/* ==================== */
/* === FLASH СООБЩЕНИЯ === */
/* ==================== */

#flash-messages {
    position: fixed;
    top: 20px;
    right: 30px;
    z-index: var(--z-index-flash);
    max-width: var(--flash-max-width);
    width: calc(100% - 30px);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#flash-messages .alert {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #ffffff;
    font-size: 0.95rem;
    padding: 1rem var(--spacing-md);
    border-left: 4px solid;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4), 0 0 20px rgba(0, 0, 0, 0.2);
    animation: slide-in 0.4s ease;
    font-weight: 500;
    position: relative;
    overflow: hidden;
}

#flash-messages .alert::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: rgba(255, 255, 255, 0.2);
    z-index: 1;
}

#flash-messages .alert i {
    font-size: 1.2rem;
    flex-shrink: 0;
    z-index: 2;
}

#flash-messages .alert .btn-close {
    flex-shrink: 0;
    opacity: 1;
    transition: opacity 0.2s ease;
    z-index: 2;
    filter: invert(1) brightness(1.2);
}

#flash-messages .alert .btn-close:hover,
#flash-messages .alert .btn-close:focus {
    opacity: 1;
}

#flash-messages .alert .btn-close::after {
    background-color: #ffffff !important;
}

#flash-messages .alert .btn-close-white {
    filter: invert(1) brightness(1.2) !important;
}

/* Светлые фоны для разных типов */
.alert-success {
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.25), rgba(40, 167, 69, 0.15));
    border-left-color: var(--success-light);
}

.alert-danger {
    background: linear-gradient(135deg, rgba(220, 53, 69, 0.25), rgba(220, 53, 69, 0.15));
    border-left-color: var(--danger);
}

.alert-info {
    background: linear-gradient(135deg, rgba(23, 162, 184, 0.25), rgba(23, 162, 184, 0.15));
    border-left-color: var(--info);
}

.alert-warning {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.25), rgba(255, 193, 7, 0.15));
    border-left-color: #ffc107;
}

@keyframes slide-in {
    from { 
        opacity: 0; 
        transform: translateY(-20px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

/* === NAV TABS BORDER === */
.nav-tabs {
    max-width: max-content;
    border-bottom: 0px
}

/* nav-link active для вкладок */
.nav-tabs .nav-link.active {
    background: var(--nexus-gold, #f0c040) !important;
    color: #000 !important;
    border-bottom: 3px solid #23232a !important;
    font-weight: 700;
}
.nav-tabs .nav-link {
    color: var(--nexus-gold, #f0c040) !important;
    background: transparent !important;
    border: none !important;
    font-family: var(--font-family-heading, Rajdhani, sans-serif);
    font-weight: 600;
    letter-spacing: .03em;
    border-bottom: 3px transparent;
}
.nav-tabs .nav-link:hover {
    background: rgba(255,255,255,.08)!important;
    color: #fff!important;
    border-radius: calc(0.7 * .4em) calc(0.7 * .4em) 0 0;
    text-decoration: none;
    transition: background .18s, color .18s;
    border-bottom: 3px solid #f0c040!important;
}

/* Адаптивность */
@media (max-width: 768px) {
    .site-name {
        font-size: var(--font-size-2xl);
        min-width: auto;
    }
    
    #flash-messages {
        right: var(--spacing-sm);
        width: calc(100% - var(--spacing-md));
    }

    /* Mobile nav tweaks: allow wrapping and center nav links */
    .nav-links {
        display: flex;
        flex-wrap: wrap;
        gap: 0.4rem;
        justify-content: center;
        align-items: center;
    }

    /* Make logo smaller and centered on narrow screens */
    .logo-link img {
        max-width: 56px;
        height: auto;
    }

    /* Reduce header avatar on small screens */
    .header-avatar {
        width: 36px;
        height: 36px;
    }
}
