:root {
    --bg-color: #FAF9F6;
    --text-color: #2D332F;
    --accent-color: #4A5D4E;
    --muted-color: #8B928E;
    --border-color: #EBE8E2;
    --orange-color: #D97B51;
    --card-bg: #FFFFFF;
    --font-sans: 'Inter', sans-serif;
    --font-serif: 'Playfair Display', serif;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-sans);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

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

.header {
    background: rgba(250, 249, 246, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 4rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--accent-color);
}

.logo-icon {
    width: 2.5rem;
    height: 2.5rem;
    background-color: var(--accent-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.logo-text {
    font-family: var(--font-serif);
    font-weight: 700;
    font-size: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--muted-color);
    font-size: 0.875rem;
    font-weight: 600;
    padding: 0.5rem 0.75rem;
    border-radius: 9999px;
    transition: all 0.2s;
}

.nav-link:hover {
    color: var(--text-color);
    background-color: rgba(235, 232, 226, 0.5);
}

.auth-section {
    padding-left: 1rem;
    border-left: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.btn-primary {
    background-color: var(--accent-color);
    color: white;
    text-decoration: none;
    padding: 0.5rem 1.5rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: opacity 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary:hover {
    opacity: 0.9;
}

.main-content {
    flex: 1;
    padding: 2rem 1rem;
}

.grid-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media (min-width: 1024px) {
    .grid-layout {
        grid-template-columns: 7fr 5fr;
    }
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 1rem;
}

.section-header h2 {
    font-family: var(--font-serif);
    font-size: 1.875rem;
    font-weight: 700;
}

.section-header h4 {
    font-family: var(--font-serif);
    font-size: 1.25rem;
    font-weight: 700;
}

.muted-text {
    font-size: 0.875rem;
    color: var(--muted-color);
}

.empty-state {
    text-align: center;
    padding: 6rem 1rem;
    background-color: var(--card-bg);
    border-radius: 1.5rem;
    border: 1px dashed var(--border-color);
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.empty-icon {
    width: 3rem;
    height: 3rem;
    color: #C2BDB4;
    margin: 0 auto 1rem;
}

.empty-state h3 {
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.empty-state p {
    color: var(--muted-color);
    font-size: 0.875rem;
}

.gifts-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

@media (min-width: 640px) {
    .gifts-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.gift-card {
    background-color: var(--card-bg);
    padding: 1.25rem;
    border-radius: 1.5rem;
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    position: relative;
    transition: transform 0.2s;
}

.external-link {
    position: absolute;
    top: 2rem;
    right: 2rem;
    z-index: 10;
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(4px);
    padding: 0.5rem;
    border-radius: 50%;
    color: var(--accent-color);
    text-decoration: none;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    opacity: 0;
    transition: opacity 0.2s;
}

.gift-card:hover .external-link {
    opacity: 1;
}

.gift-image-wrapper {
    width: 100%;
    aspect-ratio: 1;
    background-color: #F3F1ED;
    border-radius: 1rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

@media (min-width: 640px) {
    .gift-image-wrapper {
        aspect-ratio: auto;
        height: 12rem;
    }
}

.gift-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.7s;
}

.gift-card:not(.reserved):hover .gift-image {
    transform: scale(1.05);
}

.gift-card.reserved .gift-image {
    filter: grayscale(100%);
    opacity: 0.7;
}

.gift-placeholder {
    font-size: 2.5rem;
}

.reserved-overlay {
    position: absolute;
    inset: 0;
    background: rgba(45, 51, 47, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.reserved-badge {
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(4px);
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    border: 1px solid var(--border-color);
}

.reserved-badge i {
    width: 1rem;
    height: 1rem;
    color: var(--orange-color);
}

.reserved-badge span {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.gift-card h3 {
    font-weight: 500;
    font-size: 1.125rem;
    margin-bottom: 0.25rem;
}

.gift-card.reserved h3 {
    color: var(--muted-color);
}

.gift-description {
    font-size: 0.875rem;
    color: var(--muted-color);
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.btn-gift {
    width: 100%;
    padding: 0.75rem;
    border-radius: 0.75rem;
    font-size: 0.875rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    margin-top: auto;
    transition: all 0.2s;
}

.btn-gift.reserve-btn {
    background-color: var(--accent-color);
    color: white;
}

.btn-gift.reserve-btn:hover {
    opacity: 0.9;
}

.btn-gift.reserved {
    background-color: var(--border-color);
    color: var(--muted-color);
    cursor: not-allowed;
}

.sidebar-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.upload-card {
    background-color: #EFECE7;
    padding: 1.5rem;
    border-radius: 2rem;
    border: 1px solid #E3DFD7;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1.5rem;
}

@media (min-width: 640px) {
    .upload-card {
        flex-direction: row;
        align-items: flex-start;
        text-align: left;
    }
}

.qr-wrapper {
    background-color: white;
    padding: 0.5rem;
    border-radius: 1rem;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    cursor: pointer;
    flex-shrink: 0;
}

.qr-wrapper:hover {
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.qr-inner {
    width: 6rem;
    height: 6rem;
    background-color: var(--bg-color);
    border: 4px solid var(--text-color);
    display: flex;
    align-items: center;
    justify-content: center;
}

.upload-info {
    display: flex;
    flex-direction: column;
    height: 100%;
    justify-content: space-between;
}

.upload-info h4 {
    font-family: var(--font-serif);
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.upload-info p {
    font-size: 0.875rem;
    color: #6B716E;
    margin-bottom: 1rem;
    line-height: 1.6;
}

.btn-upload {
    width: 100%;
    border-radius: 0.75rem;
}

@media (min-width: 640px) {
    .btn-upload {
        width: auto;
        align-self: flex-start;
    }
}

.live-badge {
    background-color: var(--orange-color);
    color: white;
    font-size: 0.625rem;
    padding: 0.25rem 0.5rem;
    border-radius: 9999px;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.05em;
}

.empty-state-gallery {
    text-align: center;
    padding: 3rem 1rem;
    background-color: #EFECE7;
    border-radius: 2rem;
    border: 1px dashed #E3DFD7;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    padding-bottom: 3rem;
}

.gallery-item {
    position: relative;
    padding-top: 100%;
    border-radius: 1rem;
    overflow: hidden;
    background-color: #E3DFD7;
    display: block;
}

.gallery-item img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

.more-photos-overlay {
    position: absolute;
    inset: 0;
    background: rgba(45, 51, 47, 0.6);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 500;
}

.gallery-item.view-all {
    background-color: #EFECE7;
    border: 1px solid #E3DFD7;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted-color);
    text-decoration: none;
    padding-top: 0;
    aspect-ratio: 1;
}

.gallery-item.view-all span {
    font-size: 0.875rem;
    font-weight: 500;
}

.gallery-item.view-all:hover {
    background-color: var(--border-color);
}

.footer {
    margin-top: auto;
    padding: 3rem 1rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
    color: var(--muted-color);
    font-size: 0.875rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.footer-icon {
    width: 1.5rem;
    height: 1.5rem;
    color: #C2BDB4;
}

@media (max-width: 639px) {
    .hidden-mobile {
        display: none;
    }
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(45, 51, 47, 0.6);
    backdrop-filter: blur(4px);
    z-index: 100;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 2rem;
    width: 100%;
    max-width: 400px;
    position: relative;
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1);
}

.close-modal {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 2rem;
    height: 2rem;
    background: var(--bg-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--muted-color);
    font-size: 1.25rem;
}

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

.modal-content h3 {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.modal-content p {
    color: var(--muted-color);
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
}

.modal-content input[type="text"], .modal-content input[type="password"] {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
    font-family: var(--font-sans);
}

.qr-large {
    background: white;
    padding: 1rem;
    border-radius: 1rem;
    display: flex;
    justify-content: center;
    border: 1px solid #E3DFD7;
}

.text-center {
    text-align: center;
}

/* Admin table styles */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    background: white;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.admin-table th, .admin-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.admin-table th {
    background: var(--bg-color);
    font-weight: 600;
    color: var(--muted-color);
}

.btn-danger {
    background-color: #ef4444;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    border: none;
    cursor: pointer;
}

.btn-danger:hover {
    background-color: #dc2626;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-group input, .form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    font-family: var(--font-sans);
}

/* FAB */
.fab-btn {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 3.5rem;
    height: 3.5rem;
    background-color: var(--accent-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border: none;
    cursor: pointer;
    z-index: 90;
    transition: transform 0.2s, background-color 0.2s;
}

.fab-btn:hover {
    transform: scale(1.05);
    background-color: #3b4a3e;
}
