
.matrix-bg {
    background: linear-gradient(135deg, #0d1117 0%, #161b22 100%);
}

.matrix-text {
    background: linear-gradient(45deg, #00ff41, #00d4ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.glass-effect {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.dark .glass-effect {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(0, 255, 65, 0.2);
}

.terminal-cursor::after {
    content: '|';
    animation: blink 1s infinite;
}
@keyframes blink {
    50% {
        opacity: 0;
    }
}
.matrix-grid {
    background-image: 
        linear-gradient(rgba(0, 255, 65, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 255, 65, 0.1) 1px, transparent 1px);
    background-size: 20px 20px;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #161b22;
}

::-webkit-scrollbar-thumb {
    background: #00ff41;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #00d4ff;
}

/* Mobile optimization fixes */
@media (max-width: 640px) {
    /* Prevent horizontal scroll */
    body {
        overflow-x: hidden;
        width: 100%;
        max-width: 100vw;
    }
    
    /* Ensure all containers respect viewport width */
    * {
        max-width: 100%;
        box-sizing: border-box;
    }
    
    /* Ensure navbar content fits */
    nav .flex {
        min-width: 0;
    }
    
    /* Improve button sizing on mobile */
    nav button {
        min-width: 40px;
        min-height: 40px;
    }
    
    /* Ensure proper text truncation */
    .truncate {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    
    /* Better button spacing on mobile */
    .matrix-btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .flex.flex-col.sm\:flex-row .matrix-btn {
        width: auto;
        flex: 1;
        min-width: 0;
    }
}

/* Extra small devices */
@media (max-width: 475px) {
    /* Further reduce padding on very small screens */
    nav .max-w-7xl {
        padding-left: 8px;
        padding-right: 8px;
    }
    
    /* Adjust font sizes */
    nav .matrix-text {
        font-size: 0.875rem;
    }
    
    /* Smaller buttons on very small screens */
    nav button {
        padding: 6px;
        min-width: 36px;
        min-height: 36px;
    }
    
    /* Stack buttons vertically on very small screens */
    .flex.flex-col.sm\:flex-row {
        flex-direction: column;
    }
    
    .flex.flex-col.sm\:flex-row .matrix-btn {
        width: 100%;
        margin-bottom: 0.75rem;
    }
}




/* Additional custom styles */
.nav-link {
    @apply text-gray-300 hover:text-matrix-green px-3 py-2 rounded-md text-sm font-medium transition-colors duration-200;
}

.mobile-nav-link {
    @apply text-gray-300 hover:text-matrix-green block px-3 py-2 rounded-md text-base font-medium transition-colors duration-200;
}

.matrix-btn {
    @apply px-4 xs:px-6 sm:px-8 py-3 xs:py-4 rounded-lg font-semibold text-sm xs:text-base sm:text-lg transition-all duration-300 inline-flex items-center justify-center min-w-0;
}

.matrix-btn.primary {
    @apply bg-gradient-to-r from-matrix-green to-neo-cyan text-black hover:shadow-lg hover:shadow-matrix-green/25 hover:scale-105;
}

.matrix-btn.secondary {
    @apply border-2 border-matrix-green text-matrix-green hover:bg-matrix-green hover:text-black;
}

.matrix-btn.tertiary {
    @apply bg-transparent border-2 border-neo-cyan text-neo-cyan hover:bg-neo-cyan hover:text-black;
}

.skill-tag {
    @apply px-3 py-1 bg-matrix-green bg-opacity-20 text-matrix-green rounded-full text-sm font-semibold;
}

.skill-bar {
    @apply w-full bg-gray-700 rounded-full h-2 overflow-hidden;
}

.skill-progress {
    @apply h-full bg-gradient-to-r from-matrix-green to-neo-cyan transition-all duration-1000 ease-out;
}

.research-card:hover .glass-effect {
    @apply shadow-lg shadow-matrix-green/20;
}

.tool-card:hover .glass-effect {
    @apply shadow-lg shadow-neo-cyan/20;
}

.academic-profile-btn {
    @apply px-6 py-3 glass-effect rounded-lg hover:bg-matrix-green hover:bg-opacity-20 transition-all duration-300 inline-flex items-center text-sm font-semibold hover:scale-105;
}

.contact-item {
    @apply flex items-center space-x-3 p-3 rounded-lg hover:bg-matrix-green hover:bg-opacity-10 transition-colors;
}

.social-btn {
    @apply p-3 glass-effect rounded-lg hover:bg-matrix-green hover:bg-opacity-20 transition-all duration-300 text-center hover:scale-105;
}

.footer-social-btn {
    @apply w-10 h-10 bg-gray-800 rounded-full flex items-center justify-center hover:bg-matrix-green hover:text-black transition-all duration-300;
}

.center{
    text-align: center;
}
.marginAuto{
    margin: auto;
}

.circular-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: translateX(10px) translateY(27px) scale(1.3); 
}
@media screen and (max-width: 640px) {
    .circular-image {
    transform: translateX(8px) translateY(18px) scale(1.3);
    }    
}
.circular-container {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    overflow: hidden; /* Nasconde le parti eccedenti */
    display: flex;
    align-items: center;
    justify-content: center;
}

.dblpLogo{
    width: 100%;
    height: 100%;
    background-image: url('../css/dblp.svg');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    color:antiquewhite;
}
.academicProfile{
    /* underline */
    color: #00ff41;
    font-weight: bold;
    font-size: 1.2rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;

}
.nav-link:hover {
    color: #00ff41;
    box-shadow: inset 0 -2px 0 #00ff41 ;

}


.academicProfile:hover {
    color: #9effcb;
}



.clickablePubItem {
    color:#00ff41;
}   
.clickablePubItem:hover {
    color: #00d4ff;
    transition: color 0.3s ease-in-out;
}



.yearPub{
    font-weight: bold;;
}
/*
insert border hr before yearPub*/

.yearPub::before {
    content: '';
    display: inline-block;
    width: 20px;
    height: 1px;
    background-color: #00ff41;
    margin-right: 10px;
    vertical-align: middle;
}
.yearPub::after {
    content: '';
    display: inline-block;
    width: 90%;
    height: 1px;
    background-color: #00ff41;
    margin-left: 10px;
    vertical-align: middle;
}



  #bib_sec {
        display: flex;
        flex-direction: column;
        gap: 1em;
    }

    .bibliography-table {
        width: 100%;
        border-collapse: collapse;
    }

    .bibliography-table td {
        padding: 0.5em;
        vertical-align: top;
    }
    
    .cell-type {    
        width: 22%;
    }

    .cell-buttons {
        width: auto;
    }

    .cell-details {
        width: auto;
    }

    .info_bib {
        display: flex;
        flex-direction: row;
        gap: 1em;
        align-items: center;
    }

    .box {
        width: 10px;
        height: 10px;
        border: 1px solid black;
        flex-shrink: 0;
    }


    .pub_title {
        font-weight: 600;
    }

    .pub_author {
        font-style: italic;
    }

    .entry_bib {
        display: flex;
        flex-direction: column;
    }

    #loader {
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        font-size: 1.5em;
    }



#publicationsContent .bg-gradient-to-t {
    display: block; /* Mostra la sfumatura solo quando il contenuto è limitato */
}

#publicationsContent.expanded .bg-gradient-to-t {
    display: none; /* Nasconde la sfumatura quando il contenuto è espanso */
}


/* Responsive Styles */
@media (max-width: 768px) {
    .bibliography-table, .bibliography-table tbody, .bibliography-table tr, .bibliography-table td {
        display: block;
        width: 100%;
    }

    .bibliography-table tr {
        margin-bottom: 1em;
        border: 1px solid #ddd;
        padding: 1em;
    }

    .bibliography-table td {
        border: none;
        padding-left: 0;
        padding-right: 0;
    }
    
    .cell-type, .cell-buttons, .cell-details {
        width: 100%;
    }

    .yearPub::after {
        width: 30%;
    }
    .yearPub::before {
        width: 30%;
    }
    .yearPub {
        text-align: center;
    }
    .yearRowBib{
        border:unset!important;

    }
}



/* Read More Toggle Button Styling - Enhanced */
#readMoreToggle {
    @apply mt-6 mx-auto block matrix-btn primary text-center;
    min-width: 200px;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

#readMoreToggle:hover {
    background-color: rgba(0, 255, 65, 0.1);
    color: #00ff41;
    box-shadow: 0 4px 15px rgba(0, 255, 65, 0.2);
    animation: subtle-pulse 2s infinite;
}

@keyframes subtle-pulse {
    0%, 100% {
        box-shadow: 0 4px 15px rgba(0, 255, 65, 0.2);
    }
    50% {
        box-shadow: 0 4px 20px rgba(0, 255, 65, 0.3);
    }
}

#readMoreToggle:hover {
    animation: none; /* Ferma l'animazione al hover */
}

/* Publications Content Styling */
#publicationsContent {
    max-height: 25rem;
    transition: max-height 2.5s ease-in-out, opacity 0.3s ease;
}

#publicationsContent:not(.expanded) {
    position: relative;
}

#publicationsContent.expanded {


}

#publicationsContent .bg-gradient-to-t {
    transition: opacity 0.3s ease;
}

#publicationsContent.expanded .bg-gradient-to-t {
    opacity: 0;
    pointer-events: none;
}


.linkInBio{
    color: #00ff41;
    font-weight: bold;
    text-decoration: none;
}


.li_article .box {
    background-color: #00ff41;
}

.li_Article .box {
    background-color: #00ff41;
}

.li_Conference .box {
    background-color: #00d4ff;
}
.li_Book .box {
    background-color: #ff00a1;
}
.li_incollection .box {
    background-color: #ff00a1;
}