* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-bg: #0a0e13;
    --secondary-bg: #0f1419;
    --text-primary: #f0f0f0;
    --text-secondary: #b0b0b0;
    --accent: #c9845f;
    --accent-hover: #d89470;
    --border: #1f2632;
    --shadow: rgba(0, 0, 0, 0.4);
    --shadow-strong: rgba(0, 0, 0, 0.6);
    --heart-pink: #c9845f;
    --success-green: #c9845f;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--primary-bg);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    padding-top: 3.2rem;
}

/* Header */
.header {
    background: rgba(10, 14, 19, 0.98);
    border-bottom: none;
    padding: 0.8rem 1rem;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    width: 28px;
    height: 28px;
    background: transparent;
    border: 2px solid var(--accent);
    cursor: pointer;
    transition: all 0.3s ease;
}

.tagline {
    font-size: 1.3rem;
    color: var(--text-primary);
    font-weight: 500;
    letter-spacing: 0.5px;
    font-family: 'Cormorant', serif;
    font-style: italic;
}

/* Main Content */
.main-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* Gallery - True Masonry Layout */
.gallery {
    column-count: 4;
    column-gap: 0.8rem;
    margin: 0 auto;
}

@media (max-width: 1200px) {
    .gallery {
        column-count: 3;
    }
}

@media (max-width: 768px) {
    .gallery {
        column-count: 2;
    }
}

@media (max-width: 480px) {
    .gallery {
        column-count: 1;
    }
}

/* Gallery Items */
.gallery-item {
    cursor: pointer;
    position: relative;
    overflow: hidden;
    background: var(--secondary-bg);
    box-shadow: 0 4px 12px var(--shadow);
    transition: all 0.3s ease;
    break-inside: avoid;
    margin-bottom: 0.8rem;
}

.gallery-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 16px 32px var(--shadow-strong);
}

.gallery-item img,
.gallery-item video {
    width: 100%;
    height: auto;
    display: block;
}

.gallery-item.text-card {
    padding: 2.5rem;
    min-height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #151b25 0%, #0f1419 100%);
    border: 1px solid var(--border);
}

.gallery-item.text-card .text-content {
    font-size: 1.3rem;
    line-height: 1.6;
    text-align: center;
    font-weight: 600;
    letter-spacing: 0.3px;
    color: var(--text-primary);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    backdrop-filter: blur(20px);
    animation: fadeIn 0.3s ease;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-close {
    position: absolute;
    top: 2rem;
    right: 2rem;
    font-size: 3rem;
    color: white;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 1001;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.modal-close:hover {
    opacity: 0.7;
}

.modal-content {
    max-width: 90vw;
    max-height: 90vh;
    position: relative;
    animation: scaleIn 0.3s ease;
}

@keyframes scaleIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.modal-media {
    max-width: 100%;
    max-height: calc(90vh - 100px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-media img,
.modal-media video {
    max-width: 100%;
    max-height: calc(90vh - 100px);
    object-fit: contain;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modal-media.text-card {
    background: linear-gradient(135deg, #151b25 0%, #0f1419 100%);
    padding: 4rem;
    min-width: 400px;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border);
}

.modal-media.text-card .text-content {
    font-size: 2.2rem;
    line-height: 1.7;
    text-align: center;
    color: var(--text-primary);
    font-weight: 700;
    letter-spacing: 0.5px;
}


.save-btn {
    background: var(--accent);
    color: #000;
    border: 2px solid var(--accent);
    padding: 1rem 2.5rem;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    position: relative;
    letter-spacing: 0.5px;
}

.save-btn:hover {
    background: var(--heart-pink);
    border-color: var(--heart-pink);
    color: white;
    transform: scale(1.05);
}

.save-btn.saved {
    background: var(--heart-pink);
    border-color: var(--heart-pink);
    color: white;
}

.heart {
    font-size: 1.3rem;
    transition: all 0.3s ease;
}

.heart-filled {
    font-size: 1.3rem;
    display: none;
    color: white;
}

.save-btn.saved .heart {
    display: none;
}

.save-btn.saved .heart-filled {
    display: inline;
    animation: heartBeat 0.5s ease;
}

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


/* Loading State */
.gallery-item.loading {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}


/* Responsive adjustments */
@media (max-width: 768px) {
    .header {
        padding: 1.5rem 1rem;
    }

    .logo {
        font-size: 1.5rem;
    }

    .modal-close {
        top: 1rem;
        right: 1rem;
        font-size: 2rem;
        width: 40px;
        height: 40px;
    }

    .modal-media.text-card {
        min-width: 300px;
        padding: 2rem;
    }

    .modal-media.text-card .text-content {
        font-size: 1.5rem;
    }

    .gallery-item.item-tall,
    .gallery-item.item-wide,
    .gallery-item.item-large {
        grid-column: span 1 !important;
        grid-row: span 1 !important;
    }
}
