.nav-container {
    position: relative;
}

.nav-toggle {
    background: linear-gradient(135deg, rgba(95, 30, 148, 1), rgba(60, 20, 100, 1)) !important;
    color: white !important;
    border: 2px solid rgba(95, 30, 148, 1) !important;
    border-radius: 25px;
    padding: 10px 25px;
    font-size: 16px;
    cursor: pointer;
    margin-right: 15px;
    transition: all 0.3s ease;
    font-family: inherit;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.8) !important;
    backdrop-filter: blur(4px);
}

.nav-toggle:hover {
    background: linear-gradient(135deg, rgba(120, 40, 180, 1), rgba(95, 30, 148, 1)) !important;
    border-color: rgba(120, 40, 180, 1) !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(154, 40, 251, 0.6) !important;
}

.nav-panel {
    position: fixed !important;
    top: -500px !important;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, rgba(20, 10, 30, 0.98), rgba(40, 15, 70, 0.98)) !important;
    border: 2px solid rgba(95, 30, 148, 1) !important;
    border-radius: 0 0 15px 15px;
    z-index: 1100 !important;
    padding: 20px;
    transition: all 0.5s ease-in-out !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.9) !important;
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(10px) !important;
    visibility: hidden;
    opacity: 0;
}

.nav-panel.nav-open {
    top: 70px !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.nav-links {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* Create 3 equal columns */
    gap: 10px; /* Space between buttons */
    margin-top: 15px;
    padding: 10px;
    background: rgb(0, 0, 0) !important;
    border-radius: 10px;
    border: 1px solid rgba(95, 30, 148, 0.5);
}

.nav-links a {
    color: white !important;
    text-decoration: none;
    padding: 12px 8px; /* Increased padding for better clickability */
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    border-radius: 10px;
    background: linear-gradient(145deg, rgba(95, 30, 148, 0.95), rgba(60, 20, 100, 1)) !important;
    border: 2px solid rgba(95, 30, 148, 0.8) !important;
    transition: all 0.3s ease;
    font-size: 14px; /* Zmniejszony rozmiar czcionki */
    font-weight: 600;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.7) !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9) !important;
    backdrop-filter: blur(4px);
    position: relative;
    overflow: hidden;
    min-height: 45px; /* Increased minimum height */
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-links a::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(95, 30, 148, 0.9);
    z-index: -1;
    border-radius: 8px;
}

.nav-links a:hover {
    background: linear-gradient(145deg, rgba(120, 40, 180, 1), rgba(95, 30, 148, 1)) !important;
    border-color: rgba(120, 40, 180, 1) !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(154, 40, 251, 0.8) !important;
    color: white !important;
}

.nav-links a:hover::before {
    background: rgba(120, 40, 180, 1);
}

.nav-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 2px solid rgba(95, 30, 148, 0.5);
    padding-bottom: 15px;
    position: relative;
}

.nav-header::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(to right, 
        transparent 0%, 
        rgba(180, 100, 255, 0.6) 20%, 
        rgba(180, 100, 255, 0.6) 80%, 
        transparent 100%);
}

.nav-title {
    color: white;
    font-size: 24px;
    margin: 0;
    font-weight: bold;
    letter-spacing: 1px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    background: linear-gradient(to right, #a855f7, #8b5cf6);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.nav-close {
    background: none;
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: all 0.3s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-close:hover {
    background-color: rgba(95, 30, 148, 0.3);
    color: #ff4757;
    transform: scale(1.1);
    color: rgba(95, 30, 148, 0.8);
}

/* Navigation panel menu styling */
#nav-panel {
    /* ...existing code... */
}

/* Make buttons display in a horizontal grid layout instead of stacked vertically */
#nav-panel .nav-content {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 10px;
    padding: 20px;
}

/* Style individual navigation buttons */
#nav-panel a {
    flex: 0 0 auto;
    min-width: 120px;
    margin: 5px;
    text-align: center;
}

/* Special styling for the "About Us" link to center it */
.about-us-link {
    grid-column: 2; /* Position in the middle column */
    justify-self: center; /* Center within its grid cell */
    min-width: 200px; /* Ensure it has enough width */
}

/* Adjust responsive layouts */
@media (max-width: 991px) and (min-width: 769px) {
    .about-us-link {
        grid-column: 2; /* Keep in middle column for medium screens */
    }
}

@media (max-width: 768px) {
    .about-us-link {
        grid-column: 1 / span 2; /* Span across both columns on small screens */
    }
}

@media (max-width: 480px) {
    .about-us-link {
        grid-column: 1 / span 2; /* Span across both columns on very small screens */
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    #nav-panel .nav-content {
        gap: 8px;
    }
    
    #nav-panel a {
        min-width: 100px;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    #nav-panel .nav-content {
        gap: 5px;
    }
    
    #nav-panel a {
        min-width: 85px;
        font-size: 0.85rem;
    }
}

/* Responsywność - dostosowana do układu 3 kolumn */
@media (min-width: 992px) {
    .nav-links {
        grid-template-columns: repeat(2, 1fr) !important; /* 3 kolumny na dużych ekranach */
        gap: 10px;
        max-width: 800px; /* Zmniejszona szerokość dla kompaktowości */
        margin: 15px auto 0 auto; /* Centruje siatkę */
    }
}

@media (min-width: 1200px) {
    .nav-links {
        grid-template-columns: repeat(2, 1fr) !important; /* 3 kolumny na dużych ekranach */
        gap: 10px;
        max-width: 800px; /* Zmniejszona szerokość dla kompaktowości */
        margin: 15px auto 0 auto; /* Centruje siatkę */
    }
}

/* Na średnich ekranach nadal 3 kolumny ale mniejsze */
@media (max-width: 991px) and (min-width: 769px) {
    .nav-links {
        grid-template-columns: repeat(2, 1fr) !important; /* 3 kolumny na dużych ekranach */
        gap: 10px;
        max-width: 800px; /* Zmniejszona szerokość dla kompaktowości */
        margin: 15px auto 0 auto; /* Centruje siatkę */
    }
    
    .nav-links a {
        padding: 8px 12px;
        font-size: 13px;
    }
}

/* Na małych ekranach 2 kolumny */
@media (max-width: 768px) {
    .nav-links {
        grid-template-columns: repeat(2, 1fr) !important; /* 3 kolumny na dużych ekranach */
        gap: 10px;
        max-width: 800px; /* Zmniejszona szerokość dla kompaktowości */
        margin: 15px auto 0 auto; /* Centruje siatkę */
    }
    
    .nav-links a {
        padding: 10px 12px;
        font-size: 14px;
    }
}

/* Na bardzo małych ekranach 1 kolumna */
@media (max-width: 480px) {
    .nav-links {
        grid-template-columns: repeat(2, 1fr) !important; /* 3 kolumny na dużych ekranach */
        gap: 10px;
        max-width: 800px; /* Zmniejszona szerokość dla kompaktowości */
        margin: 15px auto 0 auto; /* Centruje siatkę */
    }
    
    .nav-links a {
        padding: 8px 10px;
        font-size: 13px;
    }
}

/* Hide menu button on desktop screens */
@media (min-width: 1024px) {
    .nav-toggle {
        display: none !important;
    }
    
    .nav-panel {
        display: none !important;
    }
}

/* Show menu button only on tablets and mobile */
@media (max-width: 1023px) {
    .nav-toggle {
        display: block;
    }
}
