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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        "Helvetica Neue", Arial, sans-serif;
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

.landing-container {
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* Individual Sections */
.section {
    flex: 1;
    width: 50%;
    position: relative;
    overflow: hidden;
    color: #000;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Color schemes for each section */
.section[data-section="grafici"] {
    background: #ffffb3;
}

.section[data-section="svg-generator"] {
    background: #8dd3c7;
}

/* Section Content */
.section-content {
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

/* Section Title (Default State) */
.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-align: center;
    transition: all 0.4s ease;
    opacity: 1;
    transform: translateY(0);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    padding: 0 20px;
    word-break: break-word;
}

/* Hover Overlay (Hidden by Default) */
.hover-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.4s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0;
}

/* Image Container */
.image-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.preview-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0;
    box-shadow: none;
    transform: scale(1.1);
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
}

/* Content Wrapper - contains description and buttons */
.content-wrapper {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 90%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    z-index: 2;
}

/* Description */
.description {
    width: 100%;
    text-align: center;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(10px);
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.description-text {
    font-size: 1.5rem;
    line-height: 1.5;
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    transform: translateY(20px);
    transition: transform 0.4s ease 0.1s;
    opacity: 0;
}

/* Buttons Container */
.buttons-container {
    display: flex;
    gap: 12px;
    justify-content: center;
    align-items: center;
    transform: translateY(20px);
    transition: transform 0.4s ease 0.2s;
    opacity: 0;
    flex-direction: column;
}

/* Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 1.5rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px solid transparent;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn svg {
    width: 20px;
    height: 20px;
}

.btn-primary {
    background-color: rgba(255, 255, 255, 0.95);
    color: #333;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.btn-primary:hover {
    background-color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.btn-secondary {
    background-color: rgba(255, 255, 255, 0.2);
    color: #fff;
    border: 2px solid rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(10px);
}

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.8);
    transform: translateY(-2px);
}

/* Single button (when no notebook) */
.btn-single {
    padding: 14px 32px;
}

/* Hover State */
.section:hover {
    flex: 1.5;
}

.section:hover .section-title {
    opacity: 0;
    transform: translateY(-30px);
}

.section:hover .hover-overlay {
    opacity: 1;
}

.section:hover .preview-image {
    transform: scale(1);
    opacity: 1;
}

.section:hover .description-text {
    transform: translateY(0);
    opacity: 1;
}

.section:hover .buttons-container {
    transform: translateX(0) translateY(0);
    opacity: 1;
}

/* Non-hovered sections shrink slightly */
.landing-container:has(.section:hover) .section:not(:hover) {
    flex: 0.8;
}

.landing-container:has(.section:hover) .section:not(:hover) .section-title {
    font-size: 2rem;
}

/* ===== MOBILE STYLES ===== */
@media (max-width: 768px) {
    body {
        overflow-y: auto;
        overflow-x: hidden;
        height: auto;
    }

    .landing-container {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
        overflow-y: auto;
    }

    /* Mobile Section Styling */
    .section {
        width: 100%;
        height: 50vh;
        min-height: 300px;
        flex: none;
        transition: height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    }

    /* Expanded state on mobile */
    .section.active {
        height: 95vh;
        min-height: 500px;
    }

    /* Section title adjustments for mobile */
    .section-title {
        font-size: 1.8rem;
        letter-spacing: 1px;
        padding: 0 15px;
    }

    /* Hover overlay always visible on expanded mobile sections */
    .section.active .hover-overlay {
        opacity: 1;
    }

    .section.active .section-title {
        opacity: 0;
        transform: translateY(-20px);
    }

    .section.active .preview-image {
        transform: scale(1);
        opacity: 1;
    }

    .section.active .description-text {
        transform: translateY(0);
        opacity: 1;
    }

    .section.active .buttons-container {
        transform: translateY(0);
        opacity: 1;
    }

    /* Content wrapper adjustments */
    .content-wrapper {
        width: 95%;
        gap: 15px;
    }

    /* Description adjustments */
    .description {
        padding: 15px;
        border-radius: 8px;
    }

    .description-text {
        font-size: 0.9rem;
        line-height: 1.4;
    }

    /* Button adjustments for mobile */
    .buttons-container {
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }

    .btn {
        width: 100%;
        max-width: 280px;
        padding: 12px 20px;
        font-size: 1rem;
        justify-content: center;
    }

    .btn svg {
        width: 18px;
        height: 18px;
    }

    .btn-single {
        padding: 12px 20px;
    }

    /* Remove desktop hover effects on mobile */
    .section:hover {
        flex: none;
    }

    .landing-container:has(.section:hover) .section:not(:hover) {
        flex: none;
    }

    .landing-container:has(.section:hover) .section:not(:hover) .section-title {
        font-size: 1.8rem;
    }

    /* Prevent image scale on hover for non-active sections */
    .section:not(.active):hover .hover-overlay {
        opacity: 0;
    }

    .section:not(.active):hover .section-title {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Tablet adjustments */
@media (max-width: 1024px) and (min-width: 769px) {
    .section-title {
        font-size: 2rem;
    }

    .description-text {
        font-size: 1.2rem;
    }

    .btn {
        font-size: 1.2rem;
        padding: 10px 20px;
    }
}
