/* ============ HAMBURGER MENU STYLES ============ */

.hamburger-menu {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
}

.hamburger-button {
    width: 36px; /* Smaller on desktop */
    height: 36px;
    border: none;
    background: rgba(10, 18, 32, 0.75);
    backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 8px;
    transition: all 0.3s ease;
}

.hamburger-button:hover {
    background: rgba(10, 18, 32, 0.85);
    border-color: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.hamburger-line {
    width: 16px; /* Smaller lines */
    height: 2px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 1px;
    transition: all 0.3s ease;
}

.hamburger-button.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(4px, 4px);
}

.hamburger-button.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.hamburger-button.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Dropdown Menu */
.hamburger-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 130px !important; /* ПРИНУДИТЕЛЬНО узкая ширина */
    min-width: 130px !important;
    max-width: 130px !important;
    background: rgba(10, 18, 32, 0.75);
    backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 8px 0;
    transform: translateY(-10px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.hamburger-dropdown.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}

.hamburger-menu-item {
    display: block;
    padding: 10px 8px; /* Уменьшаем боковые отступы чтобы текст поместился */
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 12px; /* Меньше шрифт чтобы поместился */
    font-weight: 400;
    transition: all 0.2s ease;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    white-space: nowrap; /* Prevent text wrapping */
    overflow: hidden; /* Обрезаем если не помещается */
    text-overflow: ellipsis; /* Добавляем ... если не помещается */
}

.hamburger-menu-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 1);
    padding-left: 12px; /* Меньше hover эффект */
}

.hamburger-menu-item:first-child {
    border-radius: 12px 12px 0 0;
}

.hamburger-menu-item:last-child {
    border-radius: 0 0 12px 12px;
}

/* Desktop-specific - compress WIDTH, not height */
@media (min-width: 769px) {
    .hamburger-menu-item {
        padding-left: 8px !important; /* Меньше отступ слева */
        padding-right: 8px !important; /* Меньше отступ справа */
        font-size: 12px !important; /* Чуть меньше шрифт для экономии ширины */
    }
    
    .hamburger-menu-item:hover {
        padding-left: 12px !important; /* Меньше hover отступ */
    }
}

/* Mobile Styles */
@media (max-width: 768px) {
    .hamburger-menu {
        top: 6px;
        right: 6px;
    }
    
    .hamburger-button {
        width: 30px; /* Compact mobile size */
        height: 30px;
        border-radius: 8px;
        padding: 5px;
        gap: 2px;
    }
    
    .hamburger-line {
        width: 14px;
        height: 1.5px;
    }
    
    .hamburger-dropdown {
        width: auto; /* Auto width on mobile too */
        min-width: auto;
        max-width: none;
        right: 0;
        top: calc(100% + 4px);
        border-radius: 10px;
        padding: 4px 0;
    }
    
    .hamburger-menu-item {
        padding: 8px 12px;
        font-size: 12px;
    }
    
    .hamburger-menu-item:hover {
        padding-left: 16px;
    }
}

/* Narrow mobile screens */
@media (max-width: 400px) {
    .hamburger-button {
        width: 26px;
        height: 26px;
        border-radius: 6px;
        padding: 4px;
        gap: 1.5px;
    }
    
    .hamburger-line {
        width: 12px;
        height: 1.5px;
    }
    
    .hamburger-dropdown {
        width: auto;
        min-width: auto;
        max-width: none;
        border-radius: 8px;
        padding: 3px 0;
    }
    
    .hamburger-menu-item {
        padding: 6px 10px;
        font-size: 11px;
    }
    
    .hamburger-menu-item:hover {
        padding-left: 14px;
    }
}

/* Desktop wide screens */
@media (min-width: 1200px) {
    .hamburger-dropdown {
        min-width: 25vw;
        max-width: 320px;
    }
}

/* Overlay for mobile to close menu when clicking outside */
.hamburger-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.hamburger-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ============ END OF HAMBURGER MENU STYLES ============ */

/* ============ MODAL STYLES FOR MENU CONTENT ============ */

.menu-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.menu-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.menu-modal {
    background: rgba(10, 18, 32, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 24px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    color: white;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.menu-modal-overlay.active .menu-modal {
    transform: scale(1);
}

.menu-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 16px;
}

.menu-modal-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.menu-modal-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 28px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.menu-modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 1);
}

.menu-modal-content {
    line-height: 1.6;
}

.menu-modal-content h3 {
    color: #667eea;
    margin-top: 20px;
    margin-bottom: 12px;
    font-size: 18px;
}

.menu-modal-content h3:first-child {
    margin-top: 0;
}

.menu-modal-content p {
    margin-bottom: 16px;
    color: rgba(255, 255, 255, 0.9);
}

.menu-modal-content a {
    color: #667eea;
    text-decoration: none;
    transition: color 0.2s ease;
}

.menu-modal-content a:hover {
    color: #764ba2;
    text-decoration: underline;
}

/* Mobile modal styles */
@media (max-width: 768px) {
    .menu-modal {
        padding: 16px;
        max-width: 95%;
        border-radius: 12px;
    }
    
    .menu-modal-header h2 {
        font-size: 20px;
    }
    
    .menu-modal-close {
        font-size: 24px;
        width: 28px;
        height: 28px;
    }
    
    .menu-modal-content h3 {
        font-size: 16px;
    }
}

/* ============ END OF MODAL STYLES ============ */

/* For very narrow screens - prevent overflow */
@media (max-width: 320px) {
    .hamburger-dropdown {
        max-width: calc(100vw - 20px); /* Prevent overflow on tiny screens */
        right: 10px; /* Add some margin from edge */
    }
    
    .hamburger-menu-item {
        font-size: 10px;
        padding: 5px 8px;
    }
}
