/* Modern, elegant & romantic wedding website styles */
:root {
    --main-bg: #f5f5f5;
    --accent: #eec9d2;
    --primary: #b5838d;
    --secondary: #6d6875;
    --text: #3e3e3e;
    --white: #f5f5f5;
    --shadow: 0 8px 32px rgba(111, 78, 55, 0.08);
    --radius: 18px;
    --transition: 0.3s cubic-bezier(.4,2,.6,1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Montserrat', Arial, sans-serif;
    background: 
        linear-gradient(to bottom, #87CEEB 0%, transparent 10%, transparent 90%, #87CEEB 100%),
        url('images/sectiune%20fundal%20final.jpg') center 20%/cover no-repeat fixed;
    color: var(--text);
    overflow-x: hidden;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    position: relative;
    border: none;
    outline: none;
    animation: slowZoomToFaces 20s ease-in-out infinite alternate;
}

@media (max-width: 768px) {
    body {
        background: 
            linear-gradient(to bottom, #87CEEB 0%, transparent 15%, transparent 85%, #87CEEB 100%),
            url('images/sectiune%20fundal%20final.jpg') center center/cover no-repeat fixed;
        animation: mobileZoomOnly 15s ease-in-out infinite alternate;
    }
}

@keyframes slowZoomToFaces {
    0% {
        background-position: center 20%;
        background-size: cover;
    }
    100% {
        background-position: center 30%;
        background-size: cover;
    }
}

@keyframes mobileZoomOnly {
    0% {
        background-size: cover;
    }
    100% {
        background-size: cover;
        transform: scale(1.1);
    }
}

/* Force remove any white space */
section {
    display: block;
    margin: 0;
    padding: 0;
    border: none;
    outline: none;
}

main {
    margin: 0;
    padding: 0;
    display: block;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.5rem;
    width: 100%;
    text-align: center;
}

html {
    margin: 0;
    padding: 0;
    height: 100%;
    overflow-x: hidden;
}

/* Navigation */
.navbar {
    background: var(--white);
    box-shadow: var(--shadow);
    padding: 1.2rem 0;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    margin: 0;
    height: auto;
}

.nav-flex {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    color: var(--primary);
    font-weight: 700;
    letter-spacing: 2px;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 2.5rem;
    margin: 0;
}

.nav-links a {
    text-decoration: none;
    color: var(--secondary);
    font-weight: 500;
    font-size: 1.1rem;
    transition: color var(--transition);
    position: relative;
}

.nav-links a::after {
    content: '';
    display: block;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: width var(--transition);
    position: absolute;
    left: 0;
    bottom: -4px;
}

.nav-links a:hover {
    color: var(--primary);
}

.nav-links a:hover::after {
    width: 100%;
}

/* Hero Section with dual background videos (fully transparent) */
.hero {
    height: 100vh;
    min-height: 100vh;
    width: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    overflow: hidden;
    margin: 0;
    padding: 0;
    background: transparent; /* fully transparent to show main background */
}
@supports (height: 100svh) { .hero { height: 100svh; min-height: 100svh; } }
@supports (height: 100dvh) { .hero { height: 100dvh; min-height: 100dvh; } }

.hero-media-container { position: absolute; inset: 0; width:100%; height:100%; overflow:hidden; }
.hero-video { position:absolute; top:0; left:0; width:100%; height:100%; object-fit:cover; opacity:0; transition:opacity 4s ease-in-out; pointer-events:none; transform:scale(1.01); }
.hero-video.active { opacity:1; }
.hero-overlay { position:absolute; inset:0; background:rgba(0,0,0,0.4); }

.hero-content { position:relative; z-index:2; text-align:center; color:#fff; padding:0 2rem 3rem; }
.hero-content h1 { font-family:'Playfair Display', serif; font-size:3rem; margin:0 0 1.2rem; text-shadow:2px 2px 4px rgba(0,0,0,0.55); }
.hero-content p { font-size:1.25rem; margin:0; text-shadow:1px 1px 3px rgba(0,0,0,0.5); }

@media (max-width: 600px) { .hero-content h1 { font-size:2.2rem; } .hero-content p { font-size:1.05rem; } }

/* About Section */
.about-section {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin: 3rem 0;
    padding: 3rem 0 2rem 0;
}

.about-section h2 {
    font-family: 'Playfair Display', serif;
    color: var(--primary);
    font-size: 2.2rem;
    text-align: center;
    margin-bottom: 2rem;
}

.about-section p {
    text-align: center;
    font-size: 1.15rem;
    margin-bottom: 2.5rem;
}

.event-details {
    display: flex;
    gap: 2rem;
    justify-content: center;
    flex-wrap: wrap;
}

.event-box {
    background: var(--accent);
    color: var(--secondary);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 2rem 1.5rem;
    min-width: 220px;
    max-width: 320px;
    flex: 1 1 220px;
    text-align: center;
    margin-bottom: 1.5rem;
}

.event-box h3 {
    font-family: 'Playfair Display', serif;
    color: var(--primary);
    font-size: 1.3rem;
    margin-bottom: 0.7rem;
}

/* Special Section */
/* Special Section */

/* Gallery Section with semi-transparent background */
.gallery-section {
    background: 
        linear-gradient(to bottom, #87CEEB 0%, rgba(245,245,245,0.85) 15%, rgba(245,245,245,0.85) 85%, #87CEEB 100%);
    backdrop-filter: blur(5px);
    margin: 0 !important;
    padding: 3rem 0 1rem 0;
    position: relative;
}

.gallery-section h2 {
    font-family: 'Playfair Display', serif;
    color: var(--primary);
    font-size: 2.2rem;
    text-align: center;
    margin: 0 0 1rem 0; /* remove top margin to minimize white space */
}

.gallery-description {
    text-align: center;
    font-size: 1.1rem;
    color: var(--primary);
    font-style: italic;
    margin-bottom: 3rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.gallery-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 2rem;
    margin: 0 auto 2rem auto;
    max-width: 800px;
    width: 100%;
    justify-content: center;
    align-content: center;
    text-align: left;
}

.gallery-thank-you {
    text-align: center;
    font-size: 1.2rem;
    color: var(--primary);
    font-style: italic;
    margin: 2rem auto 0 auto;
    max-width: 500px;
    font-weight: 500;
}

.gallery-card {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: all var(--transition);
    height: 250px;
}

.gallery-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(111, 78, 55, 0.2);
}

.card-image {
    position: relative;
    width: 100%;
    height: 100%;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition);
}

/* Poziționare specială pentru imaginea de copertă cununie civilă */
.gallery-card[data-gallery="cununie"] .card-image img {
    object-position: center 30%;
}

.gallery-card:hover .card-image img {
    transform: scale(1.05);
}

.card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: auto;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.95), rgba(0, 0, 0, 0.8), transparent);
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: flex-start;
    text-align: left;
    opacity: 1;
    padding: 15px 15px 10px 15px;
    transition: all 0.3s ease;
}

.gallery-card:hover .card-overlay {
    opacity: 1;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.95), rgba(0, 0, 0, 0.8), transparent);
    height: 100%;
    justify-content: center;
}

.card-overlay h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    color: #fff;
    font-weight: 700;
    animation: elegant-typing 4s ease-in-out infinite;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    letter-spacing: 1px;
}

.card-overlay p {
    font-size: 1rem;
    margin: 0.5rem 0;
    opacity: 0;
    color: white;
    display: none;
}

.photo-count {
    font-size: 0.9rem;
    opacity: 0.8;
    margin-top: 0.3rem;
    color: white;
}

@keyframes elegant-typing {
    0%, 100% {
        letter-spacing: 1px;
        opacity: 1;
    }
    50% {
        letter-spacing: 2px;
        opacity: 0.9;
    }
}

/* Footer */
.footer {
    background: var(--primary);
    color: var(--white);
    text-align: center;
    padding: 2rem 0 1rem 0;
    margin-top: 0;
    font-size: 1.1rem;
    letter-spacing: 1px;
}

/* Mobile Responsive */
@media (min-width: 1024px) {
    .special-section {
        height: 100vh;
        min-height: 800px;
        background-size: contain;
        margin: 5rem 0;
    }
    
    .gallery-section { margin: 0 !important; }
}

@media (min-width: 769px) and (max-width: 1023px) {
    .special-section {
        height: 90vh;
        min-height: 650px;
        background-size: contain;
        margin: 3rem 0;
    }
    
    .gallery-section { margin: 0 !important; }
}

@media (max-width: 900px) {
    .event-details {
        flex-direction: column;
        align-items: center;
    }
}

@media (max-width: 600px) {
    .hero-content h1 {
        font-size: 2rem;
    }
    .about-section, .gallery-section {
        padding: 2rem 0 1rem 0;
    }
    .event-box {
        padding: 1.2rem 0.7rem;
    }
    .gallery-img {
        height: 140px;
    }
}

/* Modal Gallery Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 1000;
}

.modal-content {
    position: relative;
    margin: 5% auto;
    width: 90%;
    max-width: 1200px;
    max-height: 80vh;
    overflow-y: auto;
    background: var(--white);
    border-radius: var(--radius);
    padding: 2rem;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    border-bottom: 2px solid var(--light);
    padding-bottom: 1rem;
}

.modal-header h2 {
    font-family: 'Playfair Display', serif;
    color: var(--primary);
    font-size: 2rem;
    margin: 0;
}

.close-modal {
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--primary);
    cursor: pointer;
    transition: all var(--transition);
}

.close-modal:hover {
    color: var(--accent);
    transform: scale(1.1);
}

.modal-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.modal-gallery-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: var(--radius);
    cursor: pointer;
    transition: transform var(--transition);
}

.modal-gallery-img:hover {
    transform: scale(1.05);
}

/* Image Modal for full-size viewing */
#image-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 1001;
    align-items: center;
    justify-content: center;
}

.image-modal-content {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    max-width: 90%;
    max-height: 90%;
}

#full-size-image {
    max-width: 85%;
    max-height: 85%;
    border-radius: var(--radius);
    object-fit: contain;
}

.nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    border: none;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    font-size: 2rem;
    color: var(--primary);
    cursor: pointer;
    transition: all var(--transition);
    z-index: 1002;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-btn:hover {
    background: var(--white);
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.prev-btn {
    left: 2rem;
}

.next-btn {
    right: 2rem;
}

.close-btn {
    position: absolute;
    top: 2rem;
    right: 2rem;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 1.5rem;
    color: var(--primary);
    cursor: pointer;
    transition: all var(--transition);
    z-index: 1002;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    background: var(--white);
    transform: scale(1.1);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.photo-info {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: var(--white);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    z-index: 1002;
}

.photo-info p {
    margin: 0;
    font-size: 1rem;
    font-weight: 500;
}

/* Modal responsive styles */
@media (max-width: 768px) {
    .gallery-section {
        background: 
            linear-gradient(to bottom, #87CEEB 0%, rgba(245,245,245,0.85) 15%, rgba(245,245,245,0.85) 85%, #87CEEB 100%) !important;
        backdrop-filter: blur(5px);
    }
    
    .gallery-cards {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        gap: 1.5rem;
        max-width: 400px;
    }
    
    .special-section {
        height: 50vh;
        min-height: 300px;
        background-attachment: fixed;
        width: 100vw;
        margin-left: calc(-50vw + 50%);
    }
    
    .modal-content {
        margin: 2% auto;
        width: 95%;
        padding: 1rem;
    }
    
    .modal-gallery-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
    
    .modal-gallery-img {
        height: 150px;
    }
}

/* PIN Modal Styles */
.pin-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    backdrop-filter: blur(5px);
}

.pin-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.pin-modal-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
    max-width: 420px;
    width: 90%;
    overflow: hidden;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.7) translateY(-50px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.pin-modal-header {
    background: rgba(255, 255, 255, 0.1);
    padding: 25px 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.pin-modal-header h3 {
    color: white;
    font-size: 1.4em;
    margin: 0;
    font-weight: 600;
}

.pin-close {
    color: white;
    font-size: 28px;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.pin-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.pin-modal-body {
    padding: 30px;
    text-align: center;
}

.pin-modal-body p {
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 25px;
    font-size: 1.1em;
}

.pin-input-container {
    position: relative;
    margin-bottom: 15px;
}

#pin-input {
    width: 100%;
    padding: 15px 20px;
    font-size: 1.1em;
    text-align: center;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.9);
    letter-spacing: 0.1em;
    transition: all 0.3s ease;
}

#pin-input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.8);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.2);
    background: #f5f5f5;
}

.pin-error {
    color: #ffeb3b;
    font-size: 0.9em;
    font-weight: 500;
    min-height: 20px;
    margin-top: 10px;
}

.pin-modal-footer {
    padding: 20px 30px 30px;
    display: flex;
    gap: 15px;
    justify-content: center;
}

.pin-btn {
    padding: 12px 25px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 500;
    transition: all 0.3s ease;
    min-width: 100px;
}

.pin-submit {
    background: #4CAF50;
    color: white;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
}

.pin-submit:hover {
    background: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
}

.pin-cancel {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.pin-cancel:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

/* Image optimization and compression styles */
.image-placeholder {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.image-full {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Optimized loading states */
.loading-image {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* Lazy loading optimization */
img[data-src] {
    opacity: 0;
    transition: opacity 0.3s ease;
}

img[data-loaded="true"] {
    opacity: 1;
}
/* end mobile pin modal */

/* Removed special-section; restore original hero/gallery seam styling */
/* Restore simple seam lines */
.hero { border-bottom:none; }
.gallery-section::before { content:none; }

/* Background reveal space - transparent area to show main background */
.background-reveal {
    width: 100%;
    height: clamp(600px, 60vh, 800px);
    background: transparent;
    margin: 0;
    padding: 0;
    display: block;
    position: relative;
    z-index: 1;
}

/* Seamless integration */
.hero + .background-reveal { margin-top: 0; }
.background-reveal + .gallery-section { margin-top: 0; }

@media (max-width: 768px) {
    .background-reveal {
        height: clamp(400px, 50vh, 600px);
    }
    
    .gallery-section {
        background: rgba(245,245,245,0.85);
        backdrop-filter: blur(5px);
    }
}


/* Memory efficient image display */
.gallery-image {
    image-rendering: auto;
    image-rendering: crisp-edges;
    image-rendering: -webkit-optimize-contrast;
}

/* Responsive image sizing */
@media (max-width: 768px) {
    .modal-content img {
        max-width: 100vw;
        max-height: 80vh;
        object-fit: contain;
    }
}

@media (max-width: 480px) {
    .modal-content img {
        max-height: 70vh;
    }
}

/* Mobile responsive */
@media (max-width: 480px) {
    .pin-modal-content {
        margin: 20px;
        max-width: none;
    }
    
    .pin-modal-header,
    .pin-modal-body,
    .pin-modal-footer {
        padding: 20px;
    }
    
    .pin-modal-footer {
        flex-direction: column;
    }
    
    .pin-btn {
        width: 100%;
    }
}
