/* ==========================================================================
   Konverge Events - Unified Theme & Responsive Stylesheet
   Preserves warm ivory & gold celebratory palette with uniform typography
   ========================================================================== */

:root {
    --bg-page: #F4F1EB;
    --bg-card: #FFFFFF;
    --bg-cream: #FFFAF0;
    --text-main: #262B32;
    --text-muted: #6E6659;
    --gold-primary: #D4AF37;
    --gold-dark: #B58A45;
    --gold-deep: #85704D;
    --accent: #B58A45;
    --border-light: #E6DEC8;
    --danger: #DC2626;
    --success: #15803D;
    --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-serif: 'Cormorant Garamond', Georgia, serif;
    --radius-lg: 20px;
    --radius-md: 12px;
    --radius-sm: 8px;
    --shadow-card: 0 10px 30px rgba(48, 41, 26, 0.08);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background-color: var(--bg-page);
    color: var(--text-main);
    font-family: var(--font-sans);
    font-size: 15px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
    margin-top: 0;
    color: var(--text-main);
    line-height: 1.25;
}

h2 {
    font-family: var(--font-serif);
    font-size: clamp(24px, 4vw, 32px);
    font-weight: 700;
    margin-bottom: 6px;
}

a {
    color: var(--gold-dark);
    text-decoration: none;
}

.container {
    max-width: 1060px;
    margin: 0 auto;
    padding: 16px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Top Bars */
.guest-topbar {
    text-align: center;
    padding: 10px 0 16px;
}

.brand-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 3px;
    color: var(--gold-deep);
    text-transform: uppercase;
}

.admin-navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
    padding: 12px 0 22px;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 20px;
}

.brand-logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 600;
    color: var(--text-main);
    letter-spacing: 0.5px;
}

.brand-logo i {
    color: var(--gold-dark);
    font-size: 22px;
}

.brand-logo strong {
    color: var(--gold-dark);
}

.admin-nav-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.inline-form {
    margin: 0;
    display: inline;
}

/* Cards */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 28px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-card);
    border: 1px solid rgba(212, 175, 55, 0.2);
}

/* Alerts */
.alert {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    border-radius: var(--radius-md);
    margin-bottom: 18px;
    font-size: 14px;
    font-weight: 500;
}

.alert-success {
    background: #DCFCE7;
    color: #166534;
    border: 1px solid #86EFAC;
}

.alert-error {
    background: #FEE2E2;
    color: #991B1B;
    border: 1px solid #FCA5A5;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s ease;
    text-decoration: none;
    line-height: 1.2;
}

.btn-lg {
    padding: 14px 22px;
    font-size: 15px;
    border-radius: var(--radius-md);
}

.btn-sm {
    padding: 8px 12px;
    font-size: 13px;
}

.btn-block {
    width: 100%;
}

.btn-gold {
    background: linear-gradient(135deg, var(--gold-primary), var(--gold-dark));
    color: #1F1809 !important;
    border-color: var(--gold-dark);
    box-shadow: 0 4px 12px rgba(181, 138, 69, 0.25);
}

.btn-gold:hover {
    filter: brightness(1.05);
    transform: translateY(-1px);
}

.btn-outline {
    background: #FFFFFF;
    color: var(--text-main) !important;
    border-color: #D5CCB8;
}

.btn-outline:hover {
    border-color: var(--gold-dark);
    background: var(--bg-cream);
}

.btn-dark {
    background: #213E3B;
    color: #FFFFFF !important;
}

.btn-dark:hover {
    background: #182E2C;
}

.btn-danger {
    background: #FEE2E2;
    color: #B91C1C !important;
    border-color: #FECACA;
}

.btn-danger:hover {
    background: #FECACA;
}

.btn-link-danger {
    background: none;
    border: none;
    color: #B91C1C;
    font-family: var(--font-sans);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    padding: 6px 0 0;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.btn-link-danger:hover {
    text-decoration: underline;
}

/* Forms & Validation */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #3E3629;
    margin-bottom: 6px;
}

.form-group label i {
    color: var(--gold-dark);
    width: 16px;
    text-align: center;
    margin-right: 4px;
}

.required {
    color: var(--danger);
}

.optional-tag {
    font-weight: 400;
    color: var(--text-muted);
    font-size: 12px;
}

input[type="text"],
input[type="tel"],
input[type="email"],
input[type="url"],
input[type="password"],
input[type="datetime-local"],
textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #D5CCB8;
    border-radius: 10px;
    font-family: var(--font-sans);
    font-size: 16px; /* Prevents iOS auto-zoom on focus */
    color: var(--text-main);
    background: #FFFFFF;
    transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus,
textarea:focus {
    outline: none;
    border-color: var(--gold-primary);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.18);
}

input.input-invalid,
textarea.input-invalid {
    border-color: var(--danger);
    background-color: #FFFBFB;
}

.field-error {
    display: block;
    color: var(--danger);
    font-size: 12px;
    font-weight: 500;
    margin-top: 5px;
}

.form-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.form-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.color-picker-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    height: 46px;
    padding: 4px 12px;
    border: 1px solid #D5CCB8;
    border-radius: 10px;
    background: #FFFFFF;
}

input[type="color"] {
    width: 36px;
    height: 32px;
    border: none;
    padding: 0;
    background: none;
    cursor: pointer;
}

.color-hex-label {
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
}

.checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--gold-dark);
}

/* ==========================================================================
   Guest Invitation & Check-In Card
   ========================================================================== */
.guest-event-card {
    max-width: 560px;
    width: 100%;
    margin: 0 auto 22px;
    text-align: center;
    background: linear-gradient(155deg, #FFFFFF 0%, var(--bg-cream) 100%);
    border: 1px solid var(--accent);
    border-bottom: 5px solid var(--accent);
    padding: 32px 24px;
}

.event-banner {
    width: 100%;
    max-height: 220px;
    object-fit: cover;
    border-radius: 14px;
    margin-bottom: 18px;
}

.event-logo {
    max-width: 120px;
    max-height: 80px;
    margin: 0 auto 14px;
    display: block;
}

.ornament {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: var(--accent);
    margin-bottom: 12px;
}

.ornament span {
    width: 48px;
    height: 1px;
    background: var(--accent);
    opacity: 0.6;
}

.eyebrow {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--gold-deep);
    margin: 0 0 6px;
}

.event-title {
    font-family: var(--font-serif);
    font-size: clamp(34px, 7vw, 54px);
    font-weight: 700;
    color: var(--accent);
    margin: 4px 0 18px;
    overflow-wrap: anywhere;
}

.event-meta-pills {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-bottom: 16px;
}

.meta-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: rgba(212, 175, 55, 0.12);
    border: 1px solid rgba(212, 175, 55, 0.3);
    padding: 7px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    color: #3E3629;
}

.meta-pill i {
    color: var(--accent);
}

.welcome-copy {
    font-family: var(--font-serif);
    font-size: 21px;
    font-style: italic;
    color: #574D3D;
    margin: 12px auto 0;
    max-width: 460px;
}

.divider {
    height: 1px;
    background: rgba(212, 175, 55, 0.3);
    margin: 22px 0;
}

.checkin-form {
    text-align: left;
}

.privacy-note {
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
    margin: 12px 0 0;
}

/* Menu Showcase */
.menu-showcase {
    max-width: 780px;
    width: 100%;
    margin: 0 auto 24px;
}

.section-header-center {
    text-align: center;
    margin-bottom: 24px;
}

.badge-checked-in {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #DCFCE7;
    color: #166534;
    padding: 5px 14px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 10px;
}

.menu-category-block {
    margin-top: 24px;
}

.menu-category-title {
    font-family: var(--font-serif);
    font-size: 22px;
    color: var(--gold-dark);
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 8px;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 14px;
}

.menu-item-card {
    background: var(--bg-cream);
    border: 1px solid var(--border-light);
    border-radius: 14px;
    padding: 16px;
}

.menu-item-card h4 {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 6px;
    color: var(--text-main);
}

.menu-item-card p {
    margin: 0;
    font-size: 13px;
    color: var(--text-muted);
}

/* ==========================================================================
   Admin Dashboard & Components
   ========================================================================== */
.auth-card {
    max-width: 440px;
    width: 100%;
    margin: 24px auto;
}

.auth-header {
    text-align: center;
    margin-bottom: 22px;
}

.auth-icon {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: rgba(212, 175, 55, 0.15);
    color: var(--gold-dark);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    margin-bottom: 12px;
}

.stats-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.stat-box {
    background: #FFFFFF;
    border-radius: 16px;
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: var(--shadow-card);
    border: 1px solid rgba(212, 175, 55, 0.2);
}

.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(212, 175, 55, 0.15);
    color: var(--gold-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.stat-label {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 600;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-main);
}

.section-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}

.muted-text {
    color: var(--text-muted);
    margin: 0;
    font-size: 14px;
}

.events-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 18px;
}

.event-card {
    border: 1px solid var(--border-light);
    border-radius: 16px;
    padding: 20px;
    background: #FFFFFF;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.event-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.status-published {
    background: #DCFCE7;
    color: #166534;
}

.status-draft {
    background: #FEF3C7;
    color: #92400E;
}

.color-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid #FFFFFF;
    box-shadow: 0 0 0 1px #D5CCB8;
}

.event-card-title {
    font-family: var(--font-serif);
    font-size: 24px;
    margin-bottom: 8px;
}

.event-card-meta {
    list-style: none;
    padding: 0;
    margin: 0 0 14px;
    font-size: 13px;
    color: var(--text-muted);
}

.event-card-meta li {
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.arrival-counter {
    background: var(--bg-cream);
    border-radius: 12px;
    padding: 12px 14px;
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 14px;
}

.arrival-number {
    font-size: 28px;
    font-weight: 700;
    color: var(--gold-dark);
}

.arrival-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
}

.event-card-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.delete-event-form {
    margin-top: 12px;
    border-top: 1px solid #F1ECE1;
    padding-top: 8px;
    text-align: right;
}

/* Breadcrumb & Menu Admin */
.breadcrumb-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
}

.back-link {
    font-weight: 600;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.quick-links {
    display: flex;
    gap: 8px;
}

.menu-admin-list {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.menu-admin-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid var(--border-light);
    border-radius: 12px;
    background: var(--bg-cream);
}

.menu-cat-pill {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: rgba(212, 175, 55, 0.2);
    color: #5C4514;
    padding: 2px 8px;
    border-radius: 6px;
    margin-right: 8px;
}

.menu-admin-info p {
    margin: 4px 0 0;
    font-size: 13px;
    color: var(--text-muted);
}

/* Guest Table */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.data-table th,
.data-table td {
    padding: 13px 14px;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
    white-space: nowrap;
}

.data-table th {
    background: var(--bg-cream);
    font-weight: 700;
    color: #3E3629;
}

.mail-pill {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}

.pill-success { background: #DCFCE7; color: #166534; }
.pill-danger  { background: #FEE2E2; color: #991B1B; }
.pill-neutral { background: #F3F4F6; color: #4B5563; }

/* QR Poster */
.qr-poster-card {
    max-width: 420px;
    margin: 20px auto;
    padding: 28px 20px;
    text-align: center;
    background: #FFFFFF;
    border: 2px solid var(--gold-primary);
    border-radius: 18px;
}

.qr-poster-brand {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 3px;
    color: var(--gold-dark);
}

.qr-poster-card h3 {
    font-family: var(--font-serif);
    font-size: 30px;
    margin: 8px 0;
}

.qr-poster-meta {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.qr-canvas-wrap canvas {
    max-width: 240px;
    width: 100%;
    height: auto;
    border-radius: 8px;
}

.qr-poster-cta {
    font-weight: 600;
    font-size: 14px;
    margin: 14px 0 0;
}

.qr-actions-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-top: 18px;
}

.qr-status-msg {
    font-size: 13px;
    font-weight: 600;
    color: var(--gold-dark);
}

/* Empty State */
.empty-state-card,
.empty-menu {
    text-align: center;
    padding: 36px 20px;
    color: var(--text-muted);
}

.empty-icon,
.empty-menu i {
    font-size: 40px;
    color: var(--gold-primary);
    margin-bottom: 12px;
}

.display-title {
    font-family: var(--font-serif);
    font-size: clamp(28px, 6vw, 42px);
    color: var(--gold-dark);
}

/* Footer */
.site-footer {
    margin-top: auto;
    text-align: center;
    padding: 18px 8px;
    font-size: 12px;
    color: var(--gold-deep);
}

/* ==========================================================================
   Mobile & Tablet Responsive Breakpoints
   ========================================================================== */
@media (max-width: 768px) {
    .form-grid-2,
    .form-grid-3 {
        grid-template-columns: 1fr;
    }

    .stats-strip {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .container {
        padding: 12px;
    }

    .card {
        padding: 20px 16px;
        border-radius: 16px;
    }

    .guest-event-card {
        padding: 24px 16px;
    }

    .admin-navbar {
        flex-direction: column;
        align-items: stretch;
    }

    .admin-nav-actions {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
    }

    .admin-nav-actions .btn {
        padding: 10px 8px;
        font-size: 12px;
    }

    .qr-actions-bar {
        display: grid;
        grid-template-columns: 1fr;
    }

    .menu-admin-row {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Guest List Table */
.guest-list-table {
    width: 100%;
    min-width: 725px;
    table-layout: fixed;
}

.guest-list-table th,
.guest-list-table td {
    padding: 12px 10px;
    vertical-align: middle;
    overflow-wrap: anywhere;
}

.guest-list-table td small {
    display: inline-block;
    margin-top: 3px;
}

/* Guest list search */
.guest-search {
    position: relative;
    width: 220px;
    max-width: 100%;
}

.guest-search input {
    width: 100%;
    padding: 9px 12px 9px 34px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 13px;
    outline: none;
    box-sizing: border-box;
}

.guest-search input:focus {
    border-color: var(--gold, #b58a45);
}

.guest-search i {
    position: absolute;
    left: 11px;
    top: 50%;
    transform: translateY(-50%);
    color: #888;
    font-size: 13px;
}

@media (max-width: 600px) {
    .section-toolbar {
        flex-wrap: wrap;
        gap: 12px;
    }

    .guest-search {
        width: 100%;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .guest-list-table {
        min-width: 725px;
    }

    .guest-list-table th,
    .guest-list-table td {
        padding: 10px 8px;
        font-size: 13px;
    }
}

@media print {
    body * {
        visibility: hidden;
    }
    #qr-print,
    #qr-print * {
        visibility: visible;
    }
    #qr-print {
        position: fixed;
        inset: 0;
        margin: auto;
        width: 90%;
        max-width: 480px;
        height: fit-content;
    }
}
