/* ===== ОБЩИЕ СТИЛИ ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --rose: #fce4ec;
    --white: #ffffff;
    --gold: #d4af37;
    --champagne: #f7e7ce;
    --dark: #2c2c2c;
    --lavender: #e6e6fa;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    --radius: 16px;
}

body {
    font-family: 'Roboto', sans-serif;
    background: linear-gradient(135deg, var(--rose) 0%, var(--white) 100%);
    min-height: 100vh;
    color: var(--dark);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ===== PRELOADER ===== */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--rose);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.6s ease;
}

.loader-ring {
    width: 80px;
    height: 80px;
    border: 4px solid var(--champagne);
    border-top: 4px solid var(--gold);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loader-text {
    font-size: 40px;
    margin-top: 20px;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.3); }
}

/* ===== HEADER ===== */
.header {
    text-align: center;
    padding: 60px 20px 40px;
    position: relative;
}

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

.decoration-line {
    width: 80px;
    height: 2px;
    background: var(--gold);
    position: relative;
}

.decoration-line::before {
    content: '';
    position: absolute;
    top: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 8px;
    height: 8px;
    background: var(--gold);
    border-radius: 50%;
}

.decoration-icon {
    font-size: 32px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.header-title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(2rem, 5vw, 4rem);
    font-weight: 700;
    margin-bottom: 10px;
}

.header-title .groom {
    color: #BDB76B;
}

.modal-content video {
    max-width: 90%;
    max-height: 80vh;
    border-radius: 8px;
    background: #000;
}

.header-title .bride {
    color: #BDB76B;
}

.header-title .ampersand {
    color: var(--gold);
    margin: 0 15px;
}

.header-date {
    font-size: 1.5rem;
    color: var(--gold);
    font-weight: 300;
    letter-spacing: 4px;
    margin-bottom: 10px;
}

.header-subtitle {
    font-size: 1.1rem;
    color: #666;
    font-weight: 300;
}

/* ===== СТАТИСТИКА ===== */
.stats {
    padding: 30px 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    max-width: 600px;
    margin: 0 auto;
}

.stat-item {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    padding: 20px;
    border-radius: var(--radius);
    text-align: center;
    box-shadow: var(--shadow);
    border: 1px solid rgba(212, 175, 55, 0.2);
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--gold);
    font-family: 'Playfair Display', serif;
}

.stat-label {
    font-size: 0.9rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ===== ЗАГРУЗКА ===== */
.upload-section {
    padding: 30px 0;
}

.upload-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    padding: 40px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    max-width: 700px;
    margin: 0 auto;
    border: 1px solid rgba(212, 175, 55, 0.15);
}

.upload-card h2 {
    font-family: 'Playfair Display', serif;
    text-align: center;
    font-size: 2rem;
    color: var(--dark);
}

.upload-subtitle {
    text-align: center;
    color: #888;
    margin-bottom: 25px;
}

.drop-zone {
    border: 2px dashed var(--gold);
    border-radius: var(--radius);
    padding: 50px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(212, 175, 55, 0.05);
    position: relative;
}

.drop-zone:hover,
.drop-zone.dragover {
    background: rgba(212, 175, 55, 0.1);
    border-color: var(--champagne);
    transform: scale(1.02);
}

.drop-icon {
    font-size: 48px;
    display: block;
    margin-bottom: 15px;
}

.drop-zone-content p {
    font-size: 1.1rem;
    margin-bottom: 10px;
}

.browse-link {
    color: var(--gold);
    font-weight: 500;
    text-decoration: underline;
    cursor: pointer;
}

.drop-zone-content small {
    color: #999;
    font-size: 0.85rem;
}

.upload-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 20px;
}

.input-field {
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    background: white;
}

.input-field:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

.upload-progress {
    margin-top: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.progress-bar {
    flex: 1;
    height: 8px;
    background: #f0f0f0;
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--gold), var(--champagne));
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 10px;
}

.progress-text {
    font-weight: 500;
    color: var(--gold);
    min-width: 45px;
    text-align: right;
}

.upload-message {
    margin-top: 15px;
    padding: 12px;
    border-radius: 8px;
    text-align: center;
    display: none;
}

.upload-message.success {
    display: block;
    background: #e8f5e9;
    color: #2e7d32;
}

.upload-message.error {
    display: block;
    background: #fbe9e7;
    color: #c62828;
}

/* ===== ГАЛЕРЕЯ ===== */
.gallery-section {
    padding: 40px 0 60px;
}

.gallery-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 30px;
}

.gallery-header h2 {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
}

.filter-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 8px 20px;
    border: 2px solid var(--gold);
    background: transparent;
    border-radius: 30px;
    color: var(--dark);
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.filter-btn:hover {
    background: rgba(212, 175, 55, 0.1);
}

.filter-btn.active {
    background: var(--gold);
    color: white;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    min-height: 200px;
}

.gallery-item {
    position: relative;
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    aspect-ratio: 1;
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}

.gallery-item img,
.gallery-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-item .file-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    padding: 30px 10px 10px;
    color: white;
    font-size: 0.8rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-item:hover .file-info {
    opacity: 1;
}

.gallery-item .file-info .guest {
    font-weight: 500;
}

.gallery-item .file-info .date {
    opacity: 0.8;
    font-size: 0.7rem;
}

.gallery-item.video-item::after {
    content: '▶';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 40px;
    color: white;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    background: rgba(0, 0, 0, 0.3);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.load-more-btn {
    display: block;
    margin: 30px auto 0;
    padding: 12px 40px;
    background: var(--gold);
    color: white;
    border: none;
    border-radius: 30px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.load-more-btn:hover {
    background: var(--champagne);
    color: var(--dark);
    transform: scale(1.05);
}

.load-more-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ===== QR-КОД ===== */
.qr-section {
    padding: 40px 0;
}

.qr-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    padding: 40px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    text-align: center;
    max-width: 500px;
    margin: 0 auto;
}

.qr-card h2 {
    font-family: 'Playfair Display', serif;
    margin-bottom: 10px;
}

.qr-card p {
    color: #888;
    margin-bottom: 20px;
}

.qr-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

#qrCode {
    background: white;
    padding: 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

#qrCode img {
    display: block;
    width: 200px;
    height: 200px;
}

.qr-download-btn {
    padding: 10px 30px;
    background: var(--gold);
    color: white;
    border: none;
    border-radius: 30px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.qr-download-btn:hover {
    background: var(--champagne);
    color: var(--dark);
}

.qr-url {
    margin-top: 10px;
    color: #999;
    font-size: 0.8rem;
    word-break: break-all;
}

/* ===== МОДАЛЬНОЕ ОКНО ===== */
.modal {
    display: none;
    position: fixed;
    z-index: 999;
    padding-top: 60px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    overflow: auto;
}

.modal-content {
    margin: auto;
    display: block;
    max-width: 90%;
    max-height: 80vh;
    border-radius: 8px;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
}

.modal-close:hover {
    color: var(--gold);
}

.modal-caption {
    text-align: center;
    color: #ccc;
    padding: 10px 0;
    font-size: 1rem;
}

/* ===== FOOTER ===== */
.footer {
    text-align: center;
    padding: 40px 20px;
    background: rgba(44, 44, 44, 0.05);
    margin-top: 40px;
}

.footer p {
    font-size: 1.1rem;
    color: #666;
}

.footer-small {
    font-size: 0.85rem;
    color: #999;
    margin-top: 10px;
}

/* ===== АДАПТИВНОСТЬ ===== */
@media (max-width: 768px) {
    .header {
        padding: 40px 15px 30px;
    }
    
    .header-title {
        font-size: 1.8rem;
    }
    
    .header-title .ampersand {
        margin: 0 8px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }
    
    .stat-item {
        padding: 15px;
    }
    
    .stat-number {
        font-size: 1.5rem;
    }
    
    .upload-card {
        padding: 25px;
    }
    
    .upload-options {
        grid-template-columns: 1fr;
    }
    
    .drop-zone {
        padding: 30px 15px;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 12px;
    }
    
    .gallery-header {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    
    .filter-buttons {
        justify-content: center;
    }
    
    .qr-card {
        padding: 25px;
    }
    
    #qrCode img {
        width: 150px;
        height: 150px;
    }
    
    .modal-content {
        max-width: 95%;
        max-height: 70vh;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .stat-item:last-child {
        grid-column: 1 / -1;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 10px;
    }
}