/* Style CSS - RSVP Lite Premium Design System (Form Edition) */

:root {
    --font-primary: 'Outfit', sans-serif;
    
    /* Harmonious Dark Mode Palette */
    --bg-primary: #0B0A12;
    --bg-card: rgba(18, 16, 28, 0.65);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-glow: rgba(124, 77, 255, 0.25);
    
    --color-primary: #7C4DFF;
    --color-primary-glow: rgba(124, 77, 255, 0.4);
    --color-secondary: #00E5FF;
    --color-secondary-glow: rgba(0, 229, 255, 0.3);
    
    --text-main: #F4F3F6;
    --text-muted: #8E8A9F;
    
    --color-success: #00E676;
    --color-success-bg: rgba(0, 230, 118, 0.15);
    --color-error: #FF1744;
    --color-error-bg: rgba(255, 23, 68, 0.15);
    
    --glass-blur: 16px;
    --transition-smooth: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

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

body {
    font-family: var(--font-primary);
    background-color: var(--bg-primary);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    overflow-y: auto;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 16px;
}

/* Background Ambient Glows */
.background-decor {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
}

.glow-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.25;
    animation: orbFloat 20s infinite alternate ease-in-out;
}

.orb-1 {
    top: -10%;
    left: -10%;
    width: 50vw;
    height: 50vw;
    background: var(--color-primary);
    animation-delay: 0s;
}

.orb-2 {
    bottom: -10%;
    right: -10%;
    width: 60vw;
    height: 60vw;
    background: var(--color-secondary);
    animation-delay: -5s;
}

@keyframes orbFloat {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(5vw, 5vh) scale(1.15); }
}

/* Screens Management */
.screen {
    display: none;
    width: 100%;
    min-height: 100vh;
    justify-content: center;
    align-items: flex-start;
    padding: 16px 0;
    transition: opacity 0.5s ease;
}

.screen.active {
    display: flex;
}

/* Keep loading/error centered vertically */
#loading-screen.active,
#error-screen.active,
#success-screen.active {
    align-items: center;
    min-height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    padding: 20px;
    background: var(--bg-primary);
    z-index: 20;
}

/* Loading Loader */
.loader-container {
    text-align: center;
}

.pulse-loader {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--color-primary);
    margin: 0 auto 20px;
    box-shadow: 0 0 20px var(--color-primary-glow);
    animation: pulse 1.6s infinite ease-in-out;
}

@keyframes pulse {
    0% { transform: scale(0.6); opacity: 0.3; }
    50% { transform: scale(1); opacity: 1; box-shadow: 0 0 35px var(--color-primary); }
    100% { transform: scale(0.6); opacity: 0.3; }
}

.loader-container p {
    color: var(--text-muted);
    font-size: 16px;
    font-weight: 500;
    letter-spacing: 0.5px;
}

/* Layout Containers */
.container {
    width: 100%;
    max-width: 900px;
    display: grid;
    grid-template-columns: 1fr 1.15fr;
    gap: 14px;
    margin: 0 auto;
    align-items: start;
}

@media (max-width: 868px) {
    .container {
        grid-template-columns: 1fr;
        display: flex;
        flex-direction: column;
        gap: 10px;
    }
}

/* Card Banner Box for Uploaded Invitation Card */
.card-banner-box {
    width: 100%;
    margin-bottom: 12px;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
    background: rgba(0, 0, 0, 0.2);
}

.invitation-card-img {
    width: 100%;
    height: auto;
    max-height: 280px;
    object-fit: contain;
    display: block;
    border-radius: 14px;
}

/* Glassmorphism Cards */
.card {

    background: var(--bg-card);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 18px;
    text-align: center;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.3);
    max-width: 440px;
    width: 100%;
}

/* Event Info Header Banner */
.event-card {
    background: var(--bg-card);
    backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--border-color);
    border-radius: 22px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.25);
}

.event-header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 6px;
}

.category-badge {
    padding: 3px 10px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-color);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--color-secondary);
    letter-spacing: 1px;
}

.app-version-badge {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    padding: 2px 8px;
    border-radius: 10px;
    letter-spacing: 0.5px;
}


.event-card h1 {
    font-size: 20px;
    font-weight: 900;
    line-height: 1.2;
    margin-bottom: 3px;
    background: linear-gradient(135deg, #FFF 0%, var(--text-muted) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.host-line {
    color: var(--text-muted);
    font-size: 12px;
    margin-bottom: 8px;
}

.host-line strong {
    color: var(--text-main);
}

.event-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 7px;
    margin-bottom: 8px;
}

.detail-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 10px;
    padding: 7px 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.detail-item.full-width {
    grid-column: span 2;
    position: relative;
    padding-right: 50px;
}

.detail-item i {
    font-size: 16px;
    color: var(--color-primary);
}

.detail-item div {
    display: flex;
    flex-direction: column;
}

.detail-item .label {
    font-size: 11px;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 600;
    letter-spacing: 0.5px;
}

.detail-item .value {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-main);
}

.maps-btn {
    position: absolute;
    right: 12px;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(124, 77, 255, 0.15);
    border: 1px solid var(--color-primary-glow);
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--color-primary);
    text-decoration: none;
    transition: var(--transition-smooth);
}

.maps-btn:hover {
    background: var(--color-primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px var(--color-primary-glow);
}

.instructions-box {
    margin-top: 6px;
    background: rgba(124, 77, 255, 0.05);
    border: 1px dashed var(--border-glow);
    border-radius: 12px;
    padding: 10px;
}

.instructions-box.hide {
    display: none;
}

.instructions-box .label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 6px;
}

.instructions-box p {
    font-size: 13px;
    color: var(--text-main);
    line-height: 1.5;
}

/* AI Chat Panel */
.chat-panel {
    background: var(--bg-card);
    backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--border-color);
    border-radius: 22px;
    display: flex;
    flex-direction: column;
    min-height: 420px;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.25);
    overflow: hidden;
}

.chat-header {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.02);
    flex-shrink: 0;
}

.assistant-avatar {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: rgba(124, 77, 255, 0.15);
    border: 1px solid var(--border-glow);
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--color-primary);
    font-size: 18px;
    position: relative;
}

.online-indicator {
    width: 10px;
    height: 10px;
    background: var(--color-success);
    border: 2px solid #0B0A12;
    border-radius: 50%;
    position: absolute;
    bottom: -2px;
    right: -2px;
}

.chat-header h3 {
    font-size: 16px;
    font-weight: 700;
}

.chat-header .status {
    font-size: 12px;
    color: var(--text-muted);
}

/* Chat Messages Feed */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    scroll-behavior: smooth;
    min-height: 200px;
    max-height: 380px;
}

/* Chat Bubble styles */
.message-bubble {
    max-width: 82%;
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 13px;
    line-height: 1.5;
    animation: bubbleSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes bubbleSlideIn {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

.message-bubble.assistant {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.message-bubble.user {
    background: linear-gradient(135deg, var(--color-primary), #6200EA);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
    box-shadow: 0 4px 12px rgba(124, 77, 255, 0.15);
}

/* Typing Indicator styling */
.typing-indicator {
    display: flex;
    gap: 5px;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    border-bottom-left-radius: 4px;
    align-self: flex-start;
    width: fit-content;
}

.typing-indicator span {
    width: 7px;
    height: 7px;
    background: var(--text-muted);
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out both;
}

.typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
.typing-indicator span:nth-child(2) { animation-delay: -0.16s; }

@keyframes typingBounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1.0); }
}

/* Chat Input Area */
.chat-input-area {
    padding: 10px 12px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 8px;
    background: rgba(255, 255, 255, 0.01);
    flex-shrink: 0;
}

.chat-input-area input {
    flex: 1;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 10px 14px;
    color: var(--text-main);
    font-family: var(--font-primary);
    font-size: 13px;
    outline: none;
    transition: var(--transition-smooth);
}

.chat-input-area input:focus {
    border-color: var(--border-glow);
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 0 10px rgba(124, 77, 255, 0.15);
}

.send-btn {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--color-primary);
    border: none;
    color: white;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 12px rgba(124, 77, 255, 0.25);
    flex-shrink: 0;
}

.send-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(124, 77, 255, 0.4);
}

/* Success Card */
.success-card, .error-card {
    max-width: 450px;
    padding: 40px;
}

.success-icon-container {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--color-success-bg);
    border: 1px solid rgba(0, 230, 118, 0.3);
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto 24px;
    color: var(--color-success);
    font-size: 40px;
}

.animate-scale {
    animation: scaleIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes scaleIn {
    from { transform: scale(0); }
    to { transform: scale(1); }
}

.success-card h2 {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 12px;
}

.success-card p {
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 28px;
}

.rsvp-summary {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 20px;
    text-align: left;
    margin-bottom: 28px;
}

.rsvp-summary h3 {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 16px;
    color: var(--text-muted);
}

.summary-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.summary-item {
    display: flex;
    flex-direction: column;
}

.summary-label {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.summary-value {
    font-size: 14px;
    font-weight: 700;
}

.summary-value#summary-status {
    color: var(--color-success);
}

.reopen-chat-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    padding: 12px 24px;
    border-radius: 16px;
    font-family: var(--font-primary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 auto;
}

.reopen-chat-btn:hover {
    color: var(--text-main);
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.03);
}

/* Error Card Specific */
.error-icon {
    font-size: 52px;
    color: var(--color-error);
    margin-bottom: 24px;
}

.error-card h2 {
    font-size: 22px;
    margin-bottom: 12px;
}
