@font-face {
    font-family: 'RabidScience';
    src: url('img/rabid-science.regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap; 
}

/* root stuff */
:root {
    --text-light: white;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --primary: #1cf1fb;
    --primary-dark: #1cf1fb44;
}
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
body {
    font-family: 'Arial', sans-serif;
    background-image: url('img/Wallpaper3.png');
    background-size: cover;
    background-position: center;
    color: var(--text-light);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}
body::after {
    content: '';
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

/* base */
.container {
    max-width: 37.5rem; /* 600px */
    width: 100%;
    margin: 0 auto;
    padding: 40px 20px;
    animation: fadeInUp 0.8s ease-out;
}
.header {
    text-align: center;
    margin-bottom: 40px;
    animation: fadeInUp 0.8s ease-out;
}

/* logo */
.logo {
    width: 10rem;
    height: 10rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    position: relative;
    overflow: hidden;
    transition: box-shadow 0.4s, border-color 0.4s, transform 0.4s;
}
.logo::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    transition: box-shadow 0.4s;
}
.logo:hover {
    transform: scale(1.1);
}

/* header */
.title {
    font-size: 32px;
    font-weight: bold;
    color: white;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    font-family: 'RabidScience', sans-serif;
}
.subtitle {
    font-size: 18px;
    font-weight: bold;
    letter-spacing: 2px;
    font-style: italic;
    color: rgba(255,255,255,0.9);
    margin-bottom: 20px;
}
.description {
    font-size: 16px;
    color: rgba(255,255,255,0.8);
    line-height: 1.6;
    margin-bottom: 20px;
}

/* zona link social */
.social-links {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 40px;
}
.social-links a:nth-child(5) {
    grid-column: auto;
}
.social-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 18px;
    background: rgba(255,255,255,0.03);
    backdrop-filter: blur(1px);
    border-radius: 14px;
    text-decoration: none;
    color: #fff;
    border: 1.5px solid #1cf1fb44;
    box-shadow: 0 0 10px rgba(0,0,0,0.10);
    position: relative;
    overflow: hidden;
    transition: box-shadow 0.35s cubic-bezier(.4,0,.2,1), border-color 0.35s cubic-bezier(.4,0,.2,1), background 0.3s, transform 0.3s;
}
.social-link:hover {
    transform: translateY(-3px) scale(1.03);
    background: rgba(255,255,255,0.08);
    box-shadow: 0 0 0 3px #1cf1fb, 0 4px 18px rgba(0,0,0,0.13);
    border-color: #1cf1fb;
}
.social-icon {
    width: 4rem; /* 40px */
    height: 4rem; /* 40px */
    margin-bottom: 10px;
    transition: transform 0.5s, filter 0.3s;
    filter: drop-shadow(0 0 4px var(--primary-dark));
}
.social-text {
    font-weight: bold;
    font-size: 12px;
    font-style: italic;
    color: #fff;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.12);
    letter-spacing: 2px;
    z-index: 2;
}

/* zona repo github */
.repos-section {
    margin-top: 1.25rem; /* 20px */
}
.section-title {
    font-size: 32px;
    font-weight: bold;
    color: var(--primary);
    text-align: center;
    margin-bottom: 30px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    font-family: 'RabidScience', sans-serif;
    letter-spacing: 5px;
}
.repos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}
.repo-card {
    background: rgba(255,255,255,0.03);
    backdrop-filter: blur(1px);
    border-radius: 14px;
    padding: 1.375rem; /* 22px */
    border: 1.5px solid var(--primary-dark);
    box-shadow: 0 0 10px rgba(0,0,0,0.03);
    transition: box-shadow 0.35s cubic-bezier(.4,0,.2,1), border-color 0.35s cubic-bezier(.4,0,.2,1), background 0.3s, transform 0.3s;
    position: relative;
    overflow: hidden;
}
.repo-card::before {
    content: none;
}
.repo-card:hover {
    transform: translateY(-3px) scale(1.03);
    background: rgba(255,255,255,0.08);
    box-shadow: 0 0 0 3px #1cf1fb, 0 4px 18px rgba(0,0,0,0.13);
    border-color: #1cf1fb;
}
.repo-name {
    font-size: 18px;
    font-weight: bold;
    color: white;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    overflow: hidden;
    transition: transform 0.5s, filter 0.3s;
    filter: drop-shadow(0 0 4px var(--primary-dark));
}
.repo-name a {
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
    flex: 1 1 0;
}
.repo-icon {
    width: 1.25rem; /* 20px */
    height: 1.25rem; /* 20px */
    margin-right: 0.5rem;
    flex-shrink: 0;
}
.repo-description {
    color: rgba(255,255,255,0.8);
    font-size: 14px;
    font-style: italic;
    line-height: 1.5;
    margin-bottom: 0.9375rem;
}
.repo-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.repo-stat {
    display: flex;
    align-items: center;
    color: rgba(255,255,255,0.7);
    font-size: 12px;
}
.repo-stat svg {
    width: 16px;
    height: 16px;
    margin-right: 5px;
}
.repo-language {
    display: flex;
    align-items: center;
    color: rgba(255,255,255,0.7);
    font-size: 12px;
}
.language-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 5px;
}

/* caricamento */
.loading {
    text-align: center;
    color: white;
    font-size: 16px;
    padding: 2.5rem; /* 40px */
}
.spinner {
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top: 3px solid white;
    width: 1.875rem; /* 30px */
    height: 1.875rem; /* 30px */
    animation: spin 1s linear infinite;
    margin: 0 auto 0.9375rem;
}

a {
    color: var(--primary);
    font-weight: bold;
    text-decoration: underline;
    transition: opacity 0.2s ease;
}
a:hover {
    opacity: 0.8;
}

/* cambio lingua */
.language-switcher {
    position: fixed;
    top: 1.25rem; /* 20px */
    right: 1.25rem; /* 20px */
    z-index: 100;
    display: flex;
    align-items: center;
    backdrop-filter: blur(10px);
    border-radius: 14px;
    overflow: hidden;
}
.language-button {
    background: rgba(255,255,255,0.08);
    font-family: 'Arial', sans-serif;
    border: 1.5px solid var(--primary-dark);
    padding: 8px 12px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    color: white;
    font-weight: bold;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}
.language-button:hover {
    background: rgba(255,255,255,0.15);
    box-shadow: 0 0 0 3px var(--primary-dark);
    border-color: #1cf1fb;
}
.current-language {
    opacity: 1;
    text-decoration: underline;
}
.current-language:hover {
    color: var(--primary);
}
.other-language {
    opacity: 0.3;
}
.other-language:hover {
    opacity: 0.7;
    color: var(--primary);
    text-decoration: underline;
}
.language-divider {
    margin: 0 4px;
    opacity: 0.7;
}

/* calendar */
.calendar-container {
    display: flex;
    justify-content: center;
    width: 100%;
    margin: 0 auto 40px;
    max-width: 900px;
    position: relative;
    height: 600px; /* Explicit height */
}

.calendar-iframe {
    width: 100% !important; /* Important to override any inline styles */
    height: 100% !important; /* Use full height of container */
    min-height: 600px;
    border: 1.5px solid var(--primary-dark);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.calendar-iframe:hover {
    border-color: var(--primary);
    box-shadow: 0 6px 16px rgba(28, 241, 251, 0.15);
}

@media (max-width: 768px) {
    .container {
        padding: 1.25rem 0.9375rem 2.5rem; /* 20px 15px 40px */
        margin-top: 2.5rem; /* 40px */
    }
    .title {
        font-size: 28px;
    }    
    .social-links {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.25rem; /* 20px */
    }
    .social-links a:nth-child(5) {
        grid-column: auto;
    }
    .social-links a:last-child:nth-child(odd) {
        grid-column: 1 / span 2;
        justify-self: center;
        width: 100%;
    }
    .repos-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .language-switcher {
        top: 0.9375rem;
        right: 0.9375rem;
        padding: 0.1875rem; /* 3px */
        border-radius: 1.25rem; /* 20px */
    }
    .calendar-iframe {
        height: 400px;
    }
}
@media (max-width: 480px) {
    .social-links {
        grid-template-columns: repeat(2, 1fr);
    }
    .social-links a:last-child:nth-child(odd) {
        grid-column: 1 / span 2;
        justify-self: center;
        width: 100%;
    }
    .title {
        font-size: 22px;
    }    
    .logo {
        width: 5.625rem; /* 90px */
        height: 5.625rem; /* 90px */
        margin-bottom: 0.9375rem;
    }
    .container {
        padding-bottom: 3.75rem; /* 60px */
    }
    .section-title {
        margin-bottom: 1.5625rem; /* 25px */
        font-size: 22px;
        letter-spacing: 3px;
    }
    .repo-card {
        padding: 1.25rem; /* 20px */
        margin-bottom: 0.3125rem; /* 5px */
    }
    .header {
        margin-bottom: 1.875rem; /* 30px */
    }
}

/* animazioni varie */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}