/* Main Layout Container */
.main-system {
    display: flex;
    min-height: 100vh;
    padding-top: 70px;
}

/* Navbar Layout */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 40px;
    height: 80px;
    background: var(--glass-bg) !important;
    backdrop-filter: var(--glass-blur) !important;
    border-bottom: 1.5px solid var(--glass-border) !important;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    /* Allow wrapping if needed */
    justify-content: flex-end;
    max-width: 60%;
    /* Ensure it doesn't push the logo out of screen */
}

/* Hide some text or scale down icons for small screens to prevent overlap */
@media (max-width: 1200px) {

    #system-clock,
    #userName {
        display: none !important;
    }
}


.logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo img {
    height: 45px;
    filter: drop-shadow(0 0 12px var(--accent-gold));
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.main-title {
    font-size: 1.4rem;
    font-weight: 800;
    color: #ffd700;
    letter-spacing: 1px;
    text-shadow: 0 0 10px rgba(212, 175, 55, 0.4);
}

.sub-title {
    font-size: 0.72rem;
    color: var(--text-secondary);
    letter-spacing: 0.8px;
    font-weight: 600;
    text-transform: uppercase;
    opacity: 0.8;
}

/* Sidebar Layout */
.sidebar {
    width: 280px;
    height: calc(100vh - 80px);
    position: fixed;
    top: 80px;
    left: 0;
    background: var(--glass-bg) !important;
    backdrop-filter: var(--glass-blur) !important;
    border-right: 1.5px solid var(--glass-border) !important;
    box-shadow: 20px 0 50px rgba(0, 0, 0, 0.3);
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1), width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 999;
    overflow-x: hidden;
    overflow-y: auto;
}

.sidebar.collapsed {
    width: 80px;
    transform: translateX(0);
}

.sidebar.collapsed .sidebar-header h3,
.sidebar.collapsed .sidebar-header #sidebar-masofa-badge span,
.sidebar.collapsed .sidebar-header #changeMasofaBtn,
.sidebar.collapsed .sidebar-menu li span {
    display: none !important;
}

.sidebar.collapsed .sidebar-header {
    padding: 25px 0;
    text-align: center;
    display: flex;
    justify-content: center;
}

.sidebar.collapsed .sidebar-menu li {
    padding: 15px 0;
    justify-content: center;
    margin: 10px 10px;
}

.sidebar.collapsed .sidebar-menu li i {
    font-size: 1.4rem;
    margin: 0;
}

.sidebar-header {
    border-bottom: 1px solid var(--glass-border);
    padding: 25px 20px 25px 75px !important;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--accent-gold);
    font-weight: 800;
    text-shadow: 0 0 15px rgba(212, 175, 55, 0.4);
    min-height: 80px;
}

.sidebar-menu {
    list-style: none;
    padding: 10px 0;
}

.sidebar-menu li {
    border-radius: 12px;
    margin: 10px 18px;
    padding: 15px 24px;
    transition: var(--transition-premium);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 15px;
    color: var(--text-primary);
    border: 1px solid transparent;
    font-weight: 600;
}

.sidebar-menu li:hover {
    background: rgba(212, 175, 55, 0.1) !important;
    color: var(--accent-gold);
    transform: translateX(10px) scale(1.02);
    border-color: rgba(212, 175, 55, 0.3);
}

.sidebar-menu li.active {
    background: linear-gradient(90deg, rgba(212, 175, 55, 0.2), rgba(212, 175, 55, 0.05)) !important;
    border-left: 5px solid var(--accent) !important;
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.15);
    color: var(--accent-gold);
}

/* Main Content Area */
.content {
    flex: 1;
    margin-left: 280px;
    padding: 3rem;
    background: transparent;
    min-height: calc(100vh - 80px);
    transition: margin-left 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar.collapsed+.content {
    margin-left: 80px;
}

/* Sidebar Floating Toggle Button */
.sidebar-floating-toggle {
    position: absolute;
    top: 15px;
    left: 20px;
    width: 40px;
    height: 40px;
    background: var(--gold-gradient);
    border: none;
    border-radius: 50%;
    color: black;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.5);
    transition: var(--transition-premium);
    z-index: 1001;
    animation: sidebarPulse 2s infinite;
}

.sidebar-floating-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 0 30px var(--neon-gold);
}

@keyframes sidebarPulse {
    0% {
        box-shadow: 0 0 10px rgba(212, 175, 55, 0.5);
    }

    50% {
        box-shadow: 0 0 25px rgba(212, 175, 55, 0.8);
    }

    100% {
        box-shadow: 0 0 10px rgba(212, 175, 55, 0.5);
    }
}

/* Rotate icon on toggle */
.rotate-icon {
    transform: rotate(180deg);
}

.sidebar-header i {
    transition: transform 0.4s ease;
}

/* Background Decorations */
.background-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    overflow: hidden;
    pointer-events: none;
}

.railway-logo {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 300px;
    height: 300px;
    opacity: 0.08;
    background-size: contain;
    animation: logoFloat 20s infinite ease-in-out;
}

.moving-train {
    position: absolute;
    bottom: 10%;
    width: 120px;
    height: 60px;
    background: linear-gradient(90deg, #334155, #475569);
    border-radius: 10px;
    animation: trainMove 25s linear infinite;
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.4);
}

.rail-tracks {
    position: absolute;
    bottom: 8%;
    width: 100%;
    height: 4px;
    background: repeating-linear-gradient(90deg, transparent, transparent 20px, #ffd700 20px, #ffd700 40px);
    animation: trackMove 1s linear infinite;
}