:root {
    --primary: #00f2fe;
    --secondary: #4facfe;
    --bg: #050505;
    --card-bg: rgba(255, 255, 255, 0.05);
    --text: #ffffff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body, html {
    width: 100%;
    height: 100%;
    font-family: 'Outfit', sans-serif;
    background: var(--bg);
    color: var(--text);
    overflow-x: hidden;
    overflow-y: auto;
}

/* Landing Page Style */
#landing-page {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    min-height: 100%;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    background: radial-gradient(circle at center, #1a1a1a 0%, #050505 100%);
    transition: opacity 1s cubic-bezier(0.4, 0, 0.2, 1), visibility 1s;
}

#landing-page.hidden {
    opacity: 0;
    visibility: hidden;
}

.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 40px;
    padding: 60px;
    text-align: center;
    max-width: 600px;
    width: 90%;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    animation: fadeIn 1s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

h1 {
    font-size: 3rem;
    font-weight: 600;
    margin-bottom: 1rem;
    background: linear-gradient(to right, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -1px;
}

p {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 2.5rem;
    line-height: 1.6;
}

.upload-area {
    position: relative;
    cursor: pointer;
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: 24px;
    padding: 40px;
    transition: all 0.3s ease;
    display: block;
}

.upload-area:hover {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.03);
    transform: scale(1.02);
}

.upload-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
}

#file-input {
    display: none;
}

.btn-start {
    margin-top: 2rem;
    padding: 15px 40px;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 50px;
    background: linear-gradient(135deg, var(--secondary) 0%, var(--primary) 100%);
    color: #000;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 20px rgba(0, 242, 254, 0.2);
}

.btn-start:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 30px rgba(0, 242, 254, 0.4);
}

/* Animation Container Style */
.container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%); /* Centra il container nel viewport */
    overflow: visible;
    display: none; /* Inizia nascosto */
}

.container.active {
    display: block;
}

.zoom-element {
    position: absolute;
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    will-change: transform, opacity;
}

#selection-rect {
    position: absolute;
    border: 2px solid var(--primary);
    background: rgba(0, 242, 254, 0.2);
    box-shadow: 0 0 15px var(--primary);
    pointer-events: none;
    z-index: 10;
}

#crop-container:hover #preview-img {
    filter: brightness(0.7);
}

#preview-img {
    transition: filter 0.3s ease;
}

/* Controls */
.ui-overlay {
    position: fixed;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 20px;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

.container.active ~ .ui-overlay {
    opacity: 1;
    pointer-events: all;
}

.control-pill {
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 12px 24px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 15px;
    color: #fff;
    font-weight: 500;
}

.btn-control {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease;
}

.btn-control:hover {
    color: var(--primary);
}

.speed-badge {
    font-size: 0.9rem;
    background: var(--primary);
    color: #000;
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 700;
}

#back-btn {
    position: fixed;
    top: 30px;
    left: 30px;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    cursor: pointer;
    z-index: 1000;
    transition: all 0.3s ease;
    opacity: 0;
    pointer-events: none;
}

.container.active ~ #back-btn {
    opacity: 1;
    pointer-events: all;
}

#back-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(-5px);
}

.separator-v {
    width: 1px;
    height: 24px;
    background: rgba(255, 255, 255, 0.2);
    margin: 0 10px;
}

.spiral-label {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    user-select: none;
    transition: transform 0.2s ease;
}

.spiral-label:hover {
    transform: scale(1.1);
}

.spiral-label input {
    display: none;
}

.spiral-label span {
    font-size: 1.2rem;
    filter: grayscale(1);
    transition: filter 0.3s ease;
}

.spiral-label input:checked + span {
    filter: grayscale(0);
}