html{
    overflow: hidden;
}

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

body {
    font-family: Cambria, Cochin, Georgia, Times, 'Times New Roman', serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    background-size: auto 100%;
    background-image: url("/resources/ZianoDiNotte.png");
    min-height: 100vh;
    align-items: center;
    padding: 20px;
    overflow: hidden;
}

body header {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    text-transform: uppercase;
}
body header img {
    margin-left: 20px;
    margin-right: 20px;
}

.container {
    /* text-align: center; */
    max-width: 800px;
    width: 100%;
    height: 90vh;
    position: relative;
    margin-left: -10px;
}

h1 {
    color: #fff;
    font-size: 2rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.img-round-section {
    display: inline-block;
    margin: 20px;
    position: absolute;
    cursor: pointer;
    transition: top 0.6s ease-in, left 0.6s ease-in;
}

.img-round-section:nth-child(1) {
    left: 30.5%;
    top: 0%;
}
.img-round-section:nth-child(2) {
    left: 60%;
    top: 10%;
}
.img-round-section:nth-child(3) {
    left: 0%;
    top: 10%;
}
.img-round-section:nth-child(4) {
    left: 30.5%;
    top: 20%;
}
.img-round-section:nth-child(5) {
    left: 60%;
    top: 30%;
}
.img-round-section:nth-child(6) {
    left: 0%;
    top: 30%;
}
.img-round-section:nth-child(7) {
    left: 30.5%;
    top: 40%;
}
.img-round-section:nth-child(8) {
    left: 60%;
    top: 50%;
}
.img-round-section:nth-child(9) {
    left: 0%;
    top: 50%;
}
.img-round-section:nth-child(10) {
    left: 30.5%;
    top: 60%;
}

.img-round-section .rounded-image{
    width: 30vw;
    height: 30vw;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, width 1s ease-in-out, height 1s ease-in-out;
    border: 3px solid gray;
    /*animation: float 6s ease-in-out infinite,
                wobble 3s ease-in-out infinite;
    */
}

.img-round-section:nth-child(3n+2) .rounded-image { animation-delay: 1s; }
.img-round-section:nth-child(3n+3) .rounded-image { animation-delay: 2s; }

@keyframes float {
  0%   { transform: translateY(0); }
  50%  { transform: translateY(-20px); }
  100% { transform: translateY(0); }
}
@keyframes wobble {
  0%,100% { rotate: 0deg; }
  50% { rotate: 2deg; }
}


.img-round-section:hover .rounded-image {
  transform: scale(1.1);
  transition: transform 0.3s ease;
}

.img-round-section .hidden-card-info {
    position: absolute;
    background: rgba(255, 255, 255, 1);
    color: #000;
    padding: 15px;
    border-radius: 10px;
    text-align: left;
    width: 95vw;
    top: -15px;
    left: -15px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
    z-index: -1; /* Start behind the rounded image */
    
    /* Initial hidden state */
    opacity: 0;
    visibility: hidden;
    
    /* Start as a circle matching the rounded image */
    clip-path: circle(15vw at 15vw 15vw);
    
    /* Transition for closing - shrink back to circle */
    transition: clip-path 0.7s cubic-bezier(0.4, 0, 0.2, 1) 0s,
                opacity 0.3s ease 0.5s,
                visibility 0.3s ease 0.5s,
                z-index 0s ease 0.7s,
                width 1s ease-in-out,
                height 1s ease-in-out;
}

.img-round-section.semiactive{
    z-index: 2;
    top: 5%;
    left: 5%;
    transition: top 1s ease-in-out, left 1s ease-in-out;
}
.img-round-section.active{
    z-index: 2;
    top: 0%;
    left: 0%;
    transition: top 0.6s ease-in, left 0.6s ease-in;
}
.img-round-section.semiactive .rounded-image{
    width: 80vw;
    height: 80vw;
    transition: width 1s ease-out, height 1s ease-out;
}
.img-round-section.active .rounded-image{
    transition: width 0.8s ease-in-out, height 0.8s ease-in-out;
}

.img-round-section .hidden-card-info.active {
    opacity: 1;
    visibility: visible;
    z-index: 1;
    /* Expand to full rectangle */
    clip-path: circle(150% at 15vw 15vw);
    
    /* Transition for opening - expand from circle */
    transition: clip-path 1.2s cubic-bezier(0.4, 0, 0.2, 1) 0s,
                opacity 0.1s ease 0s,
                visibility 0.1s ease 0s,
                z-index 0s ease 0s,
                width 1s ease-in-out,
                height 1s ease-in-out;
}

.img-round-section .hidden-card-info .preview-image {
    position: relative;
    z-index: 2;
    margin-right: 15px;
    float: left;
}

.img-round-section .hidden-card-info h3 {
    margin-top: 15px;
    margin-bottom: 10px;
}

.img-round-section .hidden-card-info p {
    line-height: 1.5;
}

.img-round-section .hidden-card-info .dati {
    font-size: 0.8rem;
    padding-top: 8px;
}
.img-round-section .hidden-card-info .curiosita {
    clear: left;
    padding-top: 5px;
    line-height: 5px;
    font-size: 0.85rem;
}

/* Table Styles */
.img-round-section .hidden-card-info table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 8px;
    overflow: hidden;
    font-size: 0.9rem;
}

.img-round-section .hidden-card-info table thead {
    background: linear-gradient(145deg, #e94560, #ff6b6b);
}

.img-round-section .hidden-card-info table th {
    padding: 12px 10px;
    text-align: left;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    color: #fff;
}

.img-round-section .hidden-card-info table td {
    padding: 12px 10px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.img-round-section .hidden-card-info table tbody tr:last-child td {
    border-bottom: none;
}

.img-round-section .hidden-card-info table tbody tr:hover {
    background: rgba(0, 0, 0, 0.08);
    transition: background 0.2s ease;
}

.img-round-section .hidden-card-info table tbody tr:nth-child(even) {
    background: rgba(0, 0, 0, 0.03);
}

.img-round-section .hidden-card-info table tbody tr:nth-child(even):hover {
    background: rgba(0, 0, 0, 0.08);
}

/* Mobile Styles */
@media screen and (max-width: 768px) {
    h1 {
        font-size: 1.7rem;
    }
    body header{
        margin-bottom: 0;
    }
    .img-round-section .hidden-card-info {
        position: absolute;
        width: 92vw;
        height: 71vh;
        max-height: 72vh;
        overflow-y: auto;
        overflow-x: hidden;
    }
    
    .img-round-section .hidden-card-info.active {
        /* Expand from center */
        clip-path: circle(150% at 50% 50%);
    }
    
    /* Table responsive adjustments */
    .img-round-section .hidden-card-info table {
        overflow-x: auto;
        font-size: 0.8rem;
    }
    
    .img-round-section .hidden-card-info table th,
    .img-round-section .hidden-card-info table td {
        padding: 10px 8px;
        white-space: nowrap;
    }
}