/*body {
    font-family: 'Playfair Display', serif;
    text-align: center;
    background: #f9f5f0;
    margin: 0;
    padding: 20px;
    color: #5a4a42
}*/

body {
    background-image: url('Image_20250518224620.png');
    background-size: cover; /* Растягиваем на весь экран */
    background-position: center; /* Центрируем */
    background-attachment: fixed; /* Фиксируем фон */
    background-repeat: no-repeat; /* Запрещаем повторение */
    background-color: #f9f5f0; /* Фоновый цвет на случай, если изображение не загрузится */
    color: #5a4a42; /* Цвет текста для контраста */
    
    /* Добавляем затемнение для лучшей читаемости текста */
    position: relative;

    font-family: 'Playfair Display', serif;
    text-align: center;
    margin: 0;
    padding: 20px;
}

/* Создаем полупрозрачный слой поверх фона */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(249, 245, 240, 0.85); /* Цвет с прозрачностью */
    z-index: -1; /* Помещаем под контент */
}

header {
    background: #e8d8c9;
    padding: 50px 0;
    border-bottom: 1px solid #d2c1b3
}

h1, h2 {
    color: #7a6a5f;
    font-size: 2.5em;
}

h3 {
    font-size: 2.5em;
}

.about img {
    width: 300px;
    border-radius: 50%;
    margin: 20px 0;
    border: 5px solid #e8d8c9;
    box-shadow: 0 3px 15px rgba(0,0,0,0.1);
}

.details, .timer-container, .dress-code {
    background: white;
    padding: 30px;
    margin: 20px auto;
    max-width: 800px;
    border-radius: 10px;
    box-shadow: 0 3px 15px rgba(0,0,0,0.05);
    border: 1px solid #e8d8c9;
}

.timer {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 5px;
}

.timer-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0 5px;
}

.timer-number-container {
    display: flex;
    align-items: center;
    position: relative;

    transform-style: preserve-3d; /* Важно для 3D-анимации */
    perspective: 200px; /* Общая перспектива для всех цифр */
}

.timer-number {
    font-size: 2.5em;
    font-weight: bold;
    color: #a38f7e;
    background: #f0e6dd;
    padding: 5px 10px;
    border-radius: 5px;
    min-width: 50px;
    text-align: center;
    position: center;
    overflow: hidden;
	height: 1.2em;
}

.timer-number-old {
    position: center;
    animation: flip-out 0.3s ease-out forwards;
}

.timer-number-new {
    position: center;
    animation: flip-in 0.3s ease-out 0.3s forwards;
    opacity: 0;
}

.timer-label {
    font-size: 0.8em;
    color: #888;
    margin-left: -10px;
}

.timer-separator {
    font-size: 2em;
    color: #b8a99a;
    position: relative;
    top: -3px;
    margin-left: 15px;
}

.timer-title {
    color: #7a6a5f;
    font-size: 1.5em;
    margin-bottom: 15px;
}

/* Анимация */
@keyframes flip-out {
    0% { transform: rotateX(0); opacity: 1; }
    100% { transform: rotateX(-90deg); opacity: 0; }
}

@keyframes flip-in {
    0% { transform: rotateX(90deg); opacity: 0; }
    100% { transform: rotateX(0); opacity: 1; }
}

.flipping {
    position: relative;
	perspective: 200px;
}

.color-palette {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 25px 0;
    flex-wrap: wrap;
}

.color-circle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 2px solid #f9f5f0;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s;
}

.color-circle:hover {
    transform: scale(1.1);
}

.dress-code-note {
    font-size: 0.9em;
    color: #666;
    font-style: italic;
}

.location {
    background: white;
    padding: 30px;
    margin: 20px auto;
    max-width: 800px;
    border-radius: 10px;
    box-shadow: 0 3px 15px rgba(0,0,0,0.1);
    border: 1px solid #e8d8c9;
}

.map-container {
    border-radius: 8px;
    overflow: hidden;
    margin: 20px 0;
    border: 1px solid #e0d5c8;
}

.address {
    font-style: italic;
    color: #7a6a5f;
    margin-top: 15px;
    line-height: 1.6;
}

button {
    background: #a38f7e;
    color: white;
    padding: 15px 30px;
    border: none;
    border-radius: 25px;
    font-size: 1.2em;
    cursor: pointer;
    margin: 20px 0;
    transition: all 0.3s;
}

button:hover {
    background: #7a6a5f
}

/* Стили для модального окна */
.modal {
    display: none;
    position: fixed;
    z-index: 100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.7);
}

.modal-content {
    background-color: #f9f5f0;
    margin: 5% auto;
    padding: 30px;
    border: 1px solid #e8d8c9;
    width: 90%;
    max-width: 600px;
    max-height: 80vh; /* Ограничиваем высоту */
    border-radius: 10px;
    position: relative;
    overflow-y: auto; /* Добавляем вертикальный скролл при необходимости */
    box-sizing: border-box; /* Учитываем padding в общей высоте */
}

/* Улучшаем отображение скроллбара */
.modal-content::-webkit-scrollbar {
    width: 8px;
}

.modal-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.modal-content::-webkit-scrollbar-thumb {
    background: #a38f7e;
    border-radius: 4px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: #7a6a5f;
}

.close {
    position: absolute;
    right: 20px;
    top: 10px;
    font-size: 28px;
    cursor: pointer;
}

.form-group {
    margin-bottom: 15px;
    padding: 10px;
    background: rgba(255,255,255,0.7);
    border-radius: 5px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
}

.form-group input[type="text"],
.form-group textarea,
.form-group select {
    width: 95%;
    padding: 8px;
    border: 1px solid #e8d8c9;
    border-radius: 5px;
    font-family: 'Playfair Display', serif;
}

/* Стили для динамически добавляемых гостей */
#guestNames .form-group {
    margin-bottom: 10px;
    padding: 8px;
    background: rgba(255,255,255,0.5);
}

.form-scroll-container {
    max-height: 65vh;
    overflow-y: auto;
    padding-right: 10px;
    margin-right: -10px; /* Компенсируем padding */
}

/* Адаптация для мобильных устройств */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        padding: 20px;
    }
    
    .form-scroll-container {
        max-height: 60vh;
    }
}

.radio-group, .checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.radio-group label, .checkbox-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: normal;
    cursor: pointer;
}

.submit-btn {
    background: #a38f7e;
    color: white;
    padding: 12px 25px;
    border: none;
    border-radius: 25px;
    font-size: 1.1em;
    cursor: pointer;
    transition: all 0.3s;
    width: 100%;
}

.submit-btn:hover {
    background: #7a6a5f;
}


/* Стили для галереи */
.photo-gallery {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    margin: 30px 0;
}

.gallery-item {
    width: calc(33.333% - 20px);
    max-width: 300px;
    cursor: pointer;
    transition: transform 0.3s;
}

.gallery-item:hover {
    transform: scale(1.03);
}

.gallery-photo {
    width: 100%;
    height: auto;
    border-radius: 10px;
    border: 5px solid #e8d8c9;
    box-shadow: 0 3px 15px rgba(0,0,0,0.1);
    object-fit: cover;
    aspect-ratio: 1/1;
}

/* Стили для модального окна с увеличенным фото */
#photoModal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.9);
    overflow: auto;
    text-align: center;
}

#photoModal .close-modal {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
}

#expandedImg {
    max-width: none;
    max-height: none;
    margin: 20px auto;
    display: block;
    border-radius: 5px;
    border: 3px solid #f9f5f0;
    cursor: zoom-out;
    object-fit: contain;
    position: relative;
    top: 45%;
    transform: translateY(-50%);
}

/* Для очень больших изображений */
@media (min-width: 1200px) {
    #expandedImg {
        max-width: 90vw;
        max-height: 90vh;
    }
}

#imgCaption {
    color: white;
    text-align: center;
    padding: 10px;
    font-size: 1.2em;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0,0,0,0.7);
}

/* Адаптация для мобильных */
@media (max-width: 768px) {
    .gallery-item {
        width: calc(50% - 15px);
    }
}

@media (max-width: 480px) {
    .gallery-item {
        width: 100%;
        max-width: none;
    }
}

#expandedImg {
    animation: zoomIn 0.3s;
}

@keyframes zoomIn {
    from {transform: translateY(-50%) scale(0.8); opacity: 0;}
    to {transform: translateY(-50%) scale(1); opacity: 1;}
}