/* Wedding Planner - Elegant Wedding Theme */

:root {
    --primary-gold: #d4af37;
    --secondary-gold: #b8860b;
    --pastel-pink: #f8e8e8;
    --soft-pink: #ffe4e1;
    --white: #ffffff;
    --light-gray: #f8f9fa;
    --dark-text: #6b6b6b;
    --shadow: rgba(212, 175, 55, 0.2);
    --gradient: linear-gradient(135deg, var(--pastel-pink) 0%, var(--soft-pink) 50%, var(--white) 100%);
    --site-scale: 0.75; /* globalna skala strony - domyślnie 0.75 */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Playfair Display', serif;
    background: var(--gradient);
    background-attachment: fixed;
    color: var(--dark-text);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
    /* scaling applied via feature-detected blocks below */
}

/* Prefer `zoom` where supported (keeps fixed positioning behavior), fallback to `transform` otherwise */
@supports (zoom: 1) {
    html { zoom: var(--site-scale, 1); }
}
@supports not (zoom: 1) {
    body {
        transform-origin: 0 0;
        transform: scale(var(--site-scale, 1));
        /* keep layout width consistent with scaling to avoid horizontal gaps/scrollbar jump */
        width: calc(100% / var(--site-scale, 1));
    }
}

/* make main container slightly narrower and centered for a cleaner layout */
.container {
    max-width: 1400px;
}

/* Bell background */
.bell-background-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 5vh;
    pointer-events: none;
    overflow: hidden;
}

#wedding-bell-svg {
    height: 60vh;
    width: auto;
    opacity: 0.05;
    fill: #d4af37;
    stroke: #b8860b;
    stroke-width: 1px;
}

.bell-assembly {
    transform-origin: 50% 2%;
}

/* Drawing elements */
.drawing-elements-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    overflow: hidden;
}

.drawing-element {
    position: absolute;
    opacity: 0.7;
}

/* Wedding couple */
.wedding-couple-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    overflow: hidden;
}

/* Navbar */
.navbar {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(10px);
    border-bottom: 2px solid var(--primary-gold);
    box-shadow: 0 2px 20px var(--shadow);
    transition: all 0.3s ease;
}

.navbar-brand {
    font-family: 'Playfair Display', serif;
    color: var(--primary-gold) !important;
    font-weight: 700;
    font-size: 1.8rem;
    text-shadow: 0 1px 2px rgba(0,0,0,0.04);
    transition: transform 0.3s ease;
}

.navbar-brand:hover {
    transform: scale(1.05);
    color: var(--secondary-gold) !important;
}

.nav-link {
    color: var(--dark-text) !important;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
}

.nav-link:hover {
    color: var(--primary-gold) !important;
    transform: translateY(-2px);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--primary-gold);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.nav-link:hover::after {
    width: 100%;
}

.collab-panel {
    position: fixed;
    right: 14px;
    bottom: 14px;
    width: 320px;
    max-width: calc(100vw - 24px);
    z-index: 1050;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(212, 175, 55, 0.45);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
    padding: 12px;
    font-size: 0.88rem;
}

.collab-panel.collab-embedded {
    position: static;
    right: auto;
    bottom: auto;
    width: 100%;
    max-width: 100%;
    z-index: 1;
    box-shadow: none;
    margin-top: 10px;
}

.collab-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.collab-title {
    font-weight: 700;
    color: #6b4d18;
}

.collab-greeting {
    color: #2b7beb;
    font-weight: 600;
}

.collab-row {
    margin: 4px 0;
}

.collab-online-list {
    color: #333;
    min-height: 20px;
}

.collab-divider {
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    margin: 8px 0;
}

.collab-activity-list {
    margin: 0;
    padding-left: 16px;
    max-height: 180px;
    overflow: auto;
}

.collab-activity-list li {
    margin-bottom: 6px;
    color: #444;
}

@media (max-width: 768px) {
    .collab-panel {
        width: 100%;
        right: 0;
        left: 0;
        bottom: 0;
        border-radius: 12px 12px 0 0;
    }
}

/* Sections */
.section {
    padding: 20px 0;
    min-height: auto;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    transform: none;
    animation: none;
}

.section.d-none {
    display: none;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        background: var(--gradient);
    }
}

/* Dashboard */
#dashboard {
    background: linear-gradient(135deg, rgba(255,255,255,0.9) 0%, rgba(248,232,232,0.9) 100%);
    position: relative;
}

#dashboard::before {
    content: '💍';
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 3rem;
    opacity: 0.3;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

#countdown {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 40px;
    color: var(--primary-gold);
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
    animation: pulse 2s infinite;
}

/* stronger heading styles */
h1 {
    font-family: 'Playfair Display', serif;
    color: var(--primary-gold);
    font-size: 2.4rem;
    text-align: center;
    margin-bottom: 1rem;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* Cards */
.card {
    border: none !important;
    border-radius: 20px !important;
    box-shadow: 0 10px 30px var(--shadow);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    overflow: hidden;
    position: relative;
}

.card .card-body { padding: 1.5rem; }

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-gold), var(--secondary-gold));
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px var(--shadow);
}

.card-body {
    padding: 2rem;
}

.card h5 {
    color: var(--primary-gold);
    font-weight: 700;
    margin-bottom: 1rem;
}

/* Dashboard cards without background frame */
#dashboard .card {
    background: transparent;
    backdrop-filter: none;
    box-shadow: none;
}

/* Buttons */
.btn {
    border-radius: 25px;
    padding: 12px 30px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 20% 80%, rgba(212, 175, 55, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 228, 225, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(248, 232, 232, 0.03) 0%, transparent 50%),
        linear-gradient(180deg, rgba(255,255,255,0.02), rgba(0,0,0,0.02));
.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-gold), var(--secondary-gold));
    border: none;
    color: white;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--secondary-gold), var(--primary-gold));
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.4);
    color: white;
}

.btn-success {
    background: linear-gradient(135deg, #28a745, #20c997);
    border: none;
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, #dc3545, #fd7e14);
    border: none;
    color: white;
}

.btn-warning {
    background: linear-gradient(135deg, #ffc107, #fd7e14);
    border: none;
    color: var(--dark-text);
}

/* Forms */
.form-control {
    border: 2px solid #e9ecef;
    border-radius: 15px;
    padding: 15px 20px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.8);
}

.form-control:focus {
    border-color: var(--primary-gold);
    box-shadow: 0 0 0 0.2rem rgba(212, 175, 55, 0.25);
    background: white;
    transform: scale(1.02);
}

.form-label {
    color: var(--dark-text);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

/* Tables */
.table {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 15px var(--shadow);
}

.table th {
    background: linear-gradient(135deg, var(--primary-gold), var(--secondary-gold));
    color: white;
    border: none;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 1.5rem;
}

.table td {
    padding: 1.2rem;
    border: none;
    border-bottom: 1px solid rgba(212, 175, 55, 0.1);
    transition: background 0.3s ease;
}

/* Inline editable cells */
.table {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 10px 30px var(--shadow);
}

.table thead th {
    background: linear-gradient(90deg, var(--primary-gold), var(--secondary-gold));
    color: #fff;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 1rem 1.5rem;
}

/* Make table rows more card-like */
.table tbody tr {
    background: rgba(255,255,255,0.98);
}

.table tbody td {
    padding: 1rem 1.5rem;
    vertical-align: middle;
    background: linear-gradient(180deg, rgba(255,255,255,0.9), rgba(248,232,232,0.02));
}

.table-input {
    border: none;
    background: transparent;
    width: 100%;
    padding: 6px 8px;
    font-size: 0.95rem;
    color: var(--dark-text);
}

.table-input:focus {
    outline: none;
    background: #fff;
    border: 1px solid rgba(212,175,55,0.4);
    box-shadow: 0 4px 12px rgba(212,175,55,0.08);
    border-radius: 8px;
    padding: 8px 10px;
}

.table tr.new-row td {
    background: rgba(248,232,232,0.5);
}

.btn-inline {
    padding: 8px 12px;
    border-radius: 18px;
    font-weight: 600;
}

/* ensure inline buttons have a small gap */
.btn-inline + .btn-inline { margin-left: 8px; }

/* paid checkbox column narrow */
td .paid-checkbox { width: 18px; height: 18px; }

.card.p-3 h5 { margin-top: 0; }

.table tbody tr:hover {
    background: rgba(212, 175, 55, 0.05);
}

/* Progress bars */
.progress {
    height: 10px;
    border-radius: 10px;
    background: rgba(0,0,0,0.05);
    overflow: hidden;
}

/* Footer placeholder spacing */
footer { height: 60px; }

.progress-bar {
    background: linear-gradient(90deg, var(--primary-gold), var(--secondary-gold));
    transition: width 1s ease;
}

/* Animations */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.slide-in-left {
    animation: slideInLeft 0.5s ease-out;
}

@keyframes slideInLeft {
    from { transform: translateX(-100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.slide-in-right {
    animation: slideInRight 0.5s ease-out;
}

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Responsive */
@media (max-width: 768px) {
    #countdown {
        font-size: 2rem;
    }
    
    .navbar-brand {
        font-size: 1.5rem;
    }
    
    .card-body {
        padding: 1.5rem;
    }
    
    .btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--soft-pink);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-gold);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-gold);
}

/* Loading animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(212, 175, 55, 0.3);
    border-radius: 50%;
    border-top-color: var(--primary-gold);
    animation: spin 1s ease-in-out infinite;
}

/* Wspólne chwile gallery styles */
.wspolne-thumb { width: 100%; height: 100%; overflow: hidden; display:flex; align-items:center; justify-content:center; }
.wspolne-overlay { position:absolute; top:8px; right:8px; display:none; gap:6px; }
.wspolne-overlay .btn { padding:6px 10px; border-radius:10px; font-size:0.85rem; }
.wspolne-section.editing .wspolne-overlay { display:flex; }

/* Romantic layout for Wspólne chwile */
.wspolne-section { padding-top: 20px; padding-bottom: 40px; }
.wspolne-title { font-size: 3rem; color: var(--primary-gold); text-align:center; margin-bottom: 24px; }
.wspolne-wrap { display:flex; gap:30px; align-items:flex-start; justify-content:center; }
.wspolne-left { flex: 0 0 420px; max-width:420px; }
.wspolne-right { flex: 1 1 600px; }
    .wspolne-about { background: rgba(255,255,255,0.9); border-radius: 16px; padding: 18px; box-shadow: 0 12px 30px rgba(0,0,0,0.03); font-family: 'Playfair Display', serif; font-size: 1.05rem; color: var(--dark-text); line-height:1.5; }
.wspolne-about textarea { width:100%; border-radius:12px; padding:14px; border:1px solid rgba(0,0,0,0.03); font-size:1rem; min-height:120px; resize:vertical; }
.wspolne-save { display:inline-block; margin-top:14px; background: linear-gradient(135deg, var(--primary-gold), var(--secondary-gold)); color:white; padding:12px 26px; border-radius:28px; box-shadow:0 8px 20px rgba(212,175,55,0.18); font-weight:700; }

.wspolne-gallery-grid { display:flex; flex-wrap:wrap; gap:18px; align-items:flex-start; justify-content:flex-start; }
.wspolne-thumb { height:100%; }
.wspolne-thumb img { width:100%; height:100%; object-fit:cover; display:block; }
.wspolne-overlay { top:10px; right:10px; }
.wspolne-overlay .btn { background: linear-gradient(90deg,#ff6b6b,#ff8a5c); border:none; color:white; padding:6px 10px; font-weight:700; box-shadow: 0 6px 16px rgba(0,0,0,0.05); }

.wspolne-controls { margin-top: 22px; background: rgba(255,255,255,0.95); border-radius:12px; padding:14px; box-shadow: 0 8px 18px rgba(0,0,0,0.03); }
.wspolne-controls .form-group { margin-bottom:12px; }
.wspolne-toggle { position:absolute; right:20px; top:10px; }
.wspolne-admin-btn { background:transparent; border:1px solid rgba(0,0,0,0.04); padding:8px 12px; border-radius:10px; }

@media (max-width: 992px) {
    .wspolne-wrap { flex-direction:column-reverse; align-items:center; }
    .wspolne-left { max-width: 100%; }
    .wspolne-right { width:100%; }
    .wspolne-card { width: 48%; }
}

/* Background enhancement: subtle wedding motif via SVG data URL (very faint) */
body {
    background-image: radial-gradient(circle at 10% 10%, rgba(255,255,255,0.02), transparent), linear-gradient(135deg, #fff2f2 0%, #fffaf9 100%);
}


@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Toast notifications */
.toast-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 25px;
    color: white;
    font-weight: 600;
    z-index: 1001;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    transform: translateX(100%);
    transition: transform 0.5s ease-out;
    max-width: 300px;
    word-wrap: break-word;
}

/* Improvements for Wspólne chwile appearance */
.wspolne-title { font-family: 'Playfair Display', serif; letter-spacing: 1px; }
.wspolne-about-title { font-family: 'Playfair Display', serif; font-size: 1.2rem; color: var(--primary-gold); margin: 0 0 10px 0; }
.wspolne-about { font-size: 1.02rem; color: #5a4638; }
.wspolne-about #about-preview { font-size: 1.02rem; color: #5a4638; max-height: 260px; overflow-y: auto; padding-right:6px; }
/* prevent any large orphan image inside the wspolne section from growing full-bleed */
.wspolne-wrap img { max-width: 100%; max-height: 380px; object-fit: cover; display:block; margin: 0 auto; }
.wspolne-about img { max-width: 100%; max-height: 280px; object-fit: cover; display:block; margin: 6px 0; }

/* Ensure gallery thumbnails never become full-bleed large images */
#gallery img, .wspolne-gallery-grid img, .wspolne-card img { max-width: 100%; max-height: 220px; object-fit: cover; display: block; }

/* Strong rules to force fixed-size gallery tiles in the Wspólne chwile section */
#wspolne #gallery {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, 180px) !important;
    grid-auto-rows: 140px !important;
    gap: 18px !important;
    justify-content: start !important;
    align-items: start !important;
}
/* Strong rules to force fixed-size gallery tiles in the Wspólne chwile section */
#wspolne .wspolne-card {
    width: 180px !important;
    height: 140px !important;
    flex: none !important;
    box-sizing: border-box;
}
#wspolne .wspolne-card .wspolne-thumb { height: 100% !important; }
#wspolne #gallery > img { display: none !important; }
#wspolne .wspolne-card img, #wspolne #gallery img { width:100% !important; height:100% !important; object-fit: cover !important; }

/* Extra safety: ensure any image inside the wspolne section (except the modal image) is capped */
#wspolne img:not(#wspolne-modal-img) {
    max-width: 180px !important;
    max-height: 140px !important;
    width: 180px !important;
    height: 140px !important;
    object-fit: cover !important;
    display: block !important;
}

/* Make gallery cards smaller and prevent single images from growing too large */
.wspolne-gallery-grid { justify-content: flex-start; align-items:flex-start; }
.wspolne-card { width: 180px !important; height: 140px !important; position: relative; flex: 0 0 180px; }
.wspolne-thumb { height: 100% !important; }
.wspolne-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Ensure modal image is not full-screen by default */
#wspolneModal img#wspolne-modal-img { max-width: 100%; max-height: 70vh; object-fit: contain; }

@media (max-width: 992px) {
    .wspolne-title { font-size: 2.2rem; }
    .wspolne-card { width: 48% !important; height: 160px !important; }
}

/* Clean, high-specificity styles for Wspolne chwile gallery (final overrides) */
#wspolne {
    --w-thumb-w: 180px;
    --w-thumb-h: 140px;
    font-family: 'Playfair Display', serif;
}
#wspolne #gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(var(--w-thumb-w), 1fr)); gap: 18px; align-items: start; justify-content: start; }
#wspolne .card-thumb { width: var(--w-thumb-w) !important; height: auto; display: block; background: white; border-radius: 12px; overflow: hidden; box-shadow: 0 8px 18px rgba(0,0,0,0.06); }
#wspolne .card-thumb img.wspolne-thumb-img {
    /* do not upscale small images; keep natural size up to the thumb max */
    max-width: 100%;
    max-height: var(--w-thumb-h);
    width: auto;
    height: auto;
    display: block;
    margin: 0 auto;
}
#wspolne .wspolne-caption { padding: 8px 10px; font-size: 0.92rem; color: #5a4638; text-align: left; }

/* Make sure only modal (book view) image can be larger */
#wspolne img:not(#wspolne-modal-img) { max-width: var(--w-thumb-w) !important; max-height: var(--w-thumb-h) !important; }

/* Book view styles inside modal */
.book-view .book-left img { max-width: 100%; max-height: 70vh; object-fit: contain; }
.book-view .book-right { padding: 8px 12px; }
.book-view .book-right #wspolne-modal-desc { white-space: pre-wrap; }

/* Page-level book album styles */
.book-album { width: 100%; max-width: 980px; margin: 0 auto 20px; }
/* Make the visible "book" a fixed-size container so images cannot grow outside it */
.book-frame {
    background: linear-gradient(180deg,#fff,#fffaf7);
    border-radius: 12px;
    box-shadow: 0 14px 40px rgba(0,0,0,0.08);
    display: flex;
    gap: 0;
    position: relative;
    overflow: hidden; /* hide any part of images that exceed the frame */
    height: 480px; /* fixed height for a consistent "page" size */
}
.book-frame::before {
    /* subtle spine in the center to emulate an open book */
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 6px;
    transform: translateX(-50%);
    background: linear-gradient(90deg, rgba(0,0,0,0.03), rgba(0,0,0,0.06));
    pointer-events: none;
}
.book-left { flex: 0 0 58%; display:flex; align-items:center; justify-content:center; padding: 8px; overflow: hidden; height: 100%; }
/* Force the image to fill the left "page" and be cropped nicely */
.book-left img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* crop to fill the frame */
    border-radius: 6px;
    display:block;
}
.book-right { flex: 1 1 42%; padding: 20px; overflow: auto; }
.book-right #book-title { color: var(--primary-gold); font-family: 'Playfair Display', serif; }
.book-right #book-desc { color: #5a4638; white-space: pre-wrap; }
.book-thumbs { display:flex; gap:12px; overflow-x:auto; padding-top:8px; }
.book-thumbs img { width: 100px; height: 78px; object-fit: cover; border-radius:6px; cursor:pointer; opacity:0.85; transition: opacity 0.15s ease, transform 0.15s ease; }
.book-thumbs img:hover { opacity:1; transform: translateY(-4px); }
.book-thumbs img.active { outline: 3px solid rgba(212,175,55,0.25); opacity:1; }
/* Prevent upscaling of thumbnails */
.book-thumbs img { image-rendering: -webkit-optimize-contrast; }

@media (max-width: 992px) {
    .book-frame { flex-direction: column; }
    .book-left { width:100%; flex: none; }
    .book-right { width:100%; }
    .book-thumbs img { width: 80px; height: 62px; }
}

@media (max-width: 992px) {
    #wspolne { --w-thumb-w: 160px; --w-thumb-h: 120px; }
    #wspolne .card-thumb { width: calc(50% - 9px) !important; }
}

/* Namespaced 3D book styles for the Wspólne chwile section (based on x.html) */
#wspolne .wspolne-scene {
    width: 820px; /* fixed scene width to keep perspective consistent */
    max-width: 100%;
    height: 520px;
    margin: 0 auto;
    position: relative;
    perspective: 1500px;
}

#wspolne .wspolne-back-cover {
    position: absolute;
    width: 410px;
    height: 520px;
    background: #5c3a21;
    border-radius: 0 10px 10px 0;
    box-shadow: inset 4px 0 10px rgba(0,0,0,0.5), 10px 10px 30px rgba(0,0,0,0.6);
    right: 0;
    top: 0;
}

#wspolne .book {
    width: 100%;
    height: 100%;
    position: absolute;
    transform-style: preserve-3d;
    transform: translateX(25%);
    transition: transform 1s;
}

#wspolne .book.closed { transform: translateX(0); }

#wspolne .page {
    width: 410px; /* half of the scene */
    height: 520px;
    position: absolute;
    top: 0;
    right: 0;
    transform-origin: left center;
    transform-style: preserve-3d;
    transition: transform 900ms cubic-bezier(0.22, 0.9, 0.26, 1);
    cursor: pointer;
    overflow: hidden;
    will-change: transform;
    /* subtle rounded paper edge */
    border-radius: 2px;
}

/* paper texture + thin edge */
#wspolne .page::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: repeating-linear-gradient(transparent 0 6px, rgba(255,255,255,0.02) 6px 7px), linear-gradient(180deg, rgba(255,255,255,0.02), rgba(0,0,0,0.02));
    mix-blend-mode: overlay;
    opacity: 0.55;
    pointer-events: none;
}

#wspolne .page::after {
    /* inner edge shadow when page is flipped for depth */
    content: '';
    position: absolute;
    left: -28px;
    top: 0;
    bottom: 0;
    width: 40px;
    background: linear-gradient(90deg, rgba(0,0,0,0.28), rgba(0,0,0,0));
    pointer-events: none;
    opacity: 0;
    transition: opacity 360ms ease;
}

#wspolne .front, #wspolne .back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    box-shadow: inset 0 0 18px rgba(0,0,0,0.04);
    transform: translateZ(1px);
}

#wspolne .front { background-color: #fdfbf7; background-image: linear-gradient(to right, rgba(0,0,0,0.06) 0%, transparent 8%); z-index: 2; }
#wspolne .back { background-color: #fdfbf7; transform: rotateY(180deg) translateZ(1px); background-image: linear-gradient(to left, rgba(0,0,0,0.06) 0%, transparent 8%); z-index: 1; }

#wspolne .cover-front { background: #5c3a21; border: 2px solid #3e2716; color: #d4af37; text-align:center; border-radius: 0 10px 10px 0; }

#wspolne .content-photo { width: 90%; height: 85%; object-fit: cover; border: 6px solid white; box-shadow: 2px 6px 18px rgba(0,0,0,0.25); background: #eee; }

/* flipped state: rotate and reveal inner edge shadow for more depth */
#wspolne .flipped { transform: rotateY(-180deg); }
#wspolne .flipped::after { opacity: 0.7; }

/* z-index helpers will be set by JS when building pages */

@media (max-width: 992px) {
    #wspolne .wspolne-scene { height: 420px; }
    #wspolne .page { height: 420px; width: 360px; }
    #wspolne .content-photo { width: 85%; height: 76%; }
}

/* Additional responsive tweaks (preserve desktop layout) */
#map-container { height: 50vh; width: 100%; position: relative; }

@media (max-width: 992px) {
    .container { padding: 0 20px; }
    .section { padding: 40px 0; min-height: auto; }
    .card-body { padding: 1rem; }
    .card .card-body { padding: 1rem; }
    .navbar-brand { font-size: 1.4rem; }
    .nav-link { padding: 6px 8px; }
    #map-container { height: 50vh !important; }
    .table thead th, .table td { padding: 0.8rem 1rem; font-size: 0.95rem; }
}

@media (max-width: 768px) {
    .container { padding: 0 12px; }
    .navbar-brand { font-size: 1.2rem; }
    #countdown { font-size: 1.8rem; }
    .card-body { padding: 0.75rem; }
    .btn { padding: 8px 14px; font-size: 0.95rem; }
    /* Stack Bootstrap columns to single column where explicit md classes are used */
    .row > [class*="col-md-"] { flex: 0 0 100%; max-width: 100%; }
    #map-container { height: 40vh !important; }
    #places-list { max-height: 220px; overflow: auto; }
    /* Make wide tables horizontally scrollable on small screens */
    .table { display: block; width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .table thead, .table tbody, .table tr { display: table; width: 100%; table-layout: fixed; }
}

@media (max-width: 576px) {
    .navbar-brand { font-size: 1rem; }
    h1 { font-size: 1.4rem; }
    #map-container { height: 30vh !important; }
    .modal-dialog { max-width: 95%; margin: 1.2rem auto; }
    .card { border-radius: 12px; }
    .form-control { padding: 10px 12px; }
    .toast-notification { left: 12px; right: 12px; top: auto; bottom: 12px; transform: translateX(0); }
}

/* Wspólne chwile - 3D Book Styles */
.wspolne-scene-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.scene {
    width: 900px;
    height: 600px;
    position: relative;
    perspective: 2000px;
    margin: 0 auto;
}

.scene .book {
    width: 100%;
    height: 100%;
    position: absolute;
    transform-style: preserve-3d;
    transform: translateX(25%); /* Startowa pozycja */
    transition: transform 1s ease-in-out;
}

.scene .back-cover {
    position: absolute;
    width: 450px;
    height: 600px;
    /* Biała skóra / płótno */
    background: #fcfcfc;
    border-radius: 0 5px 5px 0;
    box-shadow: 
        inset 10px 0 20px rgba(0,0,0,0.1),
        15px 20px 40px rgba(0,0,0,0.15);
    z-index: 0;
    right: 0;
    border: 1px solid #eaeaea;
}

.scene .page {
    width: 450px;
    height: 600px;
    position: absolute;
    top: 0;
    right: 0;
    transform-origin: left center;
    transform-style: preserve-3d;
    transition: transform 1.4s cubic-bezier(0.645, 0.045, 0.355, 1);
    cursor: pointer;
}

.scene .front, .scene .back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-color: #fffdf9; /* Bardzo jasny krem */
}

.scene .front {
    background-image: linear-gradient(to right, rgba(0,0,0,0.05) 0%, transparent 5%);
    z-index: 2;
    border-right: 1px solid #f0f0f0;
}

.scene .back {
    transform: rotateY(180deg);
    background-image: linear-gradient(to left, rgba(0,0,0,0.05) 0%, transparent 5%);
    z-index: 1;
    border-left: 1px solid #f0f0f0;
}

.scene .cover-front {
    background: #fcfcfc; /* Biała okładka */
    background-image: url("data:image/svg+xml,%3Csvg width='4' height='4' viewBox='0 0 4 4' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 3h1v1H1V3zm2-2h1v1H3V1z' fill='%23e6e6e6' fill-opacity='0.4' fill-rule='evenodd'/%3E%3C/svg%3E");
    border: 1px solid #ddd;
    border-radius: 0 5px 5px 0;
    color: #c5a059;
    box-shadow: inset -2px 0 5px rgba(0,0,0,0.05);
}

.scene .cover-frame {
    border: 2px solid #c5a059;
    padding: 40px;
    width: 80%;
    height: 80%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
}

.scene .cover-frame::before, .scene .cover-frame::after {
    content: "❧";
    font-size: 30px;
    position: absolute;
    color: #c5a059;
}
.scene .cover-frame::before { top: 10px; left: 50%; transform: translateX(-50%) rotate(90deg); }
.scene .cover-frame::after { bottom: 10px; left: 50%; transform: translateX(-50%) rotate(-90deg); }

.scene h1 { font-family: 'Great Vibes', cursive; font-size: 4.5em; margin: 10px 0; font-weight: normal; text-shadow: 1px 1px 2px rgba(0,0,0,0.05); }
.scene .names { font-size: 1.5em; letter-spacing: 3px; text-transform: uppercase; margin-top: 20px; color: #8a7a5b; }
.scene .date { margin-top: 10px; font-size: 1.1em; color: #aaa; font-style: italic; }

.scene .page-content { padding: 40px; width: 100%; height: 100%; display: flex; flex-direction: column; justify-content: center; align-items: center; position: relative; }
.scene .page-number { position: absolute; bottom: 20px; font-size: 0.9em; color: #ccc; }
.scene .front .page-number { right: 20px; }
.scene .back .page-number { left: 20px; }

.scene .photo-container { background: white; padding: 15px; box-shadow: 0 5px 15px rgba(0,0,0,0.08); transform: rotate(-2deg); width: 85%; transition: transform 0.3s; }
.scene .photo-container:hover { transform: scale(1.02) rotate(0deg); z-index: 10; }
.scene .photo-container img { width: 100%; height: auto; display: block; filter: sepia(10%) contrast(95%); }

.scene .empty-photo {
    width: 85%;
    min-height: 260px;
    background: linear-gradient(180deg, #fffdf9 0%, #f6f3f0 100%);
    border: 1px dashed #eee;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #e9e2db;
    font-size: 2.2em;
    box-shadow: inset 0 2px 0 rgba(255,255,255,0.6);
}

.scene .text-container { text-align: center; padding: 0 40px; }
.scene .chapter-title { font-family: 'Great Vibes', cursive; font-size: 3em; color: #c5a059; margin-bottom: 20px; }
.scene .text-body { font-size: 1.2em; line-height: 1.8; color: #555; font-style: italic; }
.scene .ornament { font-size: 2em; color: #e0dcd5; margin: 20px 0; }

.scene .flipped { transform: rotateY(-180deg); }

.scene .controls {
    display: flex;
    gap: 30px;
    justify-content: center;
    margin-top: 20px;
}

.scene .controls button {
    padding: 12px 30px;
    background: #fff;
    border: 1px solid #c5a059; /* Złoty */
    color: #c5a059;
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.1em;
    letter-spacing: 1px;
    cursor: pointer;
    border-radius: 2px;
    box-shadow: 0 5px 15px rgba(197, 160, 89, 0.2);
    transition: all 0.3s ease;
}

.scene .controls button:hover:not(:disabled) {
    background: #c5a059;
    color: #fff;
    transform: translateY(-2px);
}

.scene .controls button:disabled {
    border-color: #ccc;
    color: #ccc;
    background: #f9f9f9;
    cursor: not-allowed;
    box-shadow: none;
}

/* Additional styles for dynamic book */
.wspolne-scene .content-photo {
    width: 100%;
    height: auto;
    display: block;
    filter: sepia(10%) contrast(95%);
}

.wspolne-scene .photo-caption {
    margin-top: 10px;
    font-size: 0.9em;
    color: #666;
    text-align: center;
}

.wspolne-scene .book-thumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
}

.wspolne-scene .book-thumbs img {
    width: 80px;
    height: 60px;
    object-fit: cover;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.3s;
}

.wspolne-scene .book-thumbs img.active {
    border-color: #c5a059;
}

/* Venues section */
.venues-section {
    max-width: 1280px;
}

.venues-card {
    border-radius: 14px;
}

#venues-table td,
#venues-table th {
    white-space: nowrap;
}

.wspolne-scene .book.final-state {
    transform: translateX(100%);
}

.wspolne-scene .book.cover-state {
    transform: translateX(25%);
}

/* Page container for wspolne */
.page-container {
    max-width: 1200px;
    margin: 0 auto;
}

/* --- 3D BOOK STYLES FROM y-original.html --- */
:root {
    --page-width: 450px;
    --page-height: 550px;
    --anim-duration: 1.5s;
    --gold: #c5a059;
    --paper: #fdfbf7;
}

.wspolne-scene {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    perspective: 2500px;
}

.wspolne-scene .book {
    width: var(--page-width);
    height: var(--page-height);
    position: relative;
    transform-style: preserve-3d;
    transition: transform var(--anim-duration) ease-in-out;
    transform: translateX(calc(var(--page-width) * -0.5));
}

.wspolne-scene .book.open {
    transform: translateX(0);
}

.wspolne-scene .book.closed-end {
    transform: translateX(calc(var(--page-width) * 0.5));
}

.wspolne-scene .book::after {
    content: '';
    position: absolute;
    bottom: -30px;
    left: 5%;
    width: 90%;
    height: 20px;
    background: rgba(0,0,0,0.3);
    border-radius: 50%;
    filter: blur(20px);
    transition: all var(--anim-duration);
    z-index: -1;
}

.wspolne-scene .book.open::after {
    width: 190%;
    left: -95%;
    opacity: 0.15;
}

.wspolne-scene .page {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    transform-origin: left center;
    transform-style: preserve-3d;
    transition: transform var(--anim-duration) cubic-bezier(0.645, 0.045, 0.355, 1);
    cursor: pointer;
}

.wspolne-scene .face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-color: var(--paper);
    overflow: hidden;
    border: 1px solid #eaddcf;
}

.wspolne-scene .front {
    z-index: 2;
    border-radius: 0 5px 5px 0;
    background-image: linear-gradient(to right, rgba(0,0,0,0.15) 0%, transparent 5%);
}

.wspolne-scene .back {
    transform: rotateY(180deg);
    z-index: 1;
    border-radius: 5px 0 0 5px;
    background-image: linear-gradient(to left, rgba(0,0,0,0.15) 0%, transparent 5%);
}

.wspolne-scene .cover-texture {
    background-color: #fcfcfc;
    background-image: repeating-linear-gradient(45deg, #f5f5f5 25%, transparent 25%, transparent 75%, #f5f5f5 75%, #f5f5f5), repeating-linear-gradient(45deg, #f5f5f5 25%, #fcfcfc 25%, #fcfcfc 75%, #f5f5f5 75%, #f5f5f5);
    background-position: 0 0, 2px 2px;
    background-size: 4px 4px;
}

.wspolne-scene .gold-frame {
    border: 2px solid var(--gold);
    padding: 20px;
    width: 85%;
    height: 90%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative;
}

.wspolne-scene .gold-frame::before, .wspolne-scene .gold-frame::after {
    content: "✦";
    color: var(--gold);
    position: absolute;
}

.wspolne-scene .gold-frame::before { top: 10px; left: 50%; transform: translateX(-50%); }
.wspolne-scene .gold-frame::after { bottom: 10px; left: 50%; transform: translateX(-50%); }

.wspolne-scene h1 { font-family: 'Great Vibes', cursive; font-size: 4em; color: var(--dark-text); margin: 10px 0; font-weight: normal; }
.wspolne-scene h2 { font-size: 1.2em; text-transform: uppercase; letter-spacing: 3px; color: var(--gold); }
.wspolne-scene p { font-size: 1.1em; color: #666; font-style: italic; margin-top: 15px; line-height: 1.6; padding: 0 20px; }

.wspolne-scene .photo-area {
    width: 85%;
    height: 80%;
    background: #fff;
    padding: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transform: rotate(-1deg);
    transition: 0.3s;
}
.wspolne-scene .photo-area:hover { transform: scale(1.02) rotate(0deg); }
.wspolne-scene .photo-area img { width: 100%; height: 100%; object-fit: cover; filter: contrast(95%) sepia(5%); }

.wspolne-scene .page-num {
    position: absolute;
    bottom: 20px;
    color: #ccc;
    font-size: 0.9em;
}
.wspolne-scene .front .page-num { right: 25px; }
.wspolne-scene .back .page-num { left: 25px; }

.wspolne-scene .flipped { transform: rotateY(-180deg); }

.wspolne-scene .ui-bar {
    position: absolute;
    bottom: 30px;
    display: flex;
    gap: 20px;
    z-index: 1000;
}

.wspolne-scene .ui-bar button {
    padding: 12px 35px;
    border: 1px solid var(--gold);
    background: rgba(255,255,255,0.9);
    color: var(--gold);
    font-family: 'Cormorant Garamond', serif;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: 0.3s;
}
.wspolne-scene .ui-bar button:hover:not(:disabled) { background: var(--gold); color: #fff; }
.wspolne-scene .ui-bar button:disabled { border-color: #ccc; color: #ccc; cursor: not-allowed; }

#wspolne-book #p1 { z-index: 10; }
#wspolne-book #p2 { z-index: 9; }
#wspolne-book #p3 { z-index: 8; }
#wspolne-book #p4 { z-index: 7; }

@keyframes floatUp {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 0.7;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 0.7;
    }
    100% {
        transform: translateY(-100vh) rotate(360deg);
        opacity: 0;
    }
}


/* Calendar styles */
#calendar-view {
    background: var(--white);
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 8px var(--shadow);
}

#calendar-view table {
    border-radius: 8px;
    overflow: hidden;
}

#calendar-view th {
    background: var(--primary-gold);
    color: var(--white);
    font-weight: bold;
    text-align: center;
}

#calendar-view td {
    text-align: center;
    vertical-align: middle;
}

#calendar-view tbody tr:hover {
    background: var(--pastel-pink);
}

/* Date/time input styling */
input[type="datetime-local"] {
    border: 1px solid var(--light-gray);
    border-radius: 5px;
    padding: 8px;
    font-size: 14px;
}

input[type="datetime-local"]:focus {
    border-color: var(--primary-gold);
    box-shadow: 0 0 5px rgba(212, 175, 55, 0.5);
}


/* Pulse animation for map pins */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* Map controls styling */
#map-controls { display: inline-flex; align-items: center; }
#map-controls .btn { min-width: 36px; padding: 4px 8px; }
#map-container .map-pin { box-shadow: 0 1px 3px rgba(0,0,0,0.2); }

/* Modal centering */
.modal { display: flex !important; align-items: center !important; justify-content: center !important; min-height: 100vh !important; }
.modal-dialog { position: relative !important; margin: auto !important; }

/* Adjust modal position to center in viewport */
.modal.show .modal-dialog {
    transform: translate(0, 0) !important;
    top: 10vh !important;
    max-height: 80vh !important;
    overflow-y: auto !important;
}

/* Couple animation styles - removed */
}



