@import url('https://fonts.googleapis.com/css2?family=Ballet:opsz@16..72&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Ballet:opsz@16..72&family=Cormorant+Garamond:ital,wght@0,300..700;1,300..700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Cinzel+Decorative:wght@400;700;900&display=swap');

/* ==================== Base Styles ==================== */
:root {
    --primary-color: #8b3a3a;
    --primary-light: #a84a4a;
    --primary-dark: #6b2c2c;
    --accent-color: #f0e6e1;
    --accent-dark: #e8d5c4;
    --text-primary: #333;
    --text-light: #666;
    --border-radius: 8px;
}

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

html, body {
    font-family: 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background: linear-gradient(135deg, #faf9f7 0%, #f5f3f1 100%);
    color: var(--text-primary);
    line-height: 1.6;
}

/* ==================== Blazor Routing ==================== */
a.active {
    background-color: rgba(255, 255, 255, 0.15) !important;
    border-left: 3px solid #f0e6e1 !important;
}

@media (min-width: 769px) {
    a.active {
        background-color: transparent !important;
        border-left: none !important;
        border-bottom: 2px solid #f0e6e1 !important;
    }
}

/* ==================== Typography ==================== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    letter-spacing: 0.5px;
    color: var(--primary-dark);
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

h2 {
    font-size: 2rem;
    margin-bottom: 1.25rem;
    line-height: 1.3;
}

h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

p {
    color: var(--text-light);
    margin-bottom: 1rem;
    line-height: 1.7;
}

/* ==================== Links & Buttons ==================== */

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--border-radius);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    letter-spacing: 0.5px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, #5a1f1f 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(107, 44, 44, 0.3);
}

.btn-secondary {
    background-color: var(--accent-dark);
    color: var(--primary-dark);
}

.btn-secondary:hover {
    background-color: var(--accent-color);
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 3px rgba(139, 58, 58, 0.2);
    outline: none;
}

/* ==================== Forms ==================== */
.form-control {
    border: 2px solid #e0d5cc;
    border-radius: var(--border-radius);
    padding: 0.75rem 1rem;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(139, 58, 58, 0.1);
}

.form-label {
    font-weight: 500;
    color: var(--primary-dark);
    margin-bottom: 0.5rem;
}

.form-check-input {
    border-color: #d0d0d0;
    cursor: pointer;
}

.form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* ==================== Validation ==================== */
.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #dc3545;
}

.validation-message {
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* ==================== Cards & Containers ==================== */
.card {
    border: 1px solid #e0d5cc;
    border-radius: var(--border-radius);
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.card-body {
    padding: 1.5rem;
}

/* ==================== Sections ==================== */
.section {
    padding: 4rem 1rem;
    max-width: 1200px;
    margin: 0 auto;
}

.section-title {
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
    margin: 1rem auto 0;
    border-radius: 2px;
}

.section-subtitle {
    color: var(--text-light);
    font-size: 1.1rem;
    margin-top: 0.5rem;
}

/* ==================== Hero Section ==================== */
.hero-section {
    background: linear-gradient(135deg, #8b3a3a 0%, #6b2c2c 100%);
    color: white;
    padding: 6rem 1rem;
    text-align: center;
    min-height: 70vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 20% 50%, rgba(255,255,255,0.05) 0%, transparent 50%);
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 1;
    animation: fadeInUp 1s ease;
}

.hero-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    letter-spacing: 1px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.hero-subtitle {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: #f0e6e1;
    font-weight: 300;
    letter-spacing: 0.5px;
}

.hero-couple {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.hero-separator {
    width: 40px;
    height: 2px;
    background: #f0e6e1;
    margin: 1rem auto;
}

.hero-image {
    width: 100%;
    max-width: 600px;
    height: 400px;
    background: linear-gradient(135deg, #b85959 0%, #a84a4a 100%);
    border-radius: 8px;
    margin-top: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #f0e6e1;
    font-size: 1.2rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

/* ==================== Countdown ==================== */
.countdown-container {
    background: white;
    border-radius: var(--border-radius);
    padding: 2rem 1rem;
    margin: 2rem 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.countdown-title {
    text-align: center;
    margin-bottom: 1.5rem;
    color: var(--primary-dark);
}

.countdown {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

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

.countdown-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1;
}

.countdown-label {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-top: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

@media (max-width: 768px) {
    .countdown {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .countdown-number {
        font-size: 1.5rem;
    }
}

/* ==================== Gallery ==================== */
.photo-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.gallery-item {
    position: relative;
    height: 350px;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    background: linear-gradient(135deg, #d4b5b5 0%, #c9a5a5 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.1rem;
}

.gallery-item:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

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

/* ==================== Details Sections ==================== */
.detail-block {
    margin-bottom: 2rem;
}

.detail-title {
    font-size: 1.25rem;
    color: var(--primary-dark);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.detail-title-icon {
    font-size: 1.5rem;
}

.detail-content {
    background: white;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    border-left: 4px solid var(--primary-color);
}

.map-container {
    width: 100%;
    height: 400px;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    margin-top: 1rem;
}

.map-container iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* ==================== Dress Code ==================== */
.dress-code-section {
    background: white;
    border-radius: var(--border-radius);
    padding: 2rem;
    margin-bottom: 2rem;
}

.dress-code-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.dress-code-item {
    border: 2px solid #e0d5cc;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
}

.dress-code-item:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(139, 58, 58, 0.1);
}

.dress-code-role {
    font-weight: 600;
    color: var(--primary-dark);
    margin-bottom: 0.5rem;
}

.dress-code-color {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin: 1rem auto;
    border: 2px solid #e0d5cc;
}

.dress-code-description {
    font-size: 0.9rem;
    color: var(--text-light);
}

/* ==================== FAQ ==================== */
.faq-container {
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    margin-bottom: 1.5rem;
    background: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    border: 1px solid #e0d5cc;
    transition: all 0.3s ease;
}

.faq-question {
    padding: 1.5rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    color: var(--primary-dark);
    background: #faf9f7;
    user-select: none;
}

.faq-question:hover {
    background: #f5f3f1;
}

.faq-toggle {
    font-size: 1.5rem;
    transition: transform 0.3s ease;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.faq-item.active .faq-toggle {
    transform: rotate(180deg);
}

.faq-answer {
    padding: 1.5rem;
    color: var(--text-light);
    background: white;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.faq-item.active .faq-answer {
    max-height: 500px;
}

/* ==================== RSVP Form ==================== */
.rsvp-container {
    max-width: 600px;
    margin: 0 auto;
}

.form-section {
    background: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    margin-bottom: 2rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

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

.form-group:last-child {
    margin-bottom: 0;
}

/* ==================== Gifts/Registry ==================== */
.gift-message {
    background: linear-gradient(135deg, #f5e6e1 0%, #ede0d8 100%);
    border-left: 4px solid var(--primary-color);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    margin-bottom: 2rem;
    font-size: 1.05rem;
    line-height: 1.8;
}

.qr-code-container {
    text-align: center;
    background: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    border: 1px solid #e0d5cc;
}

.qr-code-image {
    width: 300px;
    height: 300px;
    margin: 1rem auto;
    background: linear-gradient(135deg, #e8d5c4 0%, #f0e6e1 100%);
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.qr-code-label {
    font-weight: 600;
    color: var(--primary-dark);
    margin-top: 1rem;
}

/* ==================== Animations ==================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes slideIn {
    from {
        transform: translateX(-20px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.fade-in {
    animation: fadeIn 0.5s ease;
}

.slide-in {
    animation: slideIn 0.5s ease;
}

/* ==================== Utility Classes ==================== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

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

.text-muted {
    color: var(--text-light);
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }

/* ==================== Scrollbar Styling ==================== */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #d4b5b5;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #b89898;
}

/* ==================== Blazor Error UI ==================== */
#blazor-error-ui {
    color-scheme: light only;
    background: #b32121;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
    color: white;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

.blazor-error-boundary::after {
    content: "An error has occurred.";
}

/* ==================== Loading Progress ==================== */
.loading-progress {
    position: absolute;
    display: block;
    width: 8rem;
    height: 8rem;
    inset: 20vh 0 auto 0;
    margin: 0 auto;
}

.loading-progress circle {
    fill: none;
    stroke: #e0e0e0;
    stroke-width: 0.6rem;
    transform-origin: 50% 50%;
    transform: rotate(-90deg);
}

.loading-progress circle:last-child {
    stroke: var(--primary-color);
    stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
    transition: stroke-dasharray 0.05s ease-in-out;
}

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
    color: var(--primary-color);
}

.loading-progress-text:after {
    content: var(--blazor-load-percentage-text, "Loading");
}

/* ==================== Responsive Design ==================== */
@media (max-width: 768px) {
    .hero-section {
        padding: 3rem 1rem;
        min-height: 50vh;
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1.1rem;
    }

    .section {
        padding: 2rem 1rem;
    }

    h1 {
        font-size: 1.75rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    .countdown {
        grid-template-columns: repeat(2, 1fr);
    }

    .photo-gallery {
        grid-template-columns: 1fr;
    }

    .dress-code-grid {
        grid-template-columns: 1fr;
    }

    .qr-code-image {
        width: 200px;
        height: 200px;
    }
}

/* ==================== Tablet & Small Devices ==================== */
@media (min-width: 769px) and (max-width: 1024px) {
    .section {
        padding: 3rem 1.5rem;
    }

    .photo-gallery {
        grid-template-columns: repeat(2, 1fr);
    }
}

.no-select {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}