@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Playfair+Display:ital,wght@0,400;0,700;1,400&family=Dancing+Script:wght@700&family=Alex+Brush&family=Permanent+Marker&display=swap');

:root {
    --primary: #FDFBF7; /* Off-white/Cream Background */
    --secondary: #800000; /* Deep Maroon */
    --accent: #A52A2A; /* Lighter Brownish Red */
    --gold: #D4AF37;   /* Metallic Gold */
    --gold-text: #B8860B; /* Darker Gold for visibility */
    --bg-card: #FFFFFF;
    --text-dark: #1A1A1A;
    --text-muted: #555555; /* Darkened for better readability */
    --shadow-soft: 0 15px 40px rgba(0,0,0,0.06);
    --shadow-heavy: 0 20px 60px rgba(0,0,0,0.4);
    --transition: all 0.4s ease;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--primary);
    color: var(--text-dark);
    line-height: 1.6;
}

h1, h2, h3 {
    font-family: 'Playfair Display', serif;
}

.container {
    max-width: 1000px;
    margin: 40px auto;
    padding: 20px;
}

/* Header Section */
header {
    text-align: center;
    margin-bottom: 50px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--accent);
}

header h1 {
    font-size: 2.5rem;
    color: var(--secondary);
    margin-bottom: 10px;
}

header p {
    color: var(--text-muted);
    font-weight: 500;
}

/* Form Section */
.card {
    background: white;
    padding: 30px;
    border-radius: 20px;
    box-shadow: var(--shadow-soft);
    margin-bottom: 40px;
}

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--secondary);
}

/* Fix Visibility for help text in settings */
small {
    color: #444 !important; /* Force darker gray for visibility */
    font-weight: 500;
}

input[type="text"], input[type="tel"] {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 10px;
    font-size: 1rem;
    transition: var(--transition);
}

/* Better placeholder visibility */
::placeholder {
    color: #999;
    opacity: 1;
}

input:focus, textarea:focus {
    outline: none;
    border-color: var(--secondary);
    box-shadow: 0 0 0 4px rgba(128, 0, 0, 0.05);
}

textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 10px;
    font-size: 1rem;
    font-family: inherit;
    transition: var(--transition);
    resize: vertical;
}

/* Alerts */
.alert {
    padding: 15px 20px;
    border-radius: 12px;
    margin-bottom: 25px;
    font-weight: 500;
}

.alert.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    border: none;
}

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

.btn-primary:hover {
    background-color: var(--accent);
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: transparent;
    border: 1.5px solid var(--secondary);
    color: var(--secondary);
}

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

.btn-whatsapp {
    background-color: #25D366;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
}

/* Guest List */
.guest-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.guest-card {
    background: white;
    padding: 20px;
    border-radius: 15px;
    box-shadow: var(--shadow-soft);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Edit button in guest card */
.guest-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.btn-edit {
    background-color: #f0f0f0;
    color: #333;
    padding: 8px 15px;
    border-radius: 8px;
    font-size: 0.8rem;
    text-decoration: none;
    font-weight: 600;
}

.btn-edit:hover {
    background-color: #e0e0e0;
}

/* Invitation View */
.invitation-wrapper {
    display: none; /* Hidden until modal is opened */
    opacity: 0;
}

.invitation-wrapper.show {
    display: flex; /* Changed from block to flex to restore centering */
    opacity: 1;
    min-height: 100vh;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    padding: 20px;
}

.invitation-card {
    background: var(--bg-card);
    max-width: 600px;
    width: 100%;
    border-radius: 12px;
    padding: 0;
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-soft);
}

.invitation-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: var(--card-bg);
    background-size: cover;
    background-position: center;
    opacity: 0.08; /* Very subtle transparency */
    z-index: 0;
    pointer-events: none;
}

.invitation-card > * {
    position: relative;
    z-index: 1;
}


.photo-container {
    width: 100%;
    height: 420px;
    position: relative;
    overflow: hidden;
    background: #000;
}

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

.photo-container::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 120px;
    background: linear-gradient(to bottom, transparent, var(--bg-card) 95%);
    pointer-events: none;
}

.invitation-content {
    padding: 0px 45px 60px;
    position: relative;
    z-index: 10;
}

/* Gold color for labels */
.announcing-label {
    font-size: 0.8rem;
    color: var(--gold-text);
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 5px;
    font-weight: 600;
}

.inv-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--gold-text);
    margin-bottom: 25px;
    letter-spacing: 2px;
}

.grad-name-v3 {
    font-family: 'Alex Brush', cursive;
    font-size: 2.2rem; 
    color: var(--secondary);
    margin-bottom: 25px;
    line-height: 1.2;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
    white-space: normal;
    letter-spacing: 0.5px;
}

.parent-subtitle-v3 {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: -15px;
    margin-bottom: 25px;
    font-style: italic;
    line-height: 1.5;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.univ-v3 {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    color: #666;
    margin-top: 10px;
    margin-bottom: 25px;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    display: inline-block;
    padding: 0 15px;
    line-height: 1.6;
    max-width: 550px;
}

.guest-info-v3 {
    margin: 30px 0;
    padding: 20px 0;
    border-top: 1px solid #f0f0f0;
    border-bottom: 1px solid #f0f0f0;
}

.guest-label-v3 {
    font-size: 0.75rem;
    color: #999;
    letter-spacing: 3px;
    margin-bottom: 8px;
}

.guest-name-v3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-dark);
}

.guest-note-v3 {
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-top: 5px;
    font-style: italic;
}

.event-details-v3 {
    margin-top: 30px;
    color: var(--text-muted);
}

.date-large-v3 {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    color: var(--secondary);
    font-weight: 700;
    margin-bottom: 5px;
}

.time-loc-v3 {
    font-size: 0.85rem;
    line-height: 1.6;
}

.multi-events-v3 {
    margin: 25px 0;
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
}

.event-item-v3 {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.event-name-v3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--secondary);
    letter-spacing: 1.5px;
}

.event-time-v3 {
    font-size: 0.95rem;
    color: var(--text-muted);
    font-weight: 500;
    letter-spacing: 1px;
}

.event-divider-v3 {
    width: 60px;
    height: 1px;
    background: linear-gradient(to right, transparent, var(--gold), transparent);
    margin: 5px 0;
}

.loc-v3 {
    margin-top: 25px;
    font-size: 0.9rem;
    color: var(--text-dark);
    line-height: 1.8;
}

.unmute-btn-card {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 20;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 0.7rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: var(--transition);
}

.rsvp-text-v3 {
    margin-top: 50px;
    font-size: 0.7rem;
    letter-spacing: 1px;
    color: #ccc;
    text-transform: uppercase;
}

/* Maps Button Styles */
.maps-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--secondary);
    color: white !important;
    padding: 12px 25px;
    border-radius: 50px;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(128, 0, 0, 0.15);
}

.maps-btn:hover {
    background: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(128, 0, 0, 0.25);
    text-decoration: none;
}

/* Map Section Styles */
.map-section {
    margin-top: 30px;
    background: #fff;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 25px rgba(0,0,0,0.05);
    border: 1px solid #f0f0f0;
}

.map-container {
    height: 300px;
    width: 100%;
    z-index: 5;
}

.map-actions {
    padding: 15px;
    background: #fafafa;
    border-top: 1px solid #f0f0f0;
}

/* Custom Leaflet Marker */
.custom-div-icon {
    background: none;
    border: none;
}

.marker-pin {
    width: 30px;
    height: 30px;
    border-radius: 50% 50% 50% 0;
    background: var(--secondary);
    position: absolute;
    transform: rotate(-45deg);
    left: 50%;
    top: 50%;
    margin: -15px 0 0 -15px;
    z-index: 1;
}

.marker-pin::after {
    content: '';
    width: 24px;
    height: 24px;
    margin: 3px 0 0 3px;
    background: #fff;
    position: absolute;
    border-radius: 50%;
}

.marker-photo {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    position: absolute;
    left: 50%;
    top: 50%;
    margin: -25px 0 0 -22px;
    z-index: 2;
    object-fit: cover;
    border: 2px solid #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

/* Graduation Cap Animation */
.cap-animation-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 15;
    overflow: hidden;
}

.cap {
    position: absolute;
    font-size: 24px;
    top: -50px;
    left: var(--l);
    opacity: 0.3;
    animation: fall 6s linear infinite;
    animation-delay: var(--d);
}

@keyframes fall {
    0% {
        top: -50px;
        transform: rotate(0deg) translateX(0);
    }
    50% {
        transform: rotate(180deg) translateX(20px);
    }
    100% {
        top: 110%;
        transform: rotate(360deg) translateX(-20px);
    }
}

@media (max-width: 600px) {
    .container {
        padding: 15px;
    }
    .invitation-card {
        padding: 0;
    }
    .grad-name-v3 {
        font-size: 1.8rem;
    }
    .univ-v3 {
        font-size: 0.75rem;
    }
}

/* Opening Modal Styling */
.opening-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    padding: 0;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #444; /* Dark text for light background */
    transition: opacity 0.8s ease, visibility 0.8s ease;
}

.opening-modal.fade-out {
    opacity: 0;
    visibility: hidden;
}

.modal-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    filter: blur(5px) brightness(1.1); /* Brighter for light theme */
    transform: scale(1.1);
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(253, 251, 247, 0.95) 0%, rgba(243, 229, 171, 0.9) 100%);
}

.modal-content-wrapper {
    position: relative;
    z-index: 10;
    padding: 30px;
    max-width: 500px;
    width: 90%;
}

.modal-label {
    font-size: 0.8rem;
    letter-spacing: 4px;
    text-transform: uppercase;
    margin-bottom: 20px;
    color: var(--gold);
    font-weight: 700;
}

.modal-name {
    font-family: 'Great Vibes', cursive;
    font-size: 2.5rem;
    margin-bottom: 30px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.modal-message {
    font-size: 0.9rem;
    line-height: 1.8;
    margin-bottom: 40px;
    font-style: italic;
    color: #555;
}

.modal-guest {
    margin-bottom: 40px;
    padding: 20px;
    background: rgba(255,255,255,0.4);
    border-radius: 12px;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(212, 175, 55, 0.2);
}

.guest-to {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 10px;
    color: var(--gold);
}

.guest-name {
    font-size: 1.25rem;
    font-weight: 700;
}

.open-btn {
    background: var(--gold);
    color: #333 !important;
    border: none;
    padding: 15px 40px;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 0 auto;
    text-decoration: none;
}

.open-btn:hover {
    transform: translateY(-5px) scale(1.05);
    background: #fff;
    box-shadow: 0 15px 40px rgba(0,0,0,0.4);
}

@media (max-width: 600px) {
    .modal-name {
        font-size: 2rem;
    }
    .modal-message {
        font-size: 0.8rem;
    }
    .guest-name {
        font-size: 1.1rem;
    }
}
