:root {
    --primary: #cda434; /* Oro elegante */
    --primary-light: #e5c365;
    --primary-dark: #a37c1c;
    --text-main: #2c3e50;
    --text-light: #f5f5f5;
    --bg-color: #fcfcfc;
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(205, 164, 52, 0.3);
    
    --font-display: 'Cormorant Garamond', serif;
    --font-sans: 'Montserrat', sans-serif;
    
    --shadow-soft: 0 8px 32px rgba(0, 0, 0, 0.08);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-color);
    color: var(--text-main);
    overflow-x: hidden;
    /* Bloquear selección en toda la página */
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

/* Views */
.view {
    display: none;
    min-height: 100vh;
    width: 100%;
}
.view.active {
    display: flex;
    flex-direction: column;
}

/* Hero Section */
.hero {
    position: relative;
    padding: 4rem 1.5rem;
    text-align: center;
    background: linear-gradient(to bottom, rgba(252,252,252,1) 0%, rgba(245,245,245,1) 100%);
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%; left: -50%; width: 200%; height: 200%;
    background: radial-gradient(circle, rgba(205,164,52,0.05) 0%, rgba(255,255,255,0) 70%);
    z-index: 0;
}

.glass-panel {
    position: relative;
    z-index: 1;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 3rem 2rem;
    margin: 0 auto;
    max-width: 600px;
    box-shadow: var(--shadow-soft);
}

.date {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 4px;
    color: var(--primary);
    margin-bottom: 1rem;
    font-weight: 500;
}

h1 {
    font-family: var(--font-display);
    font-size: 3.5rem;
    line-height: 1.1;
    color: var(--text-main);
    margin-bottom: 1.5rem;
    font-weight: 600;
}

h1 br {
    display: none;
}
@media (max-width: 480px) {
    h1 { font-size: 2.8rem; }
    h1 br { display: block; }
}

.subtitle {
    font-size: 1rem;
    color: #666;
    line-height: 1.5;
}

/* Actions Section */
.actions {
    padding: 2rem 1.5rem;
    max-width: 600px;
    margin: 0 auto;
    width: 100%;
}

.input-group {
    position: relative;
    margin-bottom: 1.5rem;
}

.input-group i {
    position: absolute;
    left: 1.2rem;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
}

#guest-name {
    width: 100%;
    padding: 1.2rem 1.2rem 1.2rem 3rem;
    border: 2px solid #eee;
    border-radius: 16px;
    font-family: var(--font-sans);
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
}

#guest-name:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(205, 164, 52, 0.1);
}

.buttons {
    display: flex;
    gap: 1rem;
    flex-direction: column;
}
@media (min-width: 480px) {
    .buttons { flex-direction: row; }
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    padding: 1.2rem;
    border-radius: 16px;
    font-family: var(--font-sans);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    text-decoration: none;
    flex: 1;
}

.btn.primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    box-shadow: 0 4px 15px rgba(205, 164, 52, 0.3);
}

.btn.primary:active {
    transform: scale(0.98);
}

.btn.secondary {
    background: white;
    color: var(--primary-dark);
    border: 2px solid var(--primary-light);
}

/* Gallery */
.gallery-section {
    padding: 2rem 1.5rem;
    flex-grow: 1;
    background: white;
    border-radius: 30px 30px 0 0;
    box-shadow: 0 -10px 30px rgba(0,0,0,0.03);
}

.gallery-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
}

.gallery-header h2 {
    font-family: var(--font-display);
    font-size: 2rem;
    color: var(--text-main);
}

.btn-icon {
    background: none;
    border: none;
    color: #ccc;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.5rem;
    transition: color 0.3s;
}
.btn-icon:hover { color: var(--primary); }

.gallery-grid {
    column-count: 2;
    column-gap: 1rem;
    max-width: 1000px;
    margin: 0 auto;
}
@media (min-width: 768px) {
    .gallery-grid { column-count: 3; column-gap: 1.5rem; }
}
@media (min-width: 1024px) {
    .gallery-grid { column-count: 4; column-gap: 1.5rem; }
}

.photo-card {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    background: #eee;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    animation: fadeIn 0.5s ease-out;
    break-inside: avoid;
    margin-bottom: 1rem;
    cursor: pointer; /* Indicar que se puede tocar */
    transition: transform 0.3s, box-shadow 0.3s;
}

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

.photo-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(205, 164, 52, 0.2);
}

.photo-card img {
    width: 100%;
    display: block; /* Evitar espacio extra abajo */
    transition: transform 0.5s;
    pointer-events: none;
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

.photo-card:hover img {
    transform: scale(1.05);
}

/* Camera View Fullscreen */
#camera-view {
    position: fixed;
    top: 0; left: 0; width: 100%; 
    height: 100vh; /* Fallback */
    height: 100dvh; /* Dynamic viewport height para móviles */
    background: #000;
    z-index: 100;
}

.camera-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

#camera-feed {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.camera-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 120px;
    pointer-events: none;
    padding: 2rem;
}

.frame-corners {
    width: 100%; height: 100%;
    border: 2px solid transparent;
    background: 
        linear-gradient(var(--primary), var(--primary)) top left,
        linear-gradient(var(--primary), var(--primary)) top left,
        linear-gradient(var(--primary), var(--primary)) bottom left,
        linear-gradient(var(--primary), var(--primary)) bottom left,
        linear-gradient(var(--primary), var(--primary)) top right,
        linear-gradient(var(--primary), var(--primary)) top right,
        linear-gradient(var(--primary), var(--primary)) bottom right,
        linear-gradient(var(--primary), var(--primary)) bottom right;
    background-size: 2px 20px, 20px 2px;
    background-repeat: no-repeat;
    opacity: 0.8;
}

.camera-controls {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: auto;
    min-height: 140px;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 2rem;
    padding-bottom: calc(4rem + env(safe-area-inset-bottom, 0px)); /* Levantado radicalmente */
    z-index: 10;
}

.btn-icon.circle {
    width: 50px; height: 50px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    color: white;
    font-size: 1.2rem;
}

.btn-capture {
    width: 70px; height: 70px;
    border-radius: 50%;
    background: transparent;
    border: 4px solid white;
    padding: 4px;
    cursor: pointer;
}

.inner-circle {
    width: 100%; height: 100%;
    border-radius: 50%;
    background: white;
    transition: transform 0.1s;
}
.btn-capture:active .inner-circle {
    transform: scale(0.9);
}

/* Modals & Notifications */
.modal {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 200;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal.active { display: flex; }

.modal-content {
    background: white;
    width: 100%; max-width: 400px;
    padding: 2rem;
    border-radius: 20px;
    position: relative;
    text-align: center;
}

.close-modal {
    position: absolute; top: 1rem; right: 1.5rem;
    font-size: 1.5rem; cursor: pointer; color: #999;
}

.modal h2 { margin-bottom: 1rem; font-family: var(--font-display); }
.modal p { margin-bottom: 1.5rem; color: #666; font-size: 0.9rem; }
.modal input {
    width: 100%; padding: 1rem; margin-bottom: 1.5rem;
    border: 1px solid #ddd; border-radius: 12px;
}

.notification {
    position: fixed;
    top: -100px; left: 50%;
    transform: translateX(-50%);
    background: var(--primary);
    color: white;
    padding: 1rem 2rem;
    border-radius: 30px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    transition: top 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 300;
    font-weight: 500;
}
.notification.show { top: 20px; }

/* Lightbox Modal */
.lightbox {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.9);
    backdrop-filter: blur(10px);
    z-index: 999;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox.active {
    display: flex;
    opacity: 1;
}

.lightbox img {
    max-width: 100%;
    max-height: 90vh;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    pointer-events: none; /* Seguridad */
    -webkit-user-select: none;
    user-select: none;
}

.close-lightbox {
    position: absolute;
    top: 20px; right: 30px;
    color: white;
    font-size: 3rem;
    cursor: pointer;
    z-index: 1000;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

/* Partículas CSS de Fondo */
#particles {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    overflow: hidden;
    z-index: 0;
    pointer-events: none;
}

.particle {
    position: absolute;
    background: radial-gradient(circle, rgba(205,164,52,0.8) 0%, rgba(205,164,52,0) 70%);
    border-radius: 50%;
    animation: floatUp infinite linear;
}

@keyframes floatUp {
    0% { transform: translateY(100vh) scale(0); opacity: 0; }
    20% { opacity: 0.6; }
    80% { opacity: 0.6; }
    100% { transform: translateY(-10vh) scale(1.5); opacity: 0; }
}
