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

html {
    overflow-y: auto;
    overflow-x: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px 20px;
    animation: gradientShift 15s ease infinite;
    background-size: 400% 400%;
    position: relative;
    overflow-x: hidden;
    overflow-y: auto;
}

body::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: float 20s linear infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes float {
    0% { transform: translate(0, 0) rotate(0deg); }
    100% { transform: translate(50px, 50px) rotate(360deg); }
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.container {
    position: relative;
    max-width: 800px;
    width: 100%;
    z-index: 1;
}

.image-link {
    text-decoration: none;
    display: block;
    cursor: pointer;
}

.image-wrapper {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37),
                inset 0 1px 0 0 rgba(255, 255, 255, 0.5),
                0 20px 60px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    padding: 20px;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    animation: floatIn 1s ease-out;
    position: relative;
}

.image-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.image-link:hover .image-wrapper::before {
    left: 100%;
}

.image-link:hover .image-wrapper {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 12px 48px 0 rgba(31, 38, 135, 0.5),
                inset 0 1px 0 0 rgba(255, 255, 255, 0.7),
                0 30px 90px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

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

.invitation-image {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 16px;
    transition: transform 0.3s ease;
    pointer-events: none;
}

.image-link:hover .invitation-image {
    transform: scale(1.02);
}

.accept-button {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: transparent;
    backdrop-filter: blur(15px) saturate(180%);
    -webkit-backdrop-filter: blur(15px) saturate(180%);
    color: white;
    padding: 20px 40px;
    border-radius: 50px;
    border: 2px solid rgba(255, 255, 255, 0.5);
    text-decoration: none;
    font-weight: 700;
    font-size: 18px;
    letter-spacing: 0.5px;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.4),
                inset 0 1px 0 0 rgba(255, 255, 255, 0.3);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: pulse 2s ease-in-out infinite;
    text-transform: uppercase;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.accept-button:hover {
    transform: translateY(-5px) scale(1.05);
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 12px 48px 0 rgba(31, 38, 135, 0.6),
                inset 0 1px 0 0 rgba(255, 255, 255, 0.5);
    border: 2px solid rgba(255, 255, 255, 0.8);
}

.accept-button:active {
    transform: translateY(-2px) scale(1.02);
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.4),
                    inset 0 1px 0 0 rgba(255, 255, 255, 0.3);
    }
    50% {
        box-shadow: 0 12px 40px 0 rgba(31, 38, 135, 0.6),
                    inset 0 1px 0 0 rgba(255, 255, 255, 0.5);
    }
}

/* Mobile optimization */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .image-wrapper {
        border-radius: 15px;
        padding: 8px;
    }
    
    .invitation-image {
        border-radius: 10px;
    }
    
    .accept-button {
        bottom: 20px;
        right: 20px;
        padding: 15px 30px;
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .accept-button {
        bottom: 15px;
        right: 15px;
        left: 15px;
        text-align: center;
        justify-content: center;
        padding: 16px 24px;
    }
}

.redirect-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.redirect-overlay.active {
    opacity: 1;
    visibility: visible;
}

.redirect-message {
    text-align: center;
    animation: fadeInScale 0.5s ease-out;
}

.redirect-message h2 {
    color: white;
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 2px;
    margin-top: 30px;
    text-transform: uppercase;
    animation: glow 1.5s ease-in-out infinite;
}

@keyframes glow {
    0%, 100% {
        text-shadow: 0 0 10px rgba(255, 255, 255, 0.5),
                     0 0 20px rgba(240, 147, 251, 0.5),
                     0 0 30px rgba(245, 87, 108, 0.5);
    }
    50% {
        text-shadow: 0 0 20px rgba(255, 255, 255, 0.8),
                     0 0 30px rgba(240, 147, 251, 0.8),
                     0 0 40px rgba(245, 87, 108, 0.8);
    }
}

.loader {
    width: 60px;
    height: 60px;
    border: 5px solid rgba(255, 255, 255, 0.2);
    border-top: 5px solid #f093fb;
    border-radius: 50%;
    margin: 0 auto;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@media (max-width: 480px) {
    .redirect-message h2 {
        font-size: 20px;
        padding: 0 20px;
    }
}

.header {
    color: white;
    font-size: 48px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 30px;
    text-transform: uppercase;
    letter-spacing: 3px;
    animation: fadeInDown 1s ease-out;
    text-shadow: 0 5px 30px rgba(0, 0, 0, 0.5);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 20px 40px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.3),
                inset 0 1px 0 0 rgba(255, 255, 255, 0.5);
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 768px) {
    .header {
        font-size: 36px;
        margin-bottom: 20px;
    }
}

@media (max-width: 480px) {
    .header {
        font-size: 28px;
        letter-spacing: 2px;
        margin-bottom: 15px;
    }
}
