/* Reset e base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: #0d1117;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
}

/* Sfondo terminale - versione pulita */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        repeating-linear-gradient(
            0deg,
            rgba(0, 255, 65, 0.09) 0px,
            rgba(0, 255, 65, 0.008) 1px,
            transparent 1px,
            transparent 5px
        ),
        repeating-linear-gradient(
            90deg,
            rgba(0, 255, 65, 0.008) 0px,
            rgba(0, 255, 65, 0.008) 1px,
            transparent 1px,
            transparent 5px
        ),
        #0d1117;
    pointer-events: none;
    z-index: 0;
}

/* Contenuto terminale */
.terminal-content {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding: 2rem;
    pointer-events: none;
    z-index: 0;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    color: rgba(0, 255, 65, 0.3);
    line-height: 1.8;
    overflow: hidden;
    white-space: pre-wrap;
    user-select: none;
}

/* Cursore lampeggiante */
.terminal-cursor {
    display: inline-block;
    width: 10px;
    height: 18px;
    background: rgba(0, 255, 65, 0.3);
    animation: blink 1s step-end infinite;
    vertical-align: text-bottom;
    margin-left: 2px;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* Sfondo con terminale */
.background-text {
    position: fixed;
    top: 20px;
    left: 20px;
    transform: rotate(0deg);
    font-size: 2rem;
    font-weight: 900;
    color: rgba(0, 255, 65, 0.3);
    white-space: nowrap;
    pointer-events: none;
    letter-spacing: 1px;
    font-family: 'Courier New', monospace;
    z-index: 1;
    text-shadow: 0 0 40px rgba(0, 255, 65, 0.1);
    animation: terminalGlow 3s ease-in-out infinite alternate;
}

@keyframes terminalGlow {
    0% {
        text-shadow: 0 0 20px rgba(0, 255, 65, 0.05);
        opacity: 0.8;
    }
    100% {
        text-shadow: 0 0 50px rgba(0, 255, 65, 0.2);
        opacity: 1;
    }
}

/* Versione tablet */
@media (max-width: 768px) {
    .background-text {
        font-size: 1.5rem;
        top: 15px;
        left: 15px;
        letter-spacing: 3px;
    }

    .terminal-content {
        font-size: 0.75rem;
        padding: 1rem;
    }
}

/* Versione mobile */
@media (max-width: 480px) {
    .background-text {
        font-size: 1rem;
        top: 10px;
        left: 10px;
        letter-spacing: 2px;
    }

    .terminal-content {
        font-size: 0.55rem;
        padding: 0.5rem;
    }
}

/* ============================================ */
/* CARD - TEMA CHIARO CON TRASPARENZA */
/* ============================================ */

.card {
    max-width: 640px;
    width: 100%;
    background: rgba(250, 250, 250, 0.82);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-radius: 14px 14px 1px 1px;
    padding: 0;
    box-shadow:
        0 0 20px rgba(255, 255, 255, 0.20),
        0 8px 24px rgba(0, 0, 0, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.85);
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease, opacity 0.25s ease;
    border: 1px solid rgba(255, 255, 255, 0.35);
    position: relative;
    overflow: hidden;
    animation: fadeSlideUp 0.9s cubic-bezier(0.2, 0.9, 0.3, 1.1) forwards;
    z-index: 2;
    will-change: transform, opacity;
}

.card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        rgba(255,255,255,0.22) 0%,
        rgba(255,255,255,0.08) 100%
    );
    pointer-events: none;
}

.card::after {
    display: none;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow:
        0 16px 40px rgba(0, 0, 0, 0.32),
        0 2px 4px rgba(0, 0, 0, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

/* STATI */
.card.window-press {
    transform: scale(0.985);
}

.card.minimized {
    transform: scale(0.2);
    opacity: 0;
    pointer-events: none;
}

.card.maximized {
    width: 100vw;
    height: 100vh;
    max-width: 100vw;
    border-radius: 0;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 9999;
}

/* HEADER */
.card-header {
    padding: 1rem 1.5rem 0.8rem;
    border-bottom: 1px solid rgba(169, 169, 169,0.8);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(245, 245, 245, 0.72);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 14px 14px 0 0;
}

.card-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-header-left .icon {
    width: 28px;
    height: 28px;
    background: rgba(255,255,255,0.55);
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #2b2b2b;
}

.card-header-left .title {
    color: rgba(0, 0, 0, 0.8);
    font-size: 0.85rem;
    font-weight: 600;
    font-family: 'Inter', -apple-system, sans-serif;
}

.card-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-header-right .dot-group {
    display: flex;
    gap: 7px;
}

.card-header-right .dot {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #deddda;
    border: 1px solid #c0bfbc;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #5e5c64;
    font-size: 12px;
    font-weight: 600;
    transition: all .2s ease;
    cursor: pointer;
}

.card-header-right .dot:hover {
    background: #cfcfcb;
    transform: scale(1.05);
}

/* GNOME ICON FIX - Caratteri corretti */
.card-header-right .dot.chiudi::before { 
    content: "\2715"; 
    font-size: 10px; 
}
.card-header-right .dot.minimizza::before { 
    content: "\2212"; 
    font-size: 16px; 
}
.card-header-right .dot.massimizza::before { 
    content: "\2750"; 
    font-size: 10px; 
}

.card-header-right .dot:active {
    transform: scale(0.92);
}

/* BODY */
.card-body {
    padding: 2.5rem 2.5rem 2rem;
}

/* ANIMAZIONE */
@keyframes fadeSlideUp {
    0% { opacity: 0; transform: translateY(30px) scale(0.96); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* GEARS */
.gear-wrapper {
    display: flex;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.gear-image {
    width: 72px;
    height: 72px;
    object-fit: contain;
    animation: spinPulse 4s cubic-bezier(0.2, 0.8, 0.4, 1) infinite;
    filter: drop-shadow(0 4px 16px rgba(0, 0, 0, 0.1));
}

@keyframes spinPulse {
    0% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(180deg) scale(1.05); }
    100% { transform: rotate(360deg) scale(1); }
}

/* Badge */
.badge {
    display: inline-block;
    background: rgba(255,255,255,0.55);
    padding: 0.4rem 1.2rem;
    border-radius: 999px;
    border: 1px solid rgba(0,0,0,0.08);
    color: rgba(0,0,0,0.72);
    font-size: .7rem;
    font-weight: 600;
    letter-spacing: .8px;
    text-transform: uppercase;
    margin-bottom: 1.5rem;
    backdrop-filter: blur(8px);
}

/* Titolo */
h1 {
    font-size: 2.6rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #1a1a1a;
    margin-bottom: 0.5rem;
    line-height: 1.2;
    font-family: 'Inter', -apple-system, sans-serif;
    text-shadow: 0 2px 20px rgba(255, 255, 255, 0.1);
}

/* Sottotitolo */
.sub-headline {
    font-size: 1rem;
    font-weight: 400;
    color: rgba(0, 0, 0, 0.5);
    margin-bottom: 2rem;
    letter-spacing: 0.2px;
    padding: 0 0.5rem;
    padding-bottom: 0.8rem;
    display: inline-block;
    font-family: 'Inter', -apple-system, sans-serif;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

/* Messaggio centrale */
.message-box {
    background: rgba(255,255,255,0.45);
    border-radius: 7px;
    padding: 1.5rem;
    margin: 1.5rem 0 2rem;
    border: 1px solid rgba(169, 169, 169,0.8);
    backdrop-filter: blur(8px);
}

.message-box p {
    font-size: 1rem;
    font-weight: 500;
    color: rgba(0, 0, 0, 0.8);
    letter-spacing: 0.3px;
    display: flex;
    align-items: center;
    justify-content: left;
    gap: 0.8rem;
    flex-wrap: wrap;
    text-align: left;
    font-family: 'Inter', -apple-system, sans-serif;
}

/* Pillole stato */
.work-status {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.2rem;
    margin: 1.5rem 0 2rem;
    flex-wrap: wrap;
}

/* PILL FIX - Versione completa e corretta */
.pill {
    background: rgba(255,255,255,0.45);
    padding: 0.5rem 1.4rem;
    border-radius: 7px;
    border: 1px solid rgba(169, 169, 169,0.8);
    color: rgba(0,0,0,0.7);
    font-weight: 500;
    font-size: .85rem;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    backdrop-filter: blur(8px);
    transition: all 0.18s ease;
    cursor: pointer;
    text-decoration: none;
}

.pill:hover {
    background: rgba(255,255,255,0.65);
    transform: translateY(-1px);
}

.pill:active {
    transform: scale(0.96);
    box-shadow: inset 0 2px 6px rgba(0,0,0,.15);
}

.pill:focus-visible {
    outline: 2px solid rgba(90,140,255,.45);
    outline-offset: 2px;
}

.pill .dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #28c840;
    border-radius: 50%;
    animation: pulseDot 1.6s infinite;
    flex-shrink: 0;
}

.status-value {
    color: #1a8a2a;
    font-weight: 600;
}

@keyframes pulseDot {
    0% {
        opacity: 0.3;
        transform: scale(0.8);
    }
    50% {
        opacity: 1;
        transform: scale(1.2);
    }
    100% {
        opacity: 0.3;
        transform: scale(0.8);
    }
}

/* Barra di caricamento */
.progress-bg {
    width: 100%;
    height: 5px;
    background: rgba(0,0,0,0.08);
    border: 1px solid rgba(169, 169, 169,0.8);
    border-radius: 999px;
    margin: 2rem 0 0.2rem;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(
        90deg,
        rgb(255, 163, 72) 0%,
        rgb(255, 120, 0) 50%,
        rgb(230, 97, 0) 100%
    );
    border-radius: 999px;
    animation: fillProgress 10s ease-in-out infinite alternate;
}

@keyframes fillProgress {
    0% {
        width: 10%;
    }
    100% {
        width: 98%;
    }
}

/* Footer */
.footer-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .6rem;
    margin-top: 1.8rem;
    color: rgba(0,0,0,.45);
    font-size: .85rem;
    font-weight: 500;
    border-top: 1px solid rgba(0,0,0,.06);
    padding-top: 1.8rem;
}

.footer-note .heart {
    color: rgba(255, 107, 107, 0.8);
    font-size: 0.9rem;
}

.footer-note span:not(.heart) {
    background: rgba(255, 255, 255, 0.1);
    padding: 0.2rem 0.8rem;
    border-radius: 4px;
    color: rgba(0, 0, 0, 0.5);
}

/* Meta info */
.meta-info {
    margin-top: 1.2rem;
    font-size: 0.65rem;
    color: rgba(0, 0, 0, 0.25);
    letter-spacing: 1px;
    display: flex;
    justify-content: center;
    gap: 1.2rem;
    font-family: 'Inter', -apple-system, sans-serif;
}

/* Responsive */
@media (max-width: 550px) {
    .card {
        border-radius: 12px;
    }
    .card-body {
        padding: 1.5rem 1.5rem 1.5rem;
    }
    .card-header {
        padding: 0.8rem 1rem 0.6rem 1rem;
    }
    .card-header-left .title {
        font-size: 0.75rem;
    }
    .card-header-right .dot {
        width: 16px;
        height: 16px;
        font-size: 10px;
    }
    .card-header-right .dot.chiudi::before {
        font-size: 9px;
    }
    .card-header-right .dot.minimizza::before {
        font-size: 13px;
    }
    .card-header-right .dot.massimizza::before {
        font-size: 9px;
    }
    h1 {
        font-size: 2rem;
    }
    .sub-headline {
        font-size: 0.85rem;
    }
    .message-box p {
        font-size: 1rem;
    }
    .gear-image {
        width: 56px;
        height: 56px;
    }
    .pill {
        font-size: 0.75rem;
        padding: 0.4rem 1rem;
    }
    .badge {
        font-size: 0.6rem;
    }
}

@media (max-width: 400px) {
    h1 {
        font-size: 1.6rem;
    }
    .card-body {
        padding: 1rem 1rem 1rem;
    }
}
