/* CSS Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Define variables for consistent colors and spacing */
    --primary-color: #8B4513;
    --text-dark: #4A3728;
    --text-light: #6B5744;
    --button-color: #8B4513;
    --button-hover: rgba(139, 69, 19, 0.1);
    --spacing-small: 1rem;
    --spacing-medium: 2rem;
    --spacing-large: 3rem;
}



/* Responsive typography using clamp */
html {
    font-size: 16px;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Caveat', serif;  /* Wedding invitation style font */
    font-size: 1.2rem;
    font-weight: 600;
    min-height: 100vh;
    overflow-x: hidden;
    background-color: #F5E6D3;  /* Base color for the parchment effect */
    position: relative;
}

/* Parchment texture overlay */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='paper-texture'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%' height='100%' filter='url(%23paper-texture)'/%3E%3C/svg%3E");
    opacity: 0.3;
    z-index: 0;
}

.hero {
    position: relative;
    min-height: 100vh;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: var(--spacing-medium);
    background: transparent;
    z-index: 1;
}

.hero h1 {
    font-family: 'Caveat', serif;
    font-weight: 700;
    font-size: clamp(2.5rem, 6vw + 1rem, 4rem);
    color: var(--text-dark);
    margin-bottom: var(--spacing-medium);
    width: 100%;
    max-width: 800px;
}

.hero p {
    font-family: 'Caveat', serif;
    font-size: clamp(1.5rem, 2.5vw + 0.5rem, 2.2rem);
    font-weight: 600;
    color: var(--text-light);
    margin-bottom: var(--spacing-medium);
    width: 100%;
    max-width: 600px;
    line-height: 1.6;
}

.save-the-date {
    /* Responsive font size that scales between 1.5rem and 2rem */
    font-size: clamp(2rem, 3.5vw + 0.5rem, 2.8rem);
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: var(--spacing-medium);
}

/* Button styles */
.btn-register {
    padding: clamp(0.8rem, 2vw, 1rem) clamp(1.5rem, 4vw, 2rem);
    font-size: clamp(1rem, 1.5vw + 0.5rem, 1.2rem);
    background-color: var(--button-color);
    color: #F5E6D3;
    border: 1px solid var(--button-color);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    width: auto;
    max-width: 100%;
    font-family: 'Caveat', serif;
    font-weight: 600;
}

.btn-register:hover {
    background-color: transparent;
    color: var(--button-color);
    transform: translateY(-2px);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal.active {
    display: flex;
}

/* Update modal styles to match the theme */
.modal-content {
    background-color: #F5E6D3;
    padding: var(--spacing-medium);
    border-radius: 1rem;
    width: 90%;
    max-width: 500px;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
    font-family: 'Caveat', serif;
    font-weight: 600;
    font-size: 1.3rem;
}

.modal-header {
    margin-bottom: var(--spacing-medium);
}

.modal-header h2 {
    font-family: 'Caveat', serif;
    color: var(--text-dark);
    font-weight: 700;
    font-size: 2.2rem;
}

.close-modal {
    position: absolute;
    right: 1rem;
    top: 1rem;
    font-size: 1.5rem;
    cursor: pointer;
    background: none;
    border: none;
    color: var(--text-dark);
}

.guest-fields {
    margin-bottom: var(--spacing-medium);
}

.form-group {
    margin-bottom: var(--spacing-medium);
}

/* Update form elements */
.form-group label {
    font-family: 'Caveat', serif;
    font-size: 1.2rem;
    color: var(--text-dark);
}

.form-group input,
.form-group select,
.guest-entry input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--text-dark);
    border-radius: 0.5rem;
    font-size: 1.3rem;
    margin-bottom: 0rem;
    font-family: 'Caveat', serif !important;
    font-weight: 600;
    background-color: #F5E6D3;
}


/* Base select styles */
select,
.form-group select,
#attendance,
.meal-preference {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    font-family: 'Caveat', serif !important;
    font-weight: 600;
    font-size: 1.3rem;
    background-color: #F5E6D3;
    border: 1px solid var(--text-dark);
    color: var(--text-dark);
    cursor: pointer;
    padding-right: 2rem; /* Space for the custom arrow */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%234A3728' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    background-size: 1.2rem;
}

/* Style for options within select */
select option,
.form-group select option,
#attendance option,
.meal-preference option {
    font-family: 'Caveat', serif !important;
    font-weight: 600;
    font-size: 1.3rem;
    background-color: #F5E6D3;
    color: var(--text-dark);
}

/* Remove default arrow in IE */
select::-ms-expand {
    display: none;
}

/* Firefox specific styles */
@-moz-document url-prefix() {
    select {
        font-family: 'Caveat', serif !important;
        font-weight: 600;
        font-size: 1.3rem;
    }
}

/* Webkit specific styles */
@media screen and (-webkit-min-device-pixel-ratio:0) {
    select {
        font-family: 'Caveat', serif !important;
        font-weight: 600;
        font-size: 1.3rem;
    }
}


.add-guest-btn {
    position: relative;
    background: none;
    border: 1px solid var(--button-color);
    color: var(--button-color);
    padding: 0.5rem 1rem;
    cursor: pointer;
    margin-top: 0.5rem;
    margin-bottom: 1rem;
    border-radius: 0.5rem;
    overflow: hidden;
    z-index: 1;
    transition: color 0.3s ease;
    font-family: 'Caveat', serif;
    font-weight: 600;
    font-size: 1.4rem;
}

.add-guest-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background-color: rgba(139, 69, 19, 0.1);   /* Lighter background like submit button */
    transition: width 0.3s ease;
    z-index: -1;
}

.add-guest-btn:hover {
    color: var(--button-color);  /* Same darker red as submit button */
}

.add-guest-btn:hover::before {
    width: 100%;
}

.guest-entry {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 0.5rem;
}

.guest-entry input {
    margin-bottom: 0;
}

.guest-entry button {
    background-color: #dc7826;
    color: white;
    border: none;
    border-radius: 0.25rem;
    width: 24px;
    height: 24px;
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.submit-btn {
    position: relative;
    background: none;
    border: 1px solid var(--button-color);
    color: var(--button-color);
    padding: 1rem 2rem;
    cursor: pointer;
    width: 100%;
    margin-top: var(--spacing-medium);
    border-radius: 0.5rem;
    overflow: hidden;
    z-index: 1;
    transition: color 0.3s ease;
    font-family: 'Caveat', serif;
    font-weight: 600;
    font-size: 1.4rem;
}

.submit-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background-color: rgba(139, 69, 19, 0.1);  /* Lighter background for better text visibility */
    transition: width 0.3s ease;
    z-index: -1;
}

.submit-btn:hover {
    color: var(--button-color);  /* Darker red for better contrast */
}

.submit-btn:hover::before {
    width: 100%;
}

.guest-summary {
    margin-top: var(--spacing-medium);
    padding: var(--spacing-medium);
    background-color: #F5E6D3;
    border-radius: 0.5rem;
}

.guest-summary h3 {
    color: var(--text-dark);
    margin-bottom: var(--spacing-small);
}

.summary-content {
    margin-bottom: var(--spacing-medium);
}

.summary-buttons {
    display: flex;
    gap: 1rem;
    margin-top: var(--spacing-medium);
}

.edit-btn, .confirm-btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    flex: 1;
    font-family: 'Caveat', serif;
    font-weight: 600;
    font-size: 1.3rem;
}

.edit-btn {
    background-color: #64748b;
    color: white;
}

.confirm-btn {
    background-color: var(--button-color);
    color: white;
}

.guest-item {
    padding: 0.5rem;
    margin: 0.25rem 0;
    background-color: #F5E6D3;
    border-radius: 0.25rem;
    border-left: 4px solid var(--button-color);
    font-size: 1.3rem;
}

/* Media Queries */
/* Mobile devices */
@media screen and (max-width: 480px) {
    .hero {
        padding: var(--spacing-small);
    }

    .hero h1 {
        margin-bottom: var(--spacing-small);
    }

    .btn-register {
        width: 90%;
        max-width: 300px;
    }
}

/* Tablets */
@media screen and (min-width: 481px) and (max-width: 768px) {
    .hero {
        padding: var(--spacing-medium);
    }
}

/* Large tablets and laptops */
@media screen and (min-width: 769px) and (max-width: 1024px) {
    .hero {
        padding: var(--spacing-large);
    }
}

/* Desktop and larger screens */
@media screen and (min-width: 1025px) {
    .hero {
        padding: var(--spacing-large);
    }
}

.custom-alert {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.custom-alert.show {
    display: flex;
}

.custom-alert-content {
    padding: 2rem;
    border-radius: 1rem;
    max-width: 90%;
    width: 400px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    animation: slideIn 0.3s ease-out;
    background-color: #F5E6D3;
    font-family: 'Caveat', serif;
    font-weight: 600;
    font-size: 1.3rem;
}

.alert-button {
    margin-top: 1.5rem;
    padding: 0.5rem 2rem;
    background-color: var(--button-color);
    color: white;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.alert-button:hover {
    background-color: var(--button-hover);
    transform: translateY(-2px);
}

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

.meal-preferences h3 {
    margin-bottom: 1rem;
    color: var(--text-dark);
    font-family: 'Caveat', serif;
    font-weight: 700;
    font-size: 1.8rem;
}

.guest-preference {
    margin-bottom: 1rem;
    padding: 0.5rem;
    background-color: #F5E6D3;  /* Changed from #f8e3c8 */
    border-radius: 0.5rem;
}

.guest-preference label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
    font-family: 'Caveat', serif;
    font-weight: 600;
    font-size: 1.3rem;
}

#attendance, .meal-preference {
    display: none;
}