/* navbar.css - Tutti gli stili della navbar */
:root {
    --navbar-height: 70px;
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --text-color: white;
    --dropdown-bg: #f9f9f9;
    --excel-color: #217346;
    --pdf-color: #f40f02;
    --data-color: #ff9800;
    --utility-color: #9c27b0;
    --iot-color: #2196f3;
    --images-color: #ac9817;
    --strategy-color: #5e4515;
}

/* Reset per elementi della navbar */
.navbar * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Navbar principale */
.navbar {
    background-color: var(--primary-color);
    padding: 1rem 2rem;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    height: var(--navbar-height);
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 100%;
    margin: 0;
}

/* Logo section - container for logo and tagline */
.logo-section {
    display: flex;
    align-items: center;
    margin-right: auto;
}

/* Contenitore dei link */
.nav-links {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 1.5rem;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 0 20px;
}

/* Link standard */
.nav-link {
    color: var(--text-color);
    text-decoration: none;
    font-size: 1.1rem;
    padding: 0.5rem 1rem;
    transition: all 0.3s ease;
    background: none;
    border: none;
    cursor: pointer;
    font-family: Arial, sans-serif;
}

.nav-link:hover {
    color: var(--secondary-color);
}

/* Pulsante menu mobile */
.mobile-menu-toggle {
    display: none;
    background: none !important;
    border: none !important;
    color: var(--text-color) !important;
    font-size: 1.8rem;
    cursor: pointer;
    padding: 0.5rem !important;
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1001;
    margin: 0 !important;
    width: auto !important;
}

/* Dropdown progetti */
.projects-dropdown {
    position: relative;
    display: inline-block;
}

.projects-dropdown-content {
    display: none;
    position: absolute;
    background-color: var(--dropdown-bg);
    min-width: 800px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 1;
    border-radius: 8px;
    padding: 20px;
    left: 50%;
    transform: translateX(-50%);
    max-height: 80vh;
    overflow-y: auto;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.dropdown-category-container {
    display: flex;
    flex-direction: column;
}

.dropdown-category {
    padding: 10px;
    margin: 0 0 10px 0;
    border-radius: 5px;
    font-size: 1rem;
    font-weight: bold;
    color: var(--text-color);
    text-align: center;
}

.excel-category {
    background-color: var(--excel-color);
}

.pdf-category {
    background-color: var(--pdf-color);
}

.data-category {
    background-color: var(--data-color);
}

.images-category {
    background-color: var(--images-color);
}

.utility-category {
    background-color: var(--utility-color);
}

.iot-category {
    background-color: var(--iot-color);
}

.strategy-category {
    background-color: var(--strategy-color);
}

.projects-dropdown-content a {
    color: var(--primary-color);
    padding: 10px;
    text-decoration: none;
    display: block;
    font-size: 0.9rem;
    transition: all 0.3s;
    border-radius: 5px;
    margin-bottom: 5px;
}

.projects-dropdown-content a:hover {
    background-color: var(--secondary-color);
    color: var(--text-color);
    transform: translateX(5px);
}

.logo-link {
    display: flex;
    align-items: flex-start;
    padding: 0 10px;
    position: relative;
    z-index: 1001;
    margin-right: 0;
}

.navbar-logo {
    height: 130px;
    max-width: 350px;
    object-fit: contain;
    border-radius: 50%;
    box-shadow: 0 8px 15px rgba(0,0,0,0.3);
    background: radial-gradient(circle, rgba(255,255,255,1) 65%, rgba(255,255,255,0) 100%);
    padding: 5px;
    margin-top: 70px;
    transition: transform 0.3s ease;
}

.logo-link:hover .navbar-logo {
    transform: translateY(3px);
}

/* Site tagline styles */
.site-tagline {
    display: flex;
    flex-direction: column;
    margin-right: 20px;
    color: var(--text-color);
    line-height: 1.2;
}

.site-name {
    font-size: 1.3rem;
    font-weight: bold;
    color: var(--secondary-color);
}

.tagline-text {
    font-size: 0.9rem;
    font-style: italic;
}

/* Stili responsive */
@media (min-width: 769px) {
    .nav-links {
        padding: 0 40px;
    }
    .projects-dropdown-content {
        min-width: 600px;
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .nav-links {
        gap: 1rem;
    }
    
    .nav-link {
        font-size: 1rem;
        padding: 1rem;
    }
    
    .projects-dropdown-content {
        min-width: 450px;
        grid-template-columns: repeat(2, 1fr);
    }
    
    .site-tagline {
        margin-right: 10px;
    }
    
    .site-name {
        font-size: 1.1rem;
    }
    
    .tagline-text {
        font-size: 0.8rem;
    }
}

/* Changed from 580px to 700px */
@media (max-width: 700px) {
    .navbar {
        padding: 1rem 1rem 1rem 60px;
        justify-content: space-between;
    }
    
    .nav-links {
        padding: 0 10px;
    }
    
    .projects-dropdown-content {
        width: 95vw;
        left: 2.5vw;
        min-width: unset;
    }
    
    .project-card {
        min-height: auto;
        padding-bottom: 5rem;
    }
    
    .project-card p {
        margin-bottom: 2.5rem;
    }
    
    .project-card .btn {
        position: relative;
        bottom: auto;
        left: auto;
        margin-top: 1rem;
        display: block;
        width: 100%;
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    .nav-links {
        display: none;
        flex-direction: column;
        position: absolute;
        top: var(--navbar-height);
        left: 0;
        width: 100%;
        background-color: var(--primary-color);
        padding: 1rem 0;
    }
    
    .nav-links.active {
        display: flex;
    }
    
    .nav-link {
        width: 100%;
        text-align: center;
        padding: 1rem;
    }
    
    .projects-dropdown {
        width: 100%;
        text-align: center;
    }
    
    .projects-dropdown-content {
        display: none;
        position: static;
        width: 100%;
        box-shadow: none;
        transform: none;
        left: auto;
        min-width: unset;
        padding: 10px;
        grid-template-columns: 1fr;
        max-height: 70vh;
        overflow-y: auto;
        margin-bottom: 60px;
    }
    
    .projects-dropdown.active .projects-dropdown-content {
        display: flex !important;
        flex-direction: column;
    }
    
    .navbar-logo {
        height: 90px;
        max-width: 220px;
        margin-top: 30px;
    }
    
    .site-tagline {
        margin-left: 10px;
        margin-right: 5px;
    }
    
    .site-name {
        font-size: 1rem;
    }
    
    .tagline-text {
        font-size: 0.7rem;
    }
}

@media (max-width: 580px) {
    .site-tagline {
        margin-right: 5px;
    }
}

@media (max-width: 480px) {
    .site-tagline {
        max-width: 120px;
    }
}

@media (min-width: 481px) and (max-width: 768px) {
    .project-card {
        min-height: 280px;
        padding-bottom: 5rem;
    }
    
    .project-card p {
        margin-bottom: 1.5rem;
        min-height: 120px;
    }
    
    .project-card .btn {
        position: absolute;
        bottom: 1.5rem;
        left: 1.5rem;
        right: 1.5rem;
        width: calc(100% - 3rem);
        text-align: center;
        padding: 0.8rem;
        box-sizing: border-box;
    }
}

/* Changed from 481px to 701px to match new breakpoint */
@media (min-width: 701px) {
    .projects-dropdown:hover .projects-dropdown-content {
        display: grid;
    }
}

/* Regola per il body */
body {
    padding-top: var(--navbar-height) !important;
}

/* Prevenire overflow orizzontale */
html, body {
    overflow-x: hidden;
    width: 100%;
}