/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Playfair Display', serif;
    background: 
        linear-gradient(135deg, rgba(255, 255, 255, 0.85) 0%, rgba(254, 254, 254, 0.85) 50%, rgba(248, 248, 248, 0.85) 100%),
        url('assets/fondo.jpeg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
    color: #333;
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

/* Asegurar que la imagen de fondo se mantenga visible */
html {
    background: url('assets/fondo.jpeg') center center fixed;
    background-size: cover;
    background-repeat: no-repeat;
}

/* Pseudo-elemento para mantener la imagen de fondo visible */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('assets/fondo.jpeg') center center;
    background-size: cover;
    background-repeat: no-repeat;
    background-attachment: fixed;
    z-index: -2;
    opacity: 0.3;
}

/* Main container */
.invitation-container {
    max-width: 100%;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.7);
    position: relative;
    overflow: hidden;
    box-shadow: 0 0 50px rgba(218, 165, 32, 0.1);
    backdrop-filter: blur(1px);
}

/* Floating decorative elements */
.floating-decorations {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.butterfly {
    position: absolute;
    width: 40px;
    height: 40px;
    animation: float 6s ease-in-out infinite;
}

.butterfly-1 {
    top: 15%;
    right: 10%;
    animation-delay: 0s;
}

.butterfly-2 {
    top: 60%;
    left: 5%;
    animation-delay: 3s;
    width: 30px;
    height: 30px;
}

.firefly {
    position: absolute;
    width: 8px;
    height: 8px;
    background: radial-gradient(circle, #FFD700 0%, #DAA520 70%, transparent 100%);
    border-radius: 50%;
    animation: firefly 4s ease-in-out infinite;
    box-shadow: 0 0 10px #FFD700;
}

.firefly-1 {
    top: 25%;
    left: 15%;
    animation-delay: 1s;
}

.firefly-2 {
    top: 45%;
    right: 20%;
    animation-delay: 2.5s;
}

.firefly-3 {
    top: 70%;
    left: 25%;
    animation-delay: 0.5s;
}

.firefly-4 {
    top: 85%;
    right: 15%;
    animation-delay: 3.5s;
}

.frog {
    position: absolute;
    width: 35px;
    height: 35px;
    bottom: 10%;
    right: 5%;
    animation: hop 8s ease-in-out infinite;
    opacity: 0.6;
}

/* Animations */
@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    25% { transform: translateY(-10px) rotate(5deg); }
    50% { transform: translateY(-5px) rotate(-3deg); }
    75% { transform: translateY(-15px) rotate(3deg); }
}

@keyframes firefly {
    0%, 100% { opacity: 0.3; transform: translateY(0px); }
    50% { opacity: 1; transform: translateY(-20px); }
}

@keyframes hop {
    0%, 90%, 100% { transform: translateY(0px); }
    10% { transform: translateY(-15px); }
}

@keyframes sparkle {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.2); }
}

@keyframes goldShimmer {
    0% { 
        background-position: 0% 50%; 
        transform: scale(1);
    }
    25% { 
        background-position: 100% 50%; 
        transform: scale(1.01);
    }
    50% { 
        background-position: 100% 50%; 
        transform: scale(1);
    }
    75% { 
        background-position: 0% 50%; 
        transform: scale(1.01);
    }
    100% { 
        background-position: 0% 50%; 
        transform: scale(1);
    }
}

/* Header Section */
.header-section {
    text-align: center;
    padding: 60px 20px;
    position: relative;
    z-index: 2;
}

.crown-decoration {
    width: 150px;
    height: 75px;
    margin: 0 auto 30px;
}

.main-title {
    font-family: 'Dancing Script', cursive;
    font-size: 4rem;
    font-weight: 700;
    color: #DAA520;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(218, 165, 32, 0.3);
    background: linear-gradient(45deg, #FFD700, #DAA520, #B8860B, #FFD700);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: goldShimmer 3s ease-in-out infinite;
}

.subtitle {
    font-family: 'Cinzel', serif;
    font-size: 1.5rem;
    color: #B8860B;
    letter-spacing: 3px;
    font-weight: 500;
    margin-bottom: 30px;
}

.ornament-line {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
}

.ornament {
    font-size: 1.5rem;
    color: #DAA520;
    animation: sparkle 2s ease-in-out infinite;
}

.line {
    width: 80px;
    height: 2px;
    background: linear-gradient(90deg, transparent, #DAA520, transparent);
}

/* Photo Sections */
.photo-section {
    padding: 40px 20px;
    text-align: center;
    position: relative;
    z-index: 2;
}

/* Audio Player Section */
.audio-player-section {
    padding: 30px 20px;
    text-align: center;
    position: relative;
    z-index: 2;
}

.audio-player-container {
    max-width: 400px;
    margin: 0 auto;
}

.audio-player {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 248, 248, 0.95) 100%);
    border-radius: 20px;
    padding: 25px;
    box-shadow: 
        0 15px 35px rgba(218, 165, 32, 0.2),
        0 0 0 2px rgba(255, 215, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(218, 165, 32, 0.4);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.audio-player::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 215, 0, 0.1) 50%, transparent 70%);
    animation: shimmer 3s ease-in-out infinite;
    pointer-events: none;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.player-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
}

.music-icon {
    font-size: 2rem;
    animation: musicBounce 2s ease-in-out infinite;
}

@keyframes musicBounce {
    0%, 100% { transform: scale(1) rotate(0deg); }
    50% { transform: scale(1.1) rotate(5deg); }
}

.player-title {
    font-family: 'Cinzel', serif;
    font-size: 1.3rem;
    color: #DAA520;
    font-weight: 600;
    text-shadow: 1px 1px 2px rgba(218, 165, 32, 0.3);
}

.player-controls {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 25px;
}

.control-btn {
    background: linear-gradient(45deg, #FFD700, #DAA520);
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 
        0 4px 15px rgba(218, 165, 32, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    position: relative;
    overflow: hidden;
}

.control-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.3) 50%, transparent 70%);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}

.control-btn:hover::before {
    transform: translateX(100%);
}

.control-btn:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 
        0 6px 20px rgba(218, 165, 32, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.control-btn:active {
    transform: scale(0.95);
}

.control-btn span {
    font-size: 1.2rem;
    filter: drop-shadow(1px 1px 2px rgba(0, 0, 0, 0.2));
}

.progress-container {
    position: relative;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: linear-gradient(90deg, rgba(218, 165, 32, 0.2), rgba(255, 215, 0, 0.1));
    border-radius: 10px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    margin-bottom: 10px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #FFD700, #DAA520, #B8860B);
    border-radius: 10px;
    width: 0%;
    transition: width 0.1s ease;
    position: relative;
    box-shadow: 0 2px 4px rgba(218, 165, 32, 0.3);
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent 30%, rgba(255, 255, 255, 0.3) 50%, transparent 70%);
    animation: progressShimmer 2s ease-in-out infinite;
}

@keyframes progressShimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.time-display {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: #666;
    font-family: 'Playfair Display', serif;
    font-weight: 500;
}

.time-display span {
    background: rgba(218, 165, 32, 0.1);
    padding: 4px 8px;
    border-radius: 8px;
    border: 1px solid rgba(218, 165, 32, 0.2);
}

/* Audio Player Responsive */
@media (max-width: 768px) {
    .audio-player-section {
        padding: 25px 15px;
    }
    
    .audio-player {
        padding: 20px;
        border-radius: 15px;
    }
    
    .player-title {
        font-size: 1.1rem;
    }
    
    .control-btn {
        width: 45px;
        height: 45px;
    }
    
    .control-btn span {
        font-size: 1rem;
    }
    
    .player-controls {
        gap: 15px;
    }
}

@media (max-width: 480px) {
    .audio-player-container {
        max-width: 320px;
    }
    
    .audio-player {
        padding: 15px;
    }
    
    .player-header {
        gap: 10px;
        margin-bottom: 15px;
    }
    
    .music-icon {
        font-size: 1.5rem;
    }
    
    .player-title {
        font-size: 1rem;
    }
    
    .control-btn {
        width: 40px;
        height: 40px;
    }
    
    .control-btn span {
        font-size: 0.9rem;
    }
    
    .player-controls {
        gap: 12px;
        margin-bottom: 20px;
    }
    
    .time-display {
        font-size: 0.8rem;
    }
}

.photo-frame {
    position: relative;
    display: inline-block;
    max-width: 350px;
    width: 100%;
    height: 450px;
    background: linear-gradient(45deg, #FFD700 0%, #DAA520 25%, #B8860B 50%, #DAA520 75%, #FFD700 100%);
    background-size: 400% 400%;
    animation: goldShimmer 6s ease-in-out infinite;
    border-radius: 36px;
    box-shadow: 
        0 10px 30px rgba(218, 165, 32, 0.4),
        0 0 0 3px rgba(255, 215, 0, 0.6),
        inset 0 0 0 2px rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
    border: 2px solid rgba(255, 215, 0, 0.8);
    box-sizing: border-box;
    padding: 0;
    overflow: hidden !important;
    contain: layout style paint;
}

.photo-frame {
    --bg-image: none;
}

.photo-frame::after {
    content: '';
    position: absolute;
    top: 14px;
    left: 14px;
    right: 14px;
    bottom: 14px;
    border-radius: 22px;
    background-image: var(--bg-image);
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border: 3px solid white;
    transition: transform 0.3s ease;
}

/* Las imágenes se establecerán con JavaScript */

.photo-frame:hover {
    transform: scale(1.05) rotate(1deg);
    box-shadow: 
        0 20px 40px rgba(218, 165, 32, 0.6),
        0 0 0 4px rgba(255, 215, 0, 0.8),
        inset 0 0 0 3px rgba(255, 255, 255, 0.5);
    animation: goldShimmer 2s ease-in-out infinite;
}

.photo-frame:hover::after {
    transform: scale(1.02);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.2);
}

/* Remove the separate photo-border as it's now integrated into photo-frame */
.photo-border {
    display: none;
}

/* Section Titles */
.section-title {
    font-family: 'Cinzel', serif;
    font-size: 2.5rem;
    color: #DAA520;
    text-align: center;
    margin-bottom: 30px;
    font-weight: 600;
    text-shadow: 1px 1px 2px rgba(218, 165, 32, 0.2);
}

/* Transition Section */
.transition-section {
    padding: 60px 20px;
    /* background: linear-gradient(135deg, #fefefe 0%, #f8f8f8 100%); */
    position: relative;
    z-index: 2;
}

.message-container {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}

.transition-message {
    font-size: 1.2rem;
    color: #666;
    line-height: 1.8;
    font-style: italic;
    margin-bottom: 30px;
}

.magic-sparkles {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 20px;
}

.sparkle {
    font-size: 2rem;
    animation: sparkle 1.5s ease-in-out infinite;
}

.sparkle:nth-child(2) {
    animation-delay: 0.5s;
}

.sparkle:nth-child(3) {
    animation-delay: 1s;
}

/* Parents Section */
.parents-section {
    padding: 60px 20px;
    text-align: center;
    position: relative;
    z-index: 2;
}

.parents-container {
    max-width: 600px;
    margin: 0 auto;
}

.parents-text {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 40px;
    line-height: 1.7;
}

.parents-names {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.parent-name {
    font-family: 'Dancing Script', cursive;
    font-size: 2.2rem;
    color: #DAA520;
    font-weight: 600;
}

.ampersand {
    font-family: 'Cinzel', serif;
    font-size: 2rem;
    color: #B8860B;
    margin: 10px 0;
}

/* Event Details Section */
.event-details {
    padding: 60px 20px;
    position: relative;
    z-index: 2;
}

.details-container {
    max-width: 600px;
    margin: 0 auto;
    display: grid;
    gap: 30px;
}

.detail-item {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    padding: 25px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 25px rgba(218, 165, 32, 0.1);
    border: 1px solid rgba(218, 165, 32, 0.2);
}

.detail-icon {
    font-size: 2rem;
    background: linear-gradient(45deg, #FFD700, #DAA520);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    width: 100% !important;
    text-align: center !important;
}

.detail-content {
    width: 100% !important;
    text-align: center !important;
}

.detail-content h3 {
    font-family: 'Cinzel', serif;
    font-size: 1.3rem;
    color: #DAA520;
    margin-bottom: 8px;
}

.detail-content p {
    color: #666;
    font-size: 1.1rem;
    margin-bottom: 5px;
    width: 100% !important;
    text-align: center !important;
}

.address {
    font-size: 1rem !important;
    color: #888 !important;
}

/* Dress Code Section */
.dress-code-section {
    padding: 60px 20px;
    /* background: linear-gradient(135deg, #fefefe 0%, #f8f8f8 100%); */    
    text-align: center;
    position: relative;
    z-index: 2;
}

.dress-code-container {
    max-width: 600px;
    margin: 0 auto;
}

.dress-code-content {
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(218, 165, 32, 0.1);
    border: 2px solid rgba(218, 165, 32, 0.2);
}

.dress-code-icon {
    font-size: 3rem;
    margin-bottom: 20px;
    animation: sparkle 2s ease-in-out infinite;
}

.dress-code-message {
    font-size: 1.2rem;
    color: #666;
    line-height: 1.7;
    margin-bottom: 30px;
}

.green-reserved {
    color: #228B22;
    font-weight: 600;
    background: linear-gradient(45deg, #90EE90, #32CD32);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.dress-code-details {
    display: flex;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
}

.dress-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 20px;
    background: linear-gradient(135deg, #f8f8f8, #ffffff);
    border-radius: 15px;
    border: 1px solid rgba(218, 165, 32, 0.3);
    transition: transform 0.3s ease;
}

.dress-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(218, 165, 32, 0.2);
}

.dress-icon {
    font-size: 1.5rem;
}

/* Gift Section */
.gift-section {
    padding: 60px 20px;
    text-align: center;
    position: relative;
    z-index: 2;
}

.gift-container {
    max-width: 500px;
    margin: 0 auto;
}

.gift-message {
    font-size: 1.1rem;
    color: #666;
    line-height: 1.7;
    font-style: italic;
    margin-bottom: 30px;
}

.gift-icon {
    font-size: 3rem;
    animation: sparkle 2s ease-in-out infinite;
}

/* Final Section */
.final-section {
    padding: 60px 20px;
    /* background: linear-gradient(135deg, #fefefe 0%, #f8f8f8 100%); */
    text-align: center;
    position: relative;
    z-index: 2;
}

.final-container {
    max-width: 500px;
    margin: 0 auto;
}

.final-message {
    font-size: 1.2rem;
    color: #666;
    line-height: 1.8;
    font-style: italic;
    margin-bottom: 40px;
}

.signature {
    font-family: 'Dancing Script', cursive;
    font-size: 1.5rem;
    color: #888;
    margin-bottom: 10px;
}

.signature-name {
    font-family: 'Dancing Script', cursive;
    font-size: 3rem;
    color: #DAA520;
    font-weight: 600;
    margin-bottom: 30px;
}

.final-decoration {
    display: flex;
    justify-content: center;
    gap: 20px;
    font-size: 2rem;
}

.heart, .crown-small {
    animation: sparkle 2s ease-in-out infinite;
}

.crown-small {
    animation-delay: 1s;
}

/* Responsive Design */
@media (max-width: 768px) {
    .main-title {
        font-size: 3rem;
    }
    
    .subtitle {
        font-size: 1.2rem;
        letter-spacing: 2px;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .transition-message,
    .parents-text,
    .gift-message,
    .final-message {
        font-size: 1rem;
    }
    
    .parent-name {
        font-size: 1.8rem;
    }
    
    .signature-name {
        font-size: 2.5rem;
    }
    
    .detail-item {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .parents-names {
        gap: 5px;
    }
    
    .magic-sparkles {
        gap: 20px;
    }
    
    .dress-code-details {
        flex-direction: column;
        gap: 20px;
    }
    
    .dress-code-content {
        padding: 25px 15px;
    }
    
    .dress-code-message {
        font-size: 1rem;
    }
    
    .dress-item {
        padding: 12px 15px;
    }
}

@media (max-width: 480px) {
    .header-section,
    .transition-section,
    .parents-section,
    .event-details,
    .dress-code-section,
    .gift-section,
    .final-section {
        padding: 40px 15px;
    }
    
    .photo-section {
        padding: 30px 15px;
    }
    
    .photo-frame {
        height: 320px;
        border: 1px solid rgba(255, 215, 0, 0.8);
        overflow: hidden !important;
    }
    
    .photo-frame::after {
        top: 10px;
        left: 10px;
        right: 10px;
        bottom: 10px;
        border-radius: 18px;
    }
    
    .main-title {
        font-size: 2.5rem;
    }
    
    .section-title {
        font-size: 1.8rem;
    }
    
    .crown-decoration {
        width: 120px;
        height: 60px;
    }
    
    .ornament-line .line {
        width: 60px;
    }
    
    .butterfly-1,
    .butterfly-2 {
        width: 25px;
        height: 25px;
    }
    
    .firefly {
        width: 6px;
        height: 6px;
    }
    
    .frog {
        width: 25px;
        height: 25px;
    }
}

/* 9:16 Aspect Ratio Optimization for Video Recording */
@media (aspect-ratio: 9/16) {
    .invitation-container {
        max-width: 100vw;
        min-height: 100vh;
        display: flex;
        flex-direction: column;
    }
    
    .header-section {
        padding: 40px 20px;
    }
    
    .main-title {
        font-size: 2.8rem;
    }
    
    .section-title {
        font-size: 1.8rem;
        margin-bottom: 20px;
    }
    
    .photo-section {
        padding: 20px;
    }
    
    .photo-frame {
        max-width: 280px;
        height: 380px;
        border: 1px solid rgba(255, 215, 0, 0.8);
        overflow: hidden !important;
    }
    
    .photo-frame::after {
        top: 12px;
        left: 12px;
        right: 12px;
        bottom: 12px;
    }
    
    .transition-section,
    .parents-section,
    .event-details,
    .dress-code-section,
    .gift-section,
    .final-section {
        padding: 30px 20px;
    }
    
    .floating-decorations {
        opacity: 0.7;
    }
    
    .butterfly-1,
    .butterfly-2 {
        width: 20px;
        height: 20px;
    }
    
    .firefly {
        width: 5px;
        height: 5px;
    }
    
    .frog {
        width: 20px;
        height: 20px;
    }
}

/* Portrait orientation specific */
@media (orientation: portrait) {
    .parents-names {
        flex-direction: column;
    }
    
    .magic-sparkles,
    .final-decoration {
        gap: 15px;
    }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .quinceañera-photo {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}
