/* =============================================================================
   Munir's Birthday RSVP — Design System
   ============================================================================= */

/* ── Design Tokens ─────────────────────────────────────────────────────────── */
:root {
    --bg: #FFF8F0;
    --card: #FFFFFF;
    --primary: #E85D3A;
    --primary-dark: #C94A2A;
    --accent: #F4A261;
    --text: #2C1810;
    --text-muted: #8B7355;
    --border: #E8DDD0;
    --success: #4CAF50;
    --info: #5B9BD5;
    --error: #E53935;
    --shadow: 0 2px 16px rgba(44, 24, 16, 0.06);
    --radius: 16px;
    --radius-sm: 12px;
    --transition: 0.2s ease;
}

/* ── Action Hub ───────────────────────────────────────────────────────────── */
.action-hub {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
}

.action-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--card);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 12px;
    text-decoration: none;
    color: var(--text);
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    box-shadow: var(--shadow);
    text-align: center;
    min-height: 120px;
}

.action-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 24px rgba(44, 24, 16, 0.12);
    border-color: var(--primary);
}

.action-card:active {
    transform: translateY(0);
}

.action-card-emoji {
    font-size: 2rem;
    margin-bottom: 6px;
    display: block;
}

.action-card-title {
    font-family: 'DM Serif Display', serif;
    font-size: 1rem;
    margin-bottom: 2px;
    color: var(--text);
}

.action-card-desc {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 300;
    line-height: 1.3;
}

.action-card--primary {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-color: transparent;
    color: white;
}

.action-card--primary .action-card-title,
.action-card--primary .action-card-desc {
    color: white;
}

.action-card--primary .action-card-desc {
    opacity: 0.9;
}

.action-card--primary:hover {
    border-color: transparent;
    box-shadow: 0 6px 24px rgba(232, 93, 58, 0.3);
}

/* ── Info Grid (dramatic party details) ────────────────────────────────────── */
.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
}

.info-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px 16px;
    text-align: center;
    box-shadow: var(--shadow);
}

.info-card-emoji {
    font-size: 2.4rem;
    display: block;
    margin-bottom: 8px;
}

.info-card-title {
    font-family: 'DM Serif Display', serif;
    font-size: 1.05rem;
    color: var(--text);
    margin-bottom: 4px;
}

.info-card-detail {
    font-size: 0.88rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.info-card-detail a {
    display: inline-block;
    margin-top: 6px;
    color: var(--primary);
    font-weight: 500;
    text-decoration: none;
    font-size: 0.82rem;
}

.info-card-detail a:hover {
    text-decoration: underline;
}

.info-card--wide {
    grid-column: 1 / -1;
}

.info-card--highlight {
    background: #FFF3E0;
    border-color: #FFE0B2;
}

/* ── Form Modal (wider for RSVP form) ──────────────────────────────────────── */
.modal-dialog--form {
    max-width: 480px;
    text-align: left;
    padding: 28px 24px 24px;
}

.modal-dialog--form .modal-emoji {
    text-align: center;
}

.modal-dialog--form .modal-title {
    text-align: center;
}

.modal-dialog--form .modal-message {
    text-align: center;
}

/* ── Reset & Base ──────────────────────────────────────────────────────────── */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ── Layout ────────────────────────────────────────────────────────────────── */
.container {
    max-width: 560px;
    margin: 0 auto;
    padding: 24px 20px 48px;
}

.container--wide {
    max-width: 800px;
}

/* ── Hero ──────────────────────────────────────────────────────────────────── */
.hero {
    text-align: center;
    padding: 40px 0 32px;
}

.hero-emoji {
    font-size: 56px;
    margin-bottom: 12px;
    display: block;
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-8px);
    }
}

.hero h1 {
    font-family: 'DM Serif Display', serif;
    font-size: 2rem;
    color: var(--text);
    margin-bottom: 8px;
    letter-spacing: -0.01em;
}

.hero-date {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--primary);
    margin-bottom: 4px;
}

.hero-time {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* ── Cards ─────────────────────────────────────────────────────────────────── */
.card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 28px 24px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.card h2 {
    font-family: 'DM Serif Display', serif;
    font-size: 1.25rem;
    margin-bottom: 12px;
    color: var(--text);
}

.card p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 8px;
}

.card p:last-child {
    margin-bottom: 0;
}

/* ── Info Rows ─────────────────────────────────────────────────────────────── */
.info-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.info-row:last-child {
    border-bottom: none;
}

.info-icon {
    font-size: 1.3rem;
    width: 28px;
    text-align: center;
    flex-shrink: 0;
    padding-top: 2px;
}

.info-content strong {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text);
}

.info-content span {
    font-size: 0.88rem;
    color: var(--text-muted);
}

/* ── Counter ───────────────────────────────────────────────────────────────── */
.counter {
    text-align: center;
    padding: 20px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 14px;
    color: white;
    margin-bottom: 20px;
}

.counter-number {
    font-family: 'DM Serif Display', serif;
    font-size: 2.8rem;
    line-height: 1;
}

.counter-label {
    font-size: 0.85rem;
    opacity: 0.9;
    margin-top: 4px;
    font-weight: 300;
}

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

.form-group label {
    display: block;
    font-weight: 500;
    font-size: 0.88rem;
    margin-bottom: 6px;
    color: var(--text);
}

.form-group .optional {
    color: var(--text-muted);
    font-weight: 300;
    font-size: 0.82rem;
}

input,
select,
textarea {
    width: 100%;
    padding: 14px 16px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    background: var(--bg);
    color: var(--text);
    transition: border-color var(--transition), box-shadow var(--transition);
    -webkit-appearance: none;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(232, 93, 58, 0.12);
}

textarea {
    resize: vertical;
    min-height: 80px;
}

select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238B7355' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

/* ── Buttons ───────────────────────────────────────────────────────────────── */
.btn {
    display: block;
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: 'Outfit', sans-serif;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition), transform 0.1s;
    letter-spacing: 0.01em;
    text-align: center;
    text-decoration: none;
    line-height: 1.4;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn:active {
    transform: scale(0.98);
}

.btn-danger {
    background: transparent;
    color: var(--error);
    border: 1.5px solid var(--error);
    margin-top: 12px;
}

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

.btn-success {
    background: var(--success);
    color: white;
    margin-top: 12px;
}

.btn-success:hover {
    background: #43A047;
}

.btn-secondary {
    background: var(--bg);
    color: var(--text);
    border: 1.5px solid var(--border);
    margin-top: 12px;
}

/* ── Flash Messages ────────────────────────────────────────────────────────── */
.flash {
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    font-size: 0.92rem;
    font-weight: 500;
}

.flash-success {
    background: #E8F5E9;
    color: #2E7D32;
    border: 1px solid #C8E6C9;
}

.flash-error {
    background: #FFEBEE;
    color: #C62828;
    border: 1px solid #FFCDD2;
}

.flash-info {
    background: #E3F2FD;
    color: #1565C0;
    border: 1px solid #BBDEFB;
}

/* ── Contribution Box ──────────────────────────────────────────────────────── */
.contribution-box {
    background: #FFF3E0;
    border: 1.5px solid #FFE0B2;
    border-radius: var(--radius-sm);
    padding: 16px 18px;
    margin-top: 12px;
}

.contribution-box strong {
    color: var(--primary);
    font-size: 1.05rem;
}

.contribution-box p {
    margin-top: 6px;
    font-size: 0.88rem;
    color: var(--text-muted);
}

/* ── Status Badges ─────────────────────────────────────────────────────────── */
.status-badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 16px;
}

.status-confirmed {
    background: #E8F5E9;
    color: #2E7D32;
}

.status-cancelled {
    background: #FFEBEE;
    color: #C62828;
}

/* ── Detail Rows (manage page) ─────────────────────────────────────────────── */
.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.93rem;
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    color: var(--text-muted);
}

.detail-value {
    font-weight: 500;
    text-align: right;
}

/* ── Reconfirm Note ────────────────────────────────────────────────────────── */
.reconfirm-note {
    background: #FFF3E0;
    border: 1.5px solid #FFE0B2;
    border-radius: var(--radius-sm);
    padding: 16px;
    margin-top: 16px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* ── Admin Header ──────────────────────────────────────────────────────────── */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
    flex-wrap: wrap;
    gap: 12px;
}

.header h1 {
    font-family: 'DM Serif Display', serif;
    font-size: 1.6rem;
}

.header-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.header-actions a,
.header-actions button {
    padding: 10px 18px;
    border-radius: 10px;
    font-family: 'Outfit', sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    border: 1.5px solid var(--border);
    background: var(--card);
    color: var(--text);
    transition: all var(--transition);
}

.header-actions a:hover,
.header-actions button:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-send {
    background: var(--primary) !important;
    color: white !important;
    border-color: var(--primary) !important;
}

.btn-send:hover {
    background: var(--primary-dark) !important;
}

/* ── Admin Stats Grid ──────────────────────────────────────────────────────── */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 14px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--card);
    border-radius: 14px;
    padding: 20px 18px;
    text-align: center;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.stat-number {
    font-family: 'DM Serif Display', serif;
    font-size: 2.2rem;
    color: var(--primary);
}

.stat-label {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ── Admin Tables ──────────────────────────────────────────────────────────── */
.guest-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.guest-table th {
    text-align: left;
    padding: 10px 8px;
    border-bottom: 2px solid var(--border);
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.guest-table td {
    padding: 12px 8px;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}

.guest-table tr:last-child td {
    border-bottom: none;
}

.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-confirmed {
    background: #E8F5E9;
    color: #2E7D32;
}

.badge-reconfirmed {
    background: #E3F2FD;
    color: #1565C0;
}

.badge-pending {
    background: #FFF3E0;
    color: #E65100;
}

.badge-cancelled {
    background: #FFEBEE;
    color: #C62828;
}

.remove-btn {
    background: none;
    border: none;
    color: var(--error);
    cursor: pointer;
    font-size: 0.8rem;
    font-family: 'Outfit', sans-serif;
    text-decoration: underline;
}

.remove-btn:hover {
    color: #B71C1C;
}

.notes-cell {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-muted);
    font-size: 0.82rem;
}

/* ── Share Box (admin) ─────────────────────────────────────────────────────── */
.share-box {
    background: var(--bg);
    border-radius: 10px;
    padding: 14px;
    margin-top: 12px;
    cursor: pointer;
    transition: background var(--transition);
}

.share-box:hover {
    background: #F5EDE0;
}

.share-box code {
    font-size: 0.82rem;
    word-break: break-all;
    color: var(--primary);
}

.share-box small {
    display: block;
    margin-top: 6px;
    color: var(--text-muted);
    font-size: 0.78rem;
}

/* ── Empty State ───────────────────────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 32px;
    color: var(--text-muted);
}

/* ── Admin Login ───────────────────────────────────────────────────────────── */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card {
    background: white;
    border-radius: var(--radius);
    padding: 36px 28px;
    width: 100%;
    max-width: 380px;
    margin: 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.login-card h2 {
    font-size: 1.3rem;
    margin-bottom: 24px;
    text-align: center;
    color: var(--text);
}

.login-card label {
    display: block;
    font-weight: 500;
    font-size: 0.88rem;
    margin-bottom: 6px;
    color: var(--text);
}

.login-card input {
    margin-bottom: 16px;
}

/* ── Footer ────────────────────────────────────────────────────────────────── */
.footer {
    text-align: center;
    padding: 24px 0;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.footer a {
    color: var(--primary);
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

/* ── Back Link ─────────────────────────────────────────────────────────────── */
.back-link {
    display: block;
    text-align: center;
    margin-top: 20px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
}

.back-link:hover {
    color: var(--primary);
}

/* ── Custom Modal ──────────────────────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(44, 24, 16, 0.45);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
    padding: 20px;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-dialog {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: 0 16px 48px rgba(44, 24, 16, 0.18);
    border: 1px solid var(--border);
    padding: 32px 28px 24px;
    max-width: 400px;
    width: 100%;
    text-align: center;
    transform: scale(0.92) translateY(12px);
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-overlay.active .modal-dialog {
    transform: scale(1) translateY(0);
}

.modal-emoji {
    font-size: 48px;
    display: block;
    margin-bottom: 12px;
}

.modal-title {
    font-family: 'DM Serif Display', serif;
    font-size: 1.25rem;
    color: var(--text);
    margin-bottom: 8px;
}

.modal-message {
    font-size: 0.92rem;
    color: var(--text-muted);
    margin-bottom: 24px;
    line-height: 1.5;
}

.modal-actions {
    display: flex;
    gap: 10px;
}

.modal-actions .btn {
    flex: 1;
    padding: 14px 12px;
    margin: 0;
    font-size: 0.95rem;
}

.modal-btn-cancel {
    background: var(--bg);
    color: var(--text);
    border: 1.5px solid var(--border);
}

.modal-btn-cancel:hover {
    background: #F0E8DC;
}

/* ── Responsive ────────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
    .guest-table {
        font-size: 0.82rem;
    }

    .guest-table .hide-mobile {
        display: none;
    }

    .header {
        flex-direction: column;
        align-items: flex-start;
    }

    .stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .modal-overlay {
        /* Drop flex centering on mobile so native scroll works on iOS */
        display: block;
        overflow-y: scroll;
        -webkit-overflow-scrolling: touch;
        padding: 20px 16px;
    }

    .modal-dialog {
        padding: 24px 20px 20px;
        margin: 0 auto 40px;
        position: relative;
    }

    .modal-actions {
        flex-direction: column;
    }
}