
.cloud-gallery {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    background: transparent;
    backdrop-filter: none;
    perspective: 1200px;
    transition: all 0.3s ease;
}

@media (max-width: 1024px) {
    .cloud-gallery {
        height: 90vh;
    }
}

@media (max-width: 768px) {
    .cloud-gallery {
        height: 85vh;
        perspective: 800px;
    }
}

@media (max-width: 480px) {
    .cloud-gallery {
        height: 80vh;
        perspective: 600px;
    }
}

.cloud-image {
    position: absolute;
    cursor: pointer;
    transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94), box-shadow 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transform-style: preserve-3d;
    opacity: 0;
    animation: fadeIn 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    will-change: transform, opacity;
    backface-visibility: hidden;
    transform: translateZ(0);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    perspective: 1200px;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

@media (max-width: 768px) {
    .cloud-image {
        transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
        touch-action: manipulation;
    }
    
    .cloud-image:hover {
        transform: translate3d(0, 0, 100px) scale3d(1.1, 1.1, 1.1) rotateY(5deg) rotateX(3deg) !important;
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2), 0 0 30px rgba(255, 255, 255, 0.15);
    }
}

@media (hover: none) and (pointer: coarse) {
    .cloud-image:active {
        transform: scale3d(0.95, 0.95, 0.95) !important;
        transition: transform 0.1s ease;
    }
}

@keyframes float {
    0% {
        transform: translateZ(0) rotateX(0deg) rotateY(0deg) rotateZ(0deg);
        animation-timing-function: cubic-bezier(0.34, 1.56, 0.64, 1);
    }
    25% {
        transform: translateZ(25px) rotateX(3deg) rotateY(8deg) rotateZ(0.8deg);
        animation-timing-function: cubic-bezier(0.34, 1.56, 0.64, 1);
    }
    50% {
        transform: translateZ(0) rotateX(-2deg) rotateY(-6deg) rotateZ(-1.2deg);
        animation-timing-function: cubic-bezier(0.34, 1.56, 0.64, 1);
    }
    75% {
        transform: translateZ(-22px) rotateX(-4deg) rotateY(4deg) rotateZ(0.6deg);
        animation-timing-function: cubic-bezier(0.34, 1.56, 0.64, 1);
    }
    100% {
        transform: translateZ(0) rotateX(0deg) rotateY(0deg) rotateZ(0deg);
        animation-timing-function: cubic-bezier(0.34, 1.56, 0.64, 1);
    }
}

@keyframes bend {
    0% {
        transform: scaleX(1) skewX(0deg) skewY(0deg);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    }
    25% {
        transform: scaleX(1.05) skewX(3deg) skewY(1deg);
        box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
    }
    50% {
        transform: scaleX(1) skewX(0deg) skewY(0deg);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    }
    75% {
        transform: scaleX(0.95) skewX(-3deg) skewY(-1deg);
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    }
    100% {
        transform: scaleX(1) skewX(0deg) skewY(0deg);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    }
}

@keyframes fold {
    0% {
        transform: rotateX(0deg) scale(1);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    }
    25% {
        transform: rotateX(20deg) scale(0.98);
        box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
    }
    50% {
        transform: rotateX(45deg) scale(0.95) rotateY(5deg);
        box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
    }
    75% {
        transform: rotateX(20deg) scale(0.98);
        box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
    }
    100% {
        transform: rotateX(0deg) scale(1);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    }
}

@keyframes flip {
    0% {
        transform: rotateY(0deg) rotateX(0deg);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
        opacity: 1;
    }
    25% {
        transform: rotateY(90deg) rotateX(10deg);
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
        opacity: 0.8;
    }
    50% {
        transform: rotateY(180deg) rotateX(0deg);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
        opacity: 1;
    }
    75% {
        transform: rotateY(270deg) rotateX(-10deg);
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
        opacity: 0.8;
    }
    100% {
        transform: rotateY(360deg) rotateX(0deg);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
        opacity: 1;
    }
}

@keyframes wave {
    0% {
        transform: scaleY(1) skewX(0deg);
    }
    25% {
        transform: scaleY(1.02) skewX(2deg);
    }
    50% {
        transform: scaleY(1) skewX(0deg);
    }
    75% {
        transform: scaleY(0.98) skewX(-2deg);
    }
    100% {
        transform: scaleY(1) skewX(0deg);
    }
}

@keyframes physicsEffect {
    0% {
        transform: translate(0, 0) rotateX(0deg) rotateY(0deg) rotateZ(0deg) scale(1);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    }
    15% {
        transform: translate(5px, -5px) rotateX(5deg) rotateY(10deg) rotateZ(1deg) scale(1.02);
        box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
    }
    30% {
        transform: translate(10px, -10px) rotateX(2deg) rotateY(-5deg) rotateZ(-0.5deg) scale(0.98);
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    }
    45% {
        transform: translate(5px, -15px) rotateX(-3deg) rotateY(8deg) rotateZ(0.8deg) scale(1.01);
        box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
    }
    60% {
        transform: translate(0, -10px) rotateX(0deg) rotateY(-3deg) rotateZ(-1deg) scale(0.99);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    }
    75% {
        transform: translate(-5px, -5px) rotateX(2deg) rotateY(5deg) rotateZ(0.5deg) scale(1.02);
        box-shadow: 0 14px 34px rgba(0, 0, 0, 0.14);
    }
    90% {
        transform: translate(0, 0) rotateX(0deg) rotateY(-2deg) rotateZ(-0.3deg) scale(1);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    }
    100% {
        transform: translate(0, 0) rotateX(0deg) rotateY(0deg) rotateZ(0deg) scale(1);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    }
}

.cloud-image:hover {
    transform: translate3d(0, 0, 200px) scale3d(1.25, 1.25, 1.25) rotateY(10deg) rotateX(6deg) !important;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.3), 0 0 40px rgba(255, 255, 255, 0.2);
    z-index: 1000;
    opacity: 1;
    transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.cloud-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, rgba(255,255,255,0) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 3;
    box-shadow: inset 0 0 20px rgba(255, 255, 255, 0.1);
}

.cloud-image:hover::after {
    opacity: 1;
    box-shadow: inset 0 0 30px rgba(255, 255, 255, 0.2), 0 0 40px rgba(255, 255, 255, 0.3);
}

.cloud-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.cloud-image::before {
    content: attr(data-upload-time);
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 8px;
    background: transparent;
    color: white;
    font-size: 0.8rem;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 5;
}

.cloud-image:hover::before {
    opacity: 1;
}

.memory-text {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 15px;
    background: transparent;
    color: white;
    font-size: 0.9rem;
    line-height: 1.4;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    opacity: 0;
    transition: opacity 0.3s ease;
    overflow: hidden;
    text-shadow: 0 2px 4px rgba(0,0,0,0.8);
    z-index: 4;
}

.cloud-image:hover .memory-text {
    opacity: 1;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    transition: opacity 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.modal-content {
    background-color: rgba(255, 255, 255, 0.95);
    margin: 5% auto;
    padding: 20px;
    border-radius: 20px;
    width: 90%;
    max-width: 800px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: modalFadeIn 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.3), 0 0 40px rgba(255, 255, 255, 0.1);
    transform: translateZ(0);
    will-change: transform, opacity;
}

@media (max-width: 768px) {
    .modal-content {
        margin: 10% auto;
        padding: 15px;
        width: 95%;
        max-width: 95%;
        border-radius: 15px;
    }
    
    .modal-image {
        max-height: 40vh;
    }
    
    .modal-text {
        font-size: 1rem;
        line-height: 1.6;
    }
    
    .modal-motto {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .modal-content {
        margin: 15% auto;
        padding: 10px;
    }
    
    .modal-image {
        max-height: 35vh;
    }
    
    #close-modal {
        font-size: 1.5rem;
    }
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(-50px) rotateX(15deg);
        box-shadow: 0 0 0 rgba(0, 0, 0, 0);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0) rotateX(0deg);
        box-shadow: 0 30px 60px rgba(0, 0, 0, 0.3), 0 0 40px rgba(255, 255, 255, 0.1);
    }
}

.modal-header {
    padding: 20px;
    background: transparent;
    color: white;
}

.modal-body {
    padding: 20px;
    background: transparent;
}

.modal-text {
    font-size: 1.2rem;
    line-height: 1.8;
    color: #333;
    margin-top: 20px;
    opacity: 0;
    animation: textReveal 1s ease-out 0.3s forwards;
}

@keyframes textReveal {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-image {
    width: 100%;
    height: auto;
    border-radius: 10px;
    max-height: 50vh;
    object-fit: cover;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.modal-motto {
    font-size: 1.1rem;
    font-style: italic;
    color: #666;
    margin: 15px 0;
    opacity: 0;
    animation: textReveal 1s ease-out 0.5s forwards;
}

.modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.like-button {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid white;
    border-radius: 50px;
    padding: 12px 24px;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
}

.like-button:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.2);
}

.audio-controls-container {
    position: fixed;
    bottom: 30px;
    left: 30px;
    z-index: 999;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.note-shape {
    position: relative;
    width: 80px;
    height: 80px;
    cursor: pointer;
    transition: all 0.3s ease;
    animation: pulse 3s infinite;
}

.note-button {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #ff6b6b 0%, #4ecdc4 50%, #45b7d1 100%);
    border: none;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 
        0 10px 20px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.3),
        inset 0 -1px 0 rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    will-change: transform, box-shadow;
}

.note-button:hover {
    transform: rotate(-45deg) scale(1.15);
    box-shadow: 
        0 15px 25px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.3),
        inset 0 -1px 0 rgba(0, 0, 0, 0.1),
        0 0 40px rgba(255, 107, 107, 0.6);
    animation: bounce 0.6s ease;
}

.note-button:active {
    transform: rotate(-45deg) scale(0.95);
    box-shadow: 
        0 5px 10px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.3),
        inset 0 -1px 0 rgba(0, 0, 0, 0.1);
}

.note-button i {
    color: white;
    font-size: 28px;
    transform: rotate(45deg);
    transition: all 0.3s ease;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.note-button:hover i {
    transform: rotate(45deg) scale(1.2);
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.3), 0 0 20px rgba(255, 255, 255, 0.5);
}

.note-shape::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 8px;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #ff5252 0%, #26a69a 50%, #0288d1 100%);
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    z-index: -1;
    box-shadow: 
        0 5px 15px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

.note-shape:hover::before {
    transform: rotate(-45deg) scale(1.08);
    box-shadow: 
        0 8px 20px rgba(0, 0, 0, 0.2),
        0 0 30px rgba(255, 107, 107, 0.4);
}

.note-shape::after {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    z-index: -2;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.note-shape:hover::after {
    opacity: 1;
    animation: shimmer 1.5s ease infinite;
}

@media (max-width: 768px) {
    .audio-controls-container {
        bottom: 20px;
        left: 20px;
    }
    
    .note-shape {
        width: 70px;
        height: 70px;
    }
    
    .note-button i {
        font-size: 24px;
    }
}

.photo-wall-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    z-index: 1000;
}

.btn-back-home {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50px;
    padding: 12px 24px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.btn-back-home:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2), 0 0 20px rgba(255, 255, 255, 0.2);
    color: white;
    background: rgba(255, 255, 255, 0.3);
}

.upload-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50px;
    padding: 12px 24px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.upload-button:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2), 0 0 20px rgba(255, 255, 255, 0.2);
    color: white;
    background: rgba(255, 255, 255, 0.3);
}
