/* ============================================
   GALAXY THEME CSS - Mobile First
   Sfondo Grigio Aziendale #849daa
   ============================================ */

/* Font Import */
@font-face {
    font-family: "Share-TechMono";
    src: url(../fonts/Share-TechMono.otf) format("opentype");
}

/* CSS Variables */
:root {
    --primary-color: #849daa;
    --primary-dark: #667b85;
    --primary-light: #a8bcc7;
    --bg-main: #5a6d78;
    --bg-dark: #4a5d68;
    --bg-card: rgba(74, 93, 104, 0.9);
    --bg-card-solid: #4a5d68;
    --text-light: #ffffff;
    --text-muted: rgba(255, 255, 255, 0.75);
    --border-color: rgba(255, 255, 255, 0.2);
    --glow-color: rgba(255, 255, 255, 0.4);
    --glow-intense: rgba(255, 255, 255, 0.7);
}

/* ============================================
   MOBILE FIRST - Base (< 768px)
   ============================================ */

/* Reset */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 14px;
}

html, body {
    height: 100%;
    width: 100%;
    overflow-x: hidden;
}

body {
    font-family: "Share-TechMono", monospace;
    color: var(--text-light);
    background-color: var(--bg-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* Galaxy Container - Three.js Canvas */
#galaxy-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: linear-gradient(135deg, var(--bg-main) 0%, var(--bg-dark) 100%);
}

#galaxy-container canvas {
    display: block;
}

/* Content Wrapper */
.content-wrapper {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 15px;
    padding-bottom: 130px;
}

/* ============================================
   MOBILE: Hero Section
   ============================================ */
.hero-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: auto;
    text-align: center;
    padding: 15px 15px 10px;
    width: 100%;
}


.logo-container {
    margin-bottom: 20px;
}

.floating-logo {
    width: 80px;
    height: auto;
    filter: drop-shadow(0 0 15px var(--glow-color));
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

/* Cosmic Clock - Mobile */
.cosmic-clock {
    font-size: 1.8rem;
    color: var(--text-light);
    text-shadow: 0 0 10px var(--glow-color);
    margin-bottom: 15px;
    letter-spacing: 3px;
}

/* Glowing Title - Mobile */
.glowing-title {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-top: 15px;
}

.title-line {
    font-size: 1.4rem;
    font-weight: normal;
    letter-spacing: 4px;
    color: var(--text-light);
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.1);
    text-align: center;
}

.subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    letter-spacing: 3px;
    text-transform: uppercase;
}

.bio {
    max-width: 500px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.5;
    margin-top: 12px;
}

.bio strong {
    color: var(--text-light);
    font-weight: normal;
}


/* ============================================
   MOBILE: Navigation Menu
   ============================================ */
.cosmic-menu {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    max-width: 300px;
    margin-top: 15px;
}

.cosmic-menu.compact {
    margin-top: 10px;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
}

.nav-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 20px;
    text-decoration: none;
    color: var(--text-light);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 30px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    min-height: 48px;
    backdrop-filter: blur(10px);
}

.nav-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, var(--glow-color), transparent);
    transition: left 0.5s ease;
}

.nav-link:hover::before,
.nav-link:active::before {
    left: 100%;
}

.nav-link:hover,
.nav-link:active {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--text-light);
    box-shadow: 0 0 20px var(--glow-color);
    transform: translateY(-2px);
}

.nav-icon {
    font-size: 1.1rem;
    color: var(--text-light);
}

.nav-text {
    letter-spacing: 2px;
    font-size: 0.8rem;
    text-transform: uppercase;
}

/* ============================================
   MOBILE: Page Header
   ============================================ */
.page-header {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px;
    gap: 15px;
}

/* ============================================
   MOBILE: Main Content
   ============================================ */
.main-content {
    width: 100%;
    max-width: 100%;
    padding: 10px;
}

/* ============================================
   MOBILE: Cosmic Section
   ============================================ */
.cosmic-section {
    margin-bottom: 40px;
}

.section-title {
    text-align: center;
    font-size: 1.2rem;
    font-weight: normal;
    color: var(--text-light);
    margin-bottom: 25px;
    letter-spacing: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-shadow: 0 0 3px rgba(255, 255, 255, 0.1);
}

.title-icon {
    color: var(--text-muted);
    animation: twinkle 2s ease-in-out infinite;
    font-size: 0.9rem;
}

@keyframes twinkle {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.8); }
}

/* ============================================
   MOBILE: Cards
   ============================================ */
.cards-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 10px 0;
}

.client-card,
.education-card {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s ease;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.card-glow {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, var(--glow-color) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.client-card:hover .card-glow,
.education-card:hover .card-glow,
.client-card:active .card-glow,
.education-card:active .card-glow {
    opacity: 0.1;
}

.client-card:hover,
.education-card:hover,
.client-card:active,
.education-card:active {
    transform: translateY(-5px);
    border-color: var(--text-light);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.card-content {
    position: relative;
    z-index: 1;
}

.client-name {
    font-size: 1rem;
    color: var(--text-light);
    margin-bottom: 8px;
    letter-spacing: 1px;
}

.client-service {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 12px;
}

.card-stars {
    color: var(--text-muted);
    font-size: 0.75rem;
    letter-spacing: 4px;
    opacity: 0.6;
}

/* ============================================
   MOBILE: Timeline
   ============================================ */
.timeline {
    position: relative;
    padding-left: 25px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, var(--text-light), transparent);
}

.timeline-item {
    position: relative;
    margin-bottom: 20px;
    padding: 15px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.timeline-item:hover,
.timeline-item:active {
    border-color: var(--text-light);
    box-shadow: 0 0 15px var(--glow-color);
    transform: translateX(5px);
}

.timeline-marker {
    position: absolute;
    left: -21px;
    top: 20px;
    width: 12px;
    height: 12px;
    background: var(--text-light);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--glow-color);
    animation: pulse-marker 2s ease-in-out infinite;
}

@keyframes pulse-marker {
    0%, 100% { box-shadow: 0 0 10px var(--glow-color); }
    50% { box-shadow: 0 0 20px var(--glow-intense); }
}

.company-name {
    font-size: 1rem;
    margin-bottom: 6px;
}

.company-name a {
    color: var(--text-light);
    text-decoration: none;
    transition: all 0.3s ease;
}

.company-name a:hover {
    text-shadow: 0 0 10px var(--glow-color);
}

.job-title {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 4px;
}

.job-period {
    color: var(--text-muted);
    font-size: 0.75rem;
    opacity: 0.8;
}

/* ============================================
   MOBILE: Education Cards
   ============================================ */
.education-cards {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.education-badge {
    position: absolute;
    top: -8px;
    right: 15px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    padding: 6px 14px;
    border-radius: 15px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.badge-score {
    font-size: 0.85rem;
    font-weight: bold;
    color: var(--text-light);
}

.institution-name {
    font-size: 1rem;
    color: var(--text-light);
    margin-bottom: 8px;
    margin-top: 8px;
}

.degree-title {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 15px;
}

.thesis-info {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

.thesis-info h4 {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 8px;
    font-weight: normal;
}

.thesis-info p {
    color: var(--text-muted);
    font-size: 0.8rem;
    line-height: 1.5;
}

.thesis-details {
    font-style: italic;
    opacity: 0.8;
    margin-top: 8px;
}

/* ============================================
   MOBILE: Footer
   ============================================ */
.cosmic-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: linear-gradient(to top, var(--bg-dark) 0%, transparent 100%);
    padding: 25px 15px 15px;
}

.footer-content {
    max-width: 100%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.contact-info {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
}

.footer-logo {
    width: 20px;
    height: auto;
    opacity: 0.8;
}

.info-item {
    color: var(--text-muted);
}

.separator {
    color: var(--text-light);
    opacity: 0.5;
}

.contact-links {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.contact-link {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-light);
    text-decoration: none;
    padding: 8px 14px;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    transition: all 0.3s ease;
    font-size: 0.75rem;
    min-height: 40px;
    backdrop-filter: blur(10px);
}

.contact-link:hover,
.contact-link:active {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--text-light);
    box-shadow: 0 0 12px var(--glow-color);
}

.link-icon {
    color: var(--text-light);
}

/* ============================================
   MOBILE: Utility Classes
   ============================================ */
.testo_non_selezionabile {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* ============================================
   TABLET (768px+)
   ============================================ */
@media screen and (min-width: 768px) {
    html {
        font-size: 15px;
    }

    .content-wrapper {
        padding: 20px;
        padding-bottom: 100px;
    }

    .hero-section {
        min-height: 55vh;
        padding: 30px 20px;
    }

    .floating-logo {
        width: 100px;
    }

    .cosmic-clock {
        font-size: 2.5rem;
        letter-spacing: 4px;
    }

    .title-line {
        font-size: 2rem;
        letter-spacing: 6px;
    }

    .subtitle {
        font-size: 1rem;
    }

    .cosmic-menu {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        max-width: none;
        gap: 15px;
    }

    .nav-link {
        padding: 14px 25px;
    }

    .nav-text {
        font-size: 0.85rem;
    }

    .page-header {
        flex-direction: row;
        justify-content: space-between;
    }

    .main-content {
        max-width: 900px;
        padding: 20px;
    }

    .section-title {
        font-size: 1.5rem;
        margin-bottom: 35px;
    }

    .cards-container {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .timeline {
        padding-left: 35px;
    }

    .timeline-marker {
        left: -31px;
        width: 14px;
        height: 14px;
    }

    .timeline-item {
        padding: 20px;
    }

    .education-cards {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 25px;
    }

    .cosmic-footer {
        padding: 25px 20px 18px;
    }

    .footer-content {
        flex-direction: row;
        justify-content: space-between;
    }

    .contact-info {
        font-size: 0.8rem;
    }

    .contact-link {
        font-size: 0.8rem;
        padding: 10px 18px;
    }
}

/* ============================================
   DESKTOP (1024px+)
   ============================================ */
@media screen and (min-width: 1024px) {
    html {
        font-size: 16px;
    }

    .content-wrapper {
        padding: 25px;
    }

    .hero-section {
        min-height: 60vh;
    }

    .floating-logo {
        width: 120px;
        margin-bottom: 30px;
    }

    .cosmic-clock {
        font-size: 3rem;
        letter-spacing: 5px;
        margin-bottom: 20px;
    }

    .title-line {
        font-size: 2.5rem;
        letter-spacing: 8px;
    }

    .subtitle {
        font-size: 1.1rem;
        letter-spacing: 4px;
    }

    .cosmic-menu {
        margin-top: 40px;
        gap: 25px;
    }

    .nav-link {
        padding: 15px 30px;
    }

    .nav-text {
        letter-spacing: 3px;
        font-size: 0.9rem;
    }

    .main-content {
        max-width: 1100px;
    }

    .section-title {
        font-size: 1.8rem;
        letter-spacing: 4px;
    }

    .cards-container {
        grid-template-columns: repeat(3, 1fr);
        gap: 25px;
    }

    .client-card,
    .education-card {
        padding: 25px;
    }

    .client-card:hover,
    .education-card:hover {
        transform: translateY(-10px);
    }

    .timeline {
        padding-left: 40px;
    }

    .timeline-item {
        padding: 25px;
        margin-bottom: 25px;
    }

    .timeline-item:hover {
        transform: translateX(10px);
    }

    .education-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 30px;
    }
}

/* ============================================
   LARGE DESKTOP (1440px+)
   ============================================ */
@media screen and (min-width: 1440px) {
    .main-content {
        max-width: 1200px;
    }

    .cards-container {
        gap: 30px;
    }

    .client-card,
    .education-card {
        padding: 30px;
    }
}

/* ============================================
   Scrollbar Styling
   ============================================ */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-dark);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

/* Selection Color */
::selection {
    background: var(--text-light);
    color: var(--bg-dark);
}

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {
    .nav-link,
    .contact-link {
        min-height: 48px;
    }

    .client-card,
    .education-card,
    .timeline-item {
        cursor: pointer;
    }
}

/* Safe area for notched phones */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .cosmic-footer {
        padding-bottom: calc(15px + env(safe-area-inset-bottom));
    }

    .content-wrapper {
        padding-bottom: calc(120px + env(safe-area-inset-bottom));
    }
}
