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

[x-cloak] {
    display: none !important;
}

html, body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
    width: 100%;
    position: relative;
}

/* Admin Layout */
.admin-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.admin-nav {
    background: #2c3e50;
    color: white;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    flex-wrap: wrap;
    gap: 1rem;
}

.nav-brand h1 {
    font-size: 1.25rem;
    font-weight: 600;
}

.nav-links {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}

.nav-links a {
    color: white;
    text-decoration: none;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    transition: background 0.2s;
    font-size: 0.9rem;
}

.nav-links a:hover {
    background: rgba(255,255,255,0.1);
}

.nav-links .logout {
    background: #e74c3c;
}

.nav-links .logout:hover {
    background: #c0392b;
}

.user-info {
    color: #ecf0f1;
    font-size: 0.85rem;
}

.admin-main {
    flex: 1;
    padding: 1rem;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
}

@media (min-width: 768px) {
    .admin-nav {
        padding: 1rem 2rem;
    }

    .nav-brand h1 {
        font-size: 1.5rem;
    }

    .nav-links {
        gap: 1.5rem;
    }

    .nav-links a {
        padding: 0.5rem 1rem;
        font-size: 1rem;
    }

    .user-info {
        font-size: 0.9rem;
    }

    .admin-main {
        padding: 2rem;
    }
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.page-header h2 {
    font-size: 2rem;
    color: #2c3e50;
}

.header-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

/* Table */
.invitations-table {
    width: 100%;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.invitations-table thead {
    background: #34495e;
    color: white;
}

.invitations-table th,
.invitations-table td {
    padding: 1rem;
    text-align: left;
}

.invitations-table tbody tr {
    border-bottom: 1px solid #ecf0f1;
}

.invitations-table tbody tr:hover {
    background: #f8f9fa;
}

/* Badges */
.status-badges {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success { background: #2ecc71; color: white; }
.badge-warning { background: #f39c12; color: white; }
.badge-info { background: #3498db; color: white; }
.badge-primary { background: #9b59b6; color: white; }

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 0.5rem;
}

/* Forms */
.invitation-form {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    max-width: 600px;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #2c3e50;
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.form-control:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.form-help {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: #7f8c8d;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1.5rem;
}

.alert-error {
    background: #fee;
    color: #c0392b;
    border: 1px solid #e74c3c;
}

.alert-success {
    background: #efe;
    color: #27ae60;
    border: 1px solid #2ecc71;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: white;
    border-radius: 8px;
}

.empty-state p {
    font-size: 1.25rem;
    color: #7f8c8d;
    margin-bottom: 1.5rem;
}

/* Attendance Status */
.attendance-yes {
    color: #27ae60;
    font-weight: 600;
}

.attendance-no {
    color: #e74c3c;
    font-weight: 600;
}

.no-response {
    color: #95a5a6;
}

.plus-one, .kids {
    display: inline-block;
    margin-left: 0.5rem;
    padding: 0.125rem 0.5rem;
    background: #ecf0f1;
    border-radius: 4px;
    font-size: 0.875rem;
}

/* Public/Landing Page Styles */
.public-container {
    min-height: 100vh;
    position: relative;
    padding: 2rem 1rem;
    background-color: oklch(var(--b2));
    overflow-x: hidden;
    width: 100%;
}

.landing-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    background-color: oklch(var(--b2));
    overflow-x: hidden;
    width: 100%;
    touch-action: pan-y pinch-zoom;
}

/* Wrapper for card and decorations */
.invitation-wrapper {
    position: relative;
    overflow: visible; /* Allow decorations to show outside */
    touch-action: pan-y pinch-zoom;
    width: 100%;
    max-width: 672px; /* max-w-2xl for desktop */
    margin: 0 auto;
}

@media (max-width: 768px) {
    .invitation-wrapper {
        max-width: 100% !important;
    }
}

/* Prevent decorations from causing page scroll */
.invitation-wrapper .decoration-element {
    max-width: 100vw; /* Constrain to viewport width */
    max-height: 100vh; /* Constrain to viewport height */
}

/* Card container */
.invitation-card-container {
    position: relative;
    width: 100%;
    max-width: 672px; /* max-w-2xl for desktop */
    margin: 0 auto;
    z-index: 1;
    touch-action: pan-y pinch-zoom;
}

/* Force card to be full width on mobile */
@media (max-width: 768px) {
    .invitation-card-container,
    .invitation-card-container > div {
        max-width: 100% !important;
        width: 100% !important;
    }
}

/* Decorative Elements - Random popup animations */
.decoration-element {
    position: absolute;
    font-size: 4rem;
    opacity: 0;
    z-index: 100;
    pointer-events: none;
    transform: scale(0) rotate(0deg);
    transition: none;
    /* Prevent causing page expansion */
    will-change: transform, opacity;
}

.decoration-element.svg-ladybug {
    width: 6rem;
    height: 6rem;
    font-size: inherit;
}

.decoration-element.svg-ladybug img {
    width: 100%;
    height: 100%;
    display: block;
    /* Hide alt text */
    font-size: 0;
    color: transparent;
}

/* Popup animation - appear, wiggle, disappear with custom rotation */
@keyframes popup {
    0% {
        opacity: 0;
        transform: scale(0) rotate(0deg);
    }
    10% {
        opacity: 0.7;
        transform: scale(1.1) rotate(calc(var(--rotation) + 5deg));
    }
    15% {
        transform: scale(1) rotate(calc(var(--rotation) - 3deg));
    }
    20% {
        transform: scale(1) rotate(calc(var(--rotation) + 2deg));
    }
    25% {
        transform: scale(1) rotate(var(--rotation));
    }
    /* Stay visible */
    85% {
        opacity: 0.7;
        transform: scale(1) rotate(var(--rotation));
    }
    /* Disappear */
    95% {
        opacity: 0;
        transform: scale(0.8) rotate(calc(var(--rotation) + 10deg));
    }
    100% {
        opacity: 0;
        transform: scale(0) rotate(0deg);
    }
}

.decoration-12 {
    animation: rotate-clockwise 26.5s linear infinite;
    animation-delay: -7.3s;
}



.invitation-card-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 10;
    width: 80%;
    max-height: 85%;
}

.invitation-card-overlay p {
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.4;
    text-shadow: 0 1px 3px rgba(255, 255, 255, 0.8);
}

.invitation-card-overlay .btn {
    margin-top: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Custom Scrollbar Styles */
.scrollbar-thin {
    scrollbar-width: thin;
    scrollbar-color: rgba(156, 163, 175, 0.5) transparent;
}

.scrollbar-thin::-webkit-scrollbar {
    width: 6px;
}

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

.scrollbar-thin::-webkit-scrollbar-thumb {
    background-color: rgba(156, 163, 175, 0.5);
    border-radius: 3px;
}

.scrollbar-thin::-webkit-scrollbar-thumb:hover {
    background-color: rgba(156, 163, 175, 0.7);
}

/* RSVP Form - Remove all borders from form controls and sections */
.form-control,
.form-control > *,
div[class*="space-y"] {
    border: none !important;
    box-shadow: none !important;
}

/* RSVP Form Input Borders - Make them invisible when NOT focused */
input.input-bordered:not(:focus),
textarea.textarea-bordered:not(:focus),
.input.input-bordered:not(:focus),
.textarea.textarea-bordered:not(:focus),
input[class*="input-bordered"]:not(:focus),
textarea[class*="textarea-bordered"]:not(:focus) {
    border-width: 0 !important;
    border-style: none !important;
    border-color: transparent !important;
    box-shadow: none !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    .public-container {
        padding: 1rem 0.5rem;
    }

    .decoration-element {
        font-size: 3rem;
    }

    .decoration-element.svg-ladybug {
        width: 4.5rem;
        height: 4.5rem;
    }

    /* Mobile devices will use the same dynamic animation */

    .invitation-card-overlay p {
        font-size: 0.95rem;
    }
}
