/* Base Styles */
:root {
    --color-primary: #6d4aff; /* Royal purple */
    --color-secondary: #c0c0c0; /* Silver */
    --color-accent: #d4af37; /* Gold */
    --color-accent-light: #e6c566; /* Light gold */
    --color-background: #121212; /* Dark background */
    --color-surface: #1e1e1e; /* Slightly lighter surface */
    --color-text: #e0e0e0; /* Light text */
    --color-text-secondary: #9e9e9e; /* Secondary text */
    --color-light: #ffffff;
    --color-dark: #090909;
    --color-danger: #ff5252;
    --color-success: #66bb6a;
    --font-primary: 'Playfair Display', serif;
    --font-secondary: 'Montserrat', sans-serif;
    --shadow-soft: 0 5px 15px rgba(0, 0, 0, 0.2);
    --shadow-medium: 0 8px 30px rgba(0, 0, 0, 0.25);
    --shadow-card: 0 4px 16px rgba(0, 0, 0, 0.3);
    --shadow-gold: 0 0 10px rgba(212, 175, 55, 0.3);
    --shadow-purple: 0 0 15px rgba(109, 74, 255, 0.2);
    --transition-standard: all 0.3s ease;
    --radius-standard: 12px;
    --bottom-safe-area: env(safe-area-inset-bottom, 0);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    scroll-behavior: smooth;
    height: 100%;
}

body {
    font-family: var(--font-secondary);
    color: var(--color-text);
    line-height: 1.6;
    background-color: var(--color-background);
    font-size: 16px;
    height: 100%;
    position: fixed;
    overflow: hidden;
    width: 100%;
}

.app-wrapper {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    position: relative;
    background-color: var(--color-background);
}

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

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Typography */
h1, h2, h3, h4 {
    font-family: var(--font-primary);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
}

h1 {
    font-size: clamp(2rem, 5vw, 3rem);
}

h2 {
    font-size: clamp(1.5rem, 4vw, 2rem);
}

h3 {
    font-size: clamp(1.2rem, 3vw, 1.5rem);
}

.main-title {
    color: var(--color-light);
    margin-bottom: 0.25rem;
    letter-spacing: 1px;
}

.subtitle {
    color: var(--color-light);
    font-weight: 400;
    font-size: clamp(1rem, 3vw, 1.5rem);
    opacity: 0.95;
}

p {
    margin-bottom: 1rem;
    font-weight: 300;
    font-size: 1rem;
}

.highlight {
    color: var(--color-accent);
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.small {
    font-size: 0.85rem;
    opacity: 0.8;
    color: var(--color-text-secondary);
}

/* App Header */
.app-header {
    background: linear-gradient(rgba(9, 9, 9, 0.8), rgba(9, 9, 9, 0.9)), url('Photos/IMG_0001.jpeg');
    background-size: cover;
    background-position: center;
    color: var(--color-light);
    text-align: center;
    padding: 2.5rem 1rem;
    position: relative;
    border-bottom: 2px solid var(--color-accent);
    box-shadow: 0 2px 15px rgba(212, 175, 55, 0.2);
}

.main-title {
    font-family: var(--font-primary);
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    letter-spacing: 1px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    background: linear-gradient(to right, var(--color-light), var(--color-secondary), var(--color-light));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: shimmer 3s infinite;
}

.subtitle {
    font-weight: 300;
    margin-bottom: 1rem;
    color: var(--color-secondary);
    letter-spacing: 1px;
}

.gold-text {
    color: var(--color-accent);
    text-shadow: 0 0 10px rgba(212, 175, 55, 0.4);
    font-weight: 600;
}

.header-decoration {
    width: 80px;
    height: 3px;
    background: linear-gradient(to right, transparent, var(--color-accent), transparent);
    margin: 0 auto;
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.4);
}

@keyframes shimmer {
    0% { background-position: -500px; }
    100% { background-position: 500px; }
}

/* App Navigation */
.app-nav {
    background-color: var(--color-dark);
    border-bottom: 1px solid var(--color-secondary);
    z-index: 10;
    box-shadow: 0 2px 10px rgba(192, 192, 192, 0.1);
}

.nav-tabs {
    display: flex;
    justify-content: space-around;
    align-items: center;
}

.nav-tab {
    flex: 1;
    padding: 1rem 0.5rem;
    text-align: center;
    background: transparent;
    border: none;
    font-family: var(--font-primary);
    font-weight: 600;
    color: var(--color-secondary);
    opacity: 0.7;
    font-size: 1rem;
    transition: var(--transition-standard);
    border-bottom: 3px solid transparent;
    cursor: pointer;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    letter-spacing: 0.5px;
}

.nav-tab.active {
    color: var(--color-accent);
    opacity: 1;
    border-bottom-color: var(--color-accent);
}

/* App Content */
.app-content {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: calc(60px + var(--bottom-safe-area));
}

.app-tab {
    display: none;
    padding: 1rem 0;
}

.app-tab.active {
    display: block;
}

/* Card Design */
.card {
    background-color: var(--color-surface);
    border-radius: var(--radius-standard);
    overflow: hidden;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-card);
    border: 1px solid rgba(192, 192, 192, 0.1);
}

.card-header {
    padding: 1.25rem 1.5rem 1rem;
    border-bottom: 1px solid rgba(192, 192, 192, 0.1);
    position: relative;
    background: linear-gradient(145deg, var(--color-surface), rgba(30, 30, 30, 0.8));
}

.card-header h2, .card-header h3 {
    margin-bottom: 0.5rem;
    color: var(--color-accent);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    letter-spacing: 0.5px;
}

.card-header.alert {
    background: linear-gradient(145deg, rgba(212, 175, 55, 0.15), rgba(212, 175, 55, 0.05));
    border-left: 4px solid var(--color-accent);
}

.card-header.alert h3 {
    color: var(--color-accent);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.card-content {
    padding: 1.5rem;
    color: var(--color-text);
    letter-spacing: 0.3px;
    line-height: 1.7;
}

.date-badge, .address-badge {
    display: inline-block;
    font-size: 0.85rem;
    padding: 0.35rem 0.85rem;
    background: linear-gradient(145deg, var(--color-primary), rgba(109, 74, 255, 0.8));
    color: var(--color-light);
    border-radius: 30px;
    position: absolute;
    top: 1.25rem;
    right: 1.5rem;
    box-shadow: var(--shadow-purple);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Location Tab */
.address {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    font-weight: 500;
}

.map-container {
    position: relative;
    border-radius: var(--radius-standard);
    overflow: hidden;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-card);
    height: 250px;
}

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

.action-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.action-btn {
    flex: 1;
    padding: 1rem 0.75rem;
    text-align: center;
    text-decoration: none;
    color: var(--color-secondary);
    border: 1px solid var(--color-secondary);
    border-radius: var(--radius-standard);
    transition: var(--transition-standard);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(192, 192, 192, 0.1);
    -webkit-tap-highlight-color: transparent;
    letter-spacing: 0.3px;
    backdrop-filter: blur(5px);
    background-color: rgba(30, 30, 30, 0.5);
}

.action-btn:hover, .action-btn:active {
    background-color: var(--color-accent);
    color: var(--color-dark);
    border-color: var(--color-accent);
    box-shadow: var(--shadow-gold);
    transform: translateY(-2px);
}

/* RSVP Form */
.rsvp-form {
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 1.25rem;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--color-primary);
    font-size: 0.95rem;
}

.form-control, input, textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid rgba(192, 192, 192, 0.2);
    border-radius: var(--radius-standard);
    font-family: var(--font-secondary);
    font-size: 1rem;
    transition: var(--transition-standard);
    background-color: rgba(18, 18, 18, 0.8);
    color: var(--color-light);
    letter-spacing: 0.3px;
}

input:focus, textarea:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.2);
}

/* Family RSVP */
.family-member {
    background-color: var(--color-background);
    padding: 1rem;
    border-radius: var(--radius-standard);
    margin-bottom: 0.75rem;
}

.family-member-name {
    font-weight: 600;
    color: var(--color-primary);
    margin-bottom: 0.5rem;
}

.family-member-checkbox {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.family-member-checkbox input {
    width: auto;
    height: 20px;
    width: 20px;
    accent-color: var(--color-primary);
    cursor: pointer;
}

.family-member-checkbox label {
    cursor: pointer;
    user-select: none;
    padding: 0.5rem 0;
}

/* Buttons */
.btn-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 1rem 1.5rem;
    border: none;
    border-radius: var(--radius-standard);
    font-family: var(--font-secondary);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition-standard);
    text-align: center;
    background: linear-gradient(145deg, var(--color-accent), rgba(212, 175, 55, 0.8));
    color: var(--color-dark);
    gap: 0.5rem;
    box-shadow: var(--shadow-gold);
    -webkit-tap-highlight-color: transparent;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
    letter-spacing: 0.5px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-submit:hover {
    background: linear-gradient(145deg, var(--color-accent-light), var(--color-accent));
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(212, 175, 55, 0.3);
}

.btn-submit:active {
    transform: translateY(0);
    box-shadow: var(--shadow-soft);
    background: linear-gradient(145deg, rgba(212, 175, 55, 0.8), var(--color-accent));
}

/* Messages */
.error-message, .confirmation-message {
    padding: 1.25rem;
    margin: 1rem 0;
    border-radius: var(--radius-standard);
    text-align: center;
}

.error-message {
    background-color: rgba(220, 53, 69, 0.1);
    color: var(--color-danger);
}

.confirmation-message {
    background-color: rgba(40, 167, 69, 0.1);
    color: var(--color-success);
}

.error-message i, .confirmation-message i {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    display: block;
}

/* Calendar Button */
.calendar-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background-color: var(--color-accent);
    color: var(--color-light);
    text-decoration: none;
    border-radius: var(--radius-standard);
    margin-top: 1.5rem;
    transition: var(--transition-standard);
}

.calendar-btn:hover {
    background-color: #b3844e;
}

/* Admin Styles */
.admin-link-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 900;
}

.admin-link {
    width: 12px;
    height: 12px;
    border: none;
    background: transparent;
    color: rgba(0, 0, 0, 0.2);
    cursor: pointer;
    font-size: 16px;
    padding: 0;
}

.admin-link:hover {
    color: rgba(0, 0, 0, 0.4);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
}

.modal-content {
    background-color: var(--color-light);
    margin: 10% auto;
    padding: 2rem;
    border-radius: var(--radius-standard);
    max-width: 500px;
    position: relative;
    box-shadow: var(--shadow-medium);
    width: 90%;
}

.modal-content.admin-panel {
    max-width: 800px;
    margin: 5% auto;
    max-height: 80vh;
    overflow-y: auto;
    width: 95%;
    padding: 1.5rem;
}

.close {
    color: var(--color-dark);
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

/* Admin Panel Styles */
.admin-tabs {
    display: flex;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--color-secondary);
    flex-wrap: wrap;
}

.admin-tabs .tab-btn {
    padding: 0.75rem 1rem;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--color-text);
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition-standard);
    margin-right: 0.5rem;
    font-size: 0.95rem;
    flex: 1;
    text-align: center;
    min-width: 120px;
}

.admin-tabs .tab-btn.active, .admin-tabs .tab-btn:hover {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
    background: transparent;
}

.admin-tab-content {
    display: none;
}

.admin-tab-content.active {
    display: block;
}

.admin-tab-content h3 {
    margin: 1.5rem 0 1rem;
    color: var(--color-primary);
}

.guest-list-table, .rsvp-list-table {
    width: 100%;
    margin-top: 1rem;
    overflow-x: auto;
    display: block;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 500px; /* Ensures table doesn't shrink too much */
}

table th, table td {
    padding: 0.75rem 0.5rem;
    text-align: left;
    border-bottom: 1px solid var(--color-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

table th {
    background-color: rgba(109, 74, 255, 0.1);
    color: var(--color-accent);
    font-weight: 600;
}

.btn-action {
    padding: 0.5rem 0.6rem;
    font-size: 0.85rem;
    border-radius: 4px;
    margin: 0.1rem;
    display: inline-block;
    border: none;
    cursor: pointer;
    transition: var(--transition-standard);
    margin-right: 0.5rem;
}

.btn-delete {
    background-color: #dc3545;
    color: white;
}

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

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

.rsvp-summary {
    display: flex;
    justify-content: space-around;
    margin-bottom: 2rem;
}

.summary-item {
    text-align: center;
    padding: 1rem;
}

.summary-count {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--color-primary);
    display: block;
}

.summary-label {
    font-size: 1rem;
    color: var(--color-text);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* App Footer */
.app-footer {
    background-color: var(--color-dark);
    padding: 1rem 1rem;
    text-align: center;
    border-top: 1px solid var(--color-accent);
    position: absolute;
    bottom: 0;
    width: 100%;
    padding-bottom: calc(1rem + var(--bottom-safe-area));
    box-shadow: 0 -2px 15px rgba(0, 0, 0, 0.2), 0 -1px 5px rgba(212, 175, 55, 0.2);
}

.footer-content p {
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
    color: var(--color-accent);
    letter-spacing: 0.5px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Entry Fee Alert */
.entry-fee-reminder {
    background-color: rgba(196, 154, 108, 0.1);
    border-left: 4px solid var(--color-accent);
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 4px;
}

/* Hidden Elements */
.hidden {
    display: none !important;
}

/* Responsive Adjustments */
@media (min-width: 768px) {
    .app-wrapper {
        max-width: 768px;
        margin: 0 auto;
        border-left: 1px solid rgba(0, 0, 0, 0.1);
        border-right: 1px solid rgba(0, 0, 0, 0.1);
        height: 100%;
    }
    
    .app-footer {
        max-width: 768px;
        margin: 0 auto;
        left: 50%;
        transform: translateX(-50%);
    }
    
    body {
        background-color: #121212;
    }
}

/* Photo Carousel */
.carousel-container {
    position: relative;
    width: 100%;
    border-radius: var(--radius-standard);
    overflow: hidden;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(192, 192, 192, 0.15);
}

.carousel-slide {
    display: none;
    width: 100%;
}

.carousel-slide.active {
    display: block;
    animation: fadeEffect 1s;
}

.carousel-image {
    width: 100%;
    height: 250px;
    object-fit: cover;
    border-radius: var(--radius-standard);
}

.carousel-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.6);
    color: var(--color-light);
    padding: 0.75rem;
    text-align: center;
    font-style: italic;
    font-family: var(--font-primary);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: var(--color-light);
    font-size: 24px;
    background-color: rgba(0, 0, 0, 0.6);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    z-index: 10;
    transition: all 0.2s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.carousel-nav:hover {
    background-color: rgba(212, 175, 55, 0.8);
}

.carousel-nav.prev {
    left: 10px;
}

.carousel-nav.next {
    right: 10px;
}

.carousel-dots {
    display: flex;
    justify-content: center;
    position: absolute;
    bottom: 40px;
    width: 100%;
    gap: 5px;
    flex-wrap: wrap;
    padding: 0 10px;
}

.carousel-dot {
    width: 8px;
    height: 8px;
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    margin: 0 2px;
}

.carousel-dot.active {
    background-color: var(--color-accent);
    transform: scale(1.2);
    box-shadow: 0 0 8px rgba(212, 175, 55, 0.5);
}

@keyframes fadeEffect {
    from {opacity: 0.4}
    to {opacity: 1}
}

/* Detail items styling */
.detail-item {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    align-items: flex-start;
}

.detail-item i {
    font-size: 24px;
    color: var(--color-primary);
    margin-top: 5px;
}

.detail-item h3 {
    margin-top: 0;
    margin-bottom: 5px;
    color: var(--color-primary);
    font-weight: 600;
}

.detail-item p {
    margin: 0 0 5px 0;
}

/* Event highlights */
.event-highlights {
    list-style: none;
    padding: 0;
    margin: 0;
}

.event-highlights li {
    padding: 10px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.event-highlights i {
    color: var(--color-primary);
    font-size: 18px;
}