/*
 * File: rsvp-styles.css
 * Theme: Sneat MUI Dashboard
 * Design System: Professional Clean with Soft Shadows
 */

/* ---------- IMPORT PUBLIC SANS FONT ---------- */
@import url('https://fonts.googleapis.com/css2?family=Public+Sans:wght@400;500;600;700&display=swap');

/* ---------- IMPORT FONT AWESOME ---------- */
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css');

/* ---------- DESIGN TOKENS (SNEAT MUI) ---------- */
:root {
    /* Typography */
    --font-ui: "Public Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

    /* Text Colors */
    --text-primary: rgba(50, 71, 92, 0.87);
    /* #32475c with opacity */
    --text-secondary: rgba(50, 71, 92, 0.6);
    --text-muted: rgba(50, 71, 92, 0.38);
    --text-white: #ffffff;

    /* Surfaces */
    --page-bg: #f5f5f9;
    /* Light blue-gray */
    --panel-bg: #ffffff;
    --panel-hover: #fafafa;

    /* Primary Color */
    --primary: #696cff;
    /* Vibrant purple/indigo */
    --primary-light: rgba(105, 108, 255, 0.08);
    --primary-hover: #5f61e6;

    /* Status Colors */
    --success: #84b16c;
    --success-light: rgba(132, 177, 108, 0.08);
    --warning: #ffab00;
    --warning-light: rgba(255, 171, 0, 0.08);
    --error: #ff4c51;
    --error-light: rgba(255, 76, 81, 0.08);
    --info: #03c3ec;
    --info-light: rgba(3, 195, 236, 0.08);

    /* Borders */
    --border: rgba(50, 71, 92, 0.12);
    --border-strong: rgba(50, 71, 92, 0.2);

    /* Shadows */
    --shadow-card: 0px 2px 6px 0px rgba(47, 43, 61, 0.14);
    --shadow-hover: 0px 4px 12px 0px rgba(47, 43, 61, 0.2);

    /* Spacing */
    --space-4: 16px;
    --space-6: 24px;
    --space-8: 32px;

    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;
}

/* ---------- RESET & BASE ---------- */
.rsvp-container * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.rsvp-body {
    min-height: 100vh;
    margin: 0;
    background: var(--page-bg);
    font-family: var(--font-ui);
    color: var(--text-primary);
    padding: 5px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* ---------- MAIN CONTAINER ---------- */

.rsvp-container {
    max-width: 100%;
    margin: 24px auto 40px;
    padding: 0 16px;
    font-family: var(--font-ui);
    color: var(--text-primary);
}

/* ---------- GENERIC CARD ---------- */

.rsvp-card {
    background-color: var(--panel-bg);
    border-radius: var(--radius-lg);
    border: none;
    box-shadow: var(--shadow-card);
    padding: 20px;
    transition: box-shadow 0.2s ease;
}

.rsvp-card:hover {
    box-shadow: var(--shadow-hover);
}

/* ---------- DASHBOARD HEADER ---------- */

.rsvp-dashboard-header {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 24px;
}

.rsvp-dashboard-header-main {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.rsvp-dashboard-title-block {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.rsvp-dashboard-title {
    font-size: 22px;
    line-height: 1.3;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

p.rsvp-dashboard-event-title {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-secondary);
}

.rsvp-dashboard-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Chips */
.rsvp-dashboard-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.rsvp-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    border: none;
    white-space: nowrap;
}

.rsvp-chip-primary {
    background-color: var(--success-light);
    color: var(--success);
}

.rsvp-chip-soft {
    background-color: rgba(50, 71, 92, 0.08);
    color: var(--text-secondary);
}

/* ---------- STATISTICS PANEL (SNEAT MUI STYLE) ---------- */

.rsvp-stats-panel {
    margin: 24px 0;
    padding: 0;
}

.rsvp-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.rsvp-stat-card {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 20px;
    background: var(--panel-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    transition: all 0.2s ease;
}

.rsvp-stat-card:hover {
    box-shadow: var(--shadow-hover);
}

/* Icon Box (Soft Pastel Background) */
.rsvp-stat-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: var(--radius-md);
    font-size: 22px;
    flex-shrink: 0;
}

.rsvp-stat-card--primary .rsvp-stat-icon {
    background-color: var(--primary-light);
    color: var(--primary);
}

.rsvp-stat-card--success .rsvp-stat-icon {
    background-color: var(--success-light);
    color: var(--success);
}

.rsvp-stat-card--danger .rsvp-stat-icon {
    background-color: var(--error-light);
    color: var(--error);
}

.rsvp-stat-card--info .rsvp-stat-icon {
    background-color: var(--info-light);
    color: var(--info);
}

.rsvp-stat-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.rsvp-stat-label {
    font-size: 13px;
    font-weight: 400;
    color: var(--text-secondary);
    text-transform: none;
    letter-spacing: 0;
}

.rsvp-stat-value {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.2;
    letter-spacing: -0.01em;
}

.rsvp-stat-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Progress Bar */
.rsvp-stat-progress {
    margin-top: 8px;
    height: 6px;
    background-color: rgba(50, 71, 92, 0.08);
    border-radius: 10px;
    overflow: hidden;
}

.rsvp-stat-progress-bar {
    height: 100%;
    background-color: var(--success);
    border-radius: 10px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Trend Badge */
.rsvp-stat-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 600;
}

.rsvp-stat-badge--positive {
    background-color: var(--success-light);
    color: var(--success);
}

.rsvp-stat-badge--negative {
    background-color: var(--error-light);
    color: var(--error);
}

/* ---------- HEADER ACTIONS ---------- */

.rsvp-dashboard-header-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.rsvp-export-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ---------- ID SWITCHER ---------- */

.rsvp-dashboard-id-switcher {
    display: none;
    flex-direction: column;
    gap: 8px;
}

.rsvp-dashboard-id-switcher__label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    text-transform: none;
    letter-spacing: 0;
}

.rsvp-dashboard-id-switcher__controls {
    display: flex;
    gap: 8px;
}

.rsvp-dashboard-id-switcher__controls input[type="text"] {
    flex: 1;
    min-width: 0;
}

/* Common input style */
.rsvp-dashboard-id-switcher__controls input[type="text"],
.rsvp-password-form input[type="text"],
.rsvp-table-search__input {
    padding: 10px 14px;
    font-size: 15px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background-color: var(--panel-bg);
    color: var(--text-primary);
    transition: all 0.2s ease;
    min-height: 38px;
    font-family: var(--font-ui);
}

.rsvp-dashboard-id-switcher__controls input[type="text"]::placeholder,
.rsvp-password-form input[type="text"]::placeholder,
.rsvp-table-search__input::placeholder {
    color: var(--text-muted);
}

.rsvp-dashboard-id-switcher__controls input[type="text"]:focus,
.rsvp-password-form input[type="text"]:focus,
.rsvp-table-search__input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-light);
}

/* Primary buttons (Sneat style - solid primary) */
.rsvp-dashboard-id-switcher__button,
.rsvp-password-form button[type="submit"] {
    background-color: var(--primary);
    color: var(--text-white);
    box-shadow: 0px 2px 4px 0px rgba(105, 108, 255, 0.4);
    width: 100%;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    border-radius: var(--radius-md);
    padding: 10px 20px;
    font-size: 15px;
    font-weight: 500;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    min-height: 38px;
    text-transform: none;
    letter-spacing: 0;
}

.rsvp-dashboard-id-switcher__button:hover,
.rsvp-password-form button[type="submit"]:hover {
    background-color: var(--primary-hover);
    box-shadow: 0px 4px 8px 0px rgba(105, 108, 255, 0.4);
}

.rsvp-dashboard-id-switcher__button:active,
.rsvp-password-form button[type="submit"]:active {
    transform: scale(0.98);
}

/* Export button */
.rsvp-export-button {
    width: 100%;
    background-color: var(--success);
    color: var(--text-white);
    border: none;
    border-radius: var(--radius-md);
    padding: 10px 20px;
    font-size: 15px;
    font-weight: 500;
    box-shadow: 0px 2px 4px 0px rgba(132, 177, 108, 0.4);
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    text-decoration: none;
    min-height: 38px;
    text-transform: none;
    letter-spacing: 0;
}

.rsvp-export-button:hover {
    background-color: #7aa361;
    box-shadow: 0px 4px 8px 0px rgba(132, 177, 108, 0.4);
    color: var(--text-white);
    text-decoration: none;
}

.rsvp-export-button:active {
    transform: scale(0.98);
    text-decoration: none;
}

.rsvp-export-button:link,
.rsvp-export-button:visited,
.rsvp-export-button:focus {
    text-decoration: none;
    color: var(--text-white);
}

/* Logout button */
button#rsvp-reset-storage {
    width: 100%;
    background-color: var(--error);
    color: var(--text-white);
    border: none;
    border-radius: var(--radius-md);
    padding: 10px 20px;
    font-size: 15px;
    font-weight: 500;
    box-shadow: 0px 2px 4px 0px rgba(255, 76, 81, 0.4);
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 0;
    min-height: 38px;
    text-transform: none;
    letter-spacing: 0;
}

button#rsvp-reset-storage:hover {
    background-color: #e6474c;
    box-shadow: 0px 4px 8px 0px rgba(255, 76, 81, 0.4);
}

button#rsvp-reset-storage:active {
    transform: scale(0.98);
}

/* ---------- PASSWORD FORM (GATE) ---------- */

.rsvp-password-form {
    max-width: 90vw;
    margin: 60px auto;
    text-align: left;
    background: var(--panel-bg);
    padding: 28px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
}

.rsvp-password-form h2 {
    font-size: 22px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.rsvp-password-form p.hint {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 20px;
    line-height: 1.5;
}

.rsvp-password-form__form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.rsvp-password-form__label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    text-transform: none;
    letter-spacing: 0;
}

/* ---------- DASHBOARD BODY ---------- */

.rsvp-dashboard-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ---------- TABLE CARD ---------- */

.rsvp-table-card {
    padding: 20px;
}

.rsvp-table-card-header {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 16px;
}

.rsvp-table-card-header-main {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.rsvp-table-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.rsvp-table-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Table search */
.rsvp-table-search {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.rsvp-table-search__label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    text-transform: none;
    letter-spacing: 0;
}

/* ---------- TABLE STYLES (SNEAT MUI) ---------- */

.rsvp-table-wrapper {
    margin-top: 16px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-lg);
    background-color: var(--panel-bg);
}

.rsvp-table {
    width: 100%;
    min-width: 640px;
    border-collapse: collapse;
    font-size: 15px;
    text-align: left;
}

.rsvp-table thead {
    background-color: var(--panel-hover);
}

.rsvp-table th,
.rsvp-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    border-left: none;
    border-right: none;
    border-top: none;
}

.rsvp-table th {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.rsvp-table td {
    color: var(--text-primary);
    vertical-align: middle;
    font-weight: 400;
    font-size: 12px;
}

.rsvp-table tbody tr:last-child td {
    border-bottom: none;
}

.rsvp-table tbody tr:hover {
    background-color: var(--panel-hover);
}

/* First column (No) */
.rsvp-table td:first-child {
    text-align: center;
    font-weight: 500;
    color: var(--text-secondary);
    width: 44px;
    white-space: nowrap;
}

/* Name column */
.rsvp-table td:nth-child(2) {
    font-weight: 600;
    color: var(--text-primary);
}

/* Date column */
.rsvp-table td:last-child {
    white-space: nowrap;
    font-size: 13px;
    color: var(--text-secondary);
}

/* ---------- EMPTY STATE ---------- */

.rsvp-dashboard-empty {
    padding: 20px;
}

.no-rsvp-entries {
    text-align: left;
    color: var(--error);
    background-color: var(--error-light);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 76, 81, 0.2);
    padding: 14px 16px;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 16px;
}

.rsvp-dashboard-id-switcher--inline {
    margin-top: 8px;
}

/* ---------- MOBILE HINT (SCROLL) ---------- */

@media (max-width: 767px) {
    .rsvp-table-wrapper::before {
        content: "← Geser untuk lihat semua kolom →";
        display: block;
        padding: 10px;
        font-size: 12px;
        font-weight: 500;
        color: var(--text-secondary);
        background-color: var(--panel-hover);
        border-bottom: 1px solid var(--border);
        text-align: center;
    }
}

/* ---------- RESPONSIVE BREAKPOINTS ---------- */

@media (min-width: 768px) {
    .rsvp-container {
        margin-top: 32px;
        padding: 0 24px;
    }

    .rsvp-dashboard-header {
        align-items: center;
        justify-content: space-between;
        flex-direction: row;
    }

    .rsvp-dashboard-header-main {
        max-width: 60%;
    }

    .rsvp-dashboard-header-actions {
        flex-direction: row;
        align-items: flex-end;
        gap: 12px;
    }

    .rsvp-export-button {
        width: auto;
        padding-inline: 20px;
    }

    button#rsvp-reset-storage {
        width: auto;
    }

    .rsvp-table-card {
        padding: 24px;
    }

    .rsvp-table-card-header {
        flex-direction: row;
        align-items: flex-end;
        justify-content: space-between;
    }

    .rsvp-password-form {
        padding: 32px;
    }

    /* Stats panel responsive */
    .rsvp-stats-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 20px;
    }
}

@media (min-width: 1024px) {
    .rsvp-container {
        max-width: 1200px;
        padding: 0 32px;
    }

    .rsvp-dashboard-title {
        font-size: 24px;
    }

    .rsvp-table {
        min-width: auto;
    }
}

/* Mobile stats adjustments */
@media (max-width: 767px) {
    .rsvp-stats-grid {
        gap: 14px;
    }

    .rsvp-stat-card {
        padding: 16px;
    }

    .rsvp-stat-icon {
        width: 38px;
        height: 38px;
        font-size: 20px;
    }

    .rsvp-stat-value {
        font-size: 20px;
    }

    .rsvp-stat-label {
        font-size: 12px;
    }
}