/* ==========================================================================
 * MIDNIGHT LOUNGE - UI Componenten
 * REGULR.vip Loyalty Platform
 *
 * Herbruikbare componenten: buttons, formulieren, navigatie, alerts, badges,
 * tabellen, modals, lijsten, loadingskeletons
 * Laatste update: 2026-04-17
 * ========================================================================== */

/* --------------------------------------------------------------------------
 * 1. BUTTONS
 * -------------------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-stack);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    width: 100%;
    line-height: 1.4;
    -webkit-tap-highlight-color: transparent;
}

.btn-primary {
    background: var(--accent-gradient);
    color: #000;
}

.btn-primary:hover {
    transform: scale(1.02);
    filter: brightness(1.1);
}

.btn-primary:active {
    transform: scale(0.98);
    filter: brightness(0.95);
}

.btn-secondary {
    background: var(--glass-bg);
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-danger {
    background: rgba(244, 67, 54, 0.2);
    color: var(--error);
    border: 1px solid rgba(244, 67, 54, 0.3);
}

.btn-danger:hover {
    background: rgba(244, 67, 54, 0.3);
}

.btn-success {
    background: rgba(76, 175, 80, 0.2);
    color: var(--success);
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.btn-success:hover {
    background: rgba(76, 175, 80, 0.3);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: none;
}

.btn-ghost:hover {
    color: var(--text-primary);
    background: var(--glass-bg);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 14px;
    width: auto;
}

.btn-icon {
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: var(--radius-md);
    flex-shrink: 0;
}

.btn:disabled,
.btn[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    filter: none !important;
}

/* Button group */
.btn-group {
    display: flex;
    gap: 0.5rem;
}

.btn-group .btn {
    flex: 1;
}

/* --------------------------------------------------------------------------
 * 2. FORMULIEREN
 * -------------------------------------------------------------------------- */
.form-group {
    margin-bottom: 1.25rem;
}

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

.form-input {
    width: 100%;
    padding: 0.875rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-stack);
    font-size: 16px;
    transition: var(--transition);
}

.form-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(255, 193, 7, 0.15);
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.form-input--error {
    border-color: var(--error);
    box-shadow: 0 0 0 3px rgba(244, 67, 54, 0.1);
}

.form-error {
    display: block;
    font-size: 12px;
    color: var(--error);
    margin-top: 0.25rem;
}

.form-hint {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

select.form-input {
    appearance: none;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='rgba(255,255,255,0.6)' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

/* Dropdown options - dark background with visible text */
select.form-input option {
    background: #1a1a1a;
    color: #ffffff;
    padding: 0.5rem;
}

textarea.form-input {
    resize: vertical;
    min-height: 100px;
}

/* Checkbox / toggle switch */
.form-toggle {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
}

.form-toggle__track {
    position: relative;
    width: 48px;
    height: 26px;
    background: var(--glass-border);
    border-radius: var(--radius-full);
    transition: var(--transition);
    flex-shrink: 0;
}

.form-toggle__track::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    background: var(--text-primary);
    border-radius: 50%;
    transition: var(--transition);
}

.form-toggle input:checked + .form-toggle__track {
    background: var(--accent-primary);
}

.form-toggle input:checked + .form-toggle__track::after {
    transform: translateX(22px);
}

.form-toggle input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.form-toggle__label {
    font-size: 14px;
    color: var(--text-secondary);
}

/* --------------------------------------------------------------------------
 * 3. NAVIGATIE
 * -------------------------------------------------------------------------- */
.nav-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    position: sticky;
    top: 0;
    z-index: var(--z-sticky);
    background: rgba(15, 15, 15, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    isolation: isolate;
}

.nav-brand {
    font-size: 18px;
    font-weight: 700;
    color: var(--accent-primary);
    text-decoration: none;
}

.nav-brand:hover {
    color: var(--accent-secondary);
}

.nav-user {
    font-size: 14px;
    color: var(--text-secondary);
}

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

/* Sidebar navigatie (admin) */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 260px;
    height: 100vh;
    background: rgba(15, 15, 15, 0.95);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border-right: 1px solid var(--glass-border);
    padding: 1.5rem 1rem;
    z-index: var(--z-sticky);
    transform: translateX(-100%);
    transition: var(--transition-slow);
    overflow-y: auto;
}

.sidebar--open {
    transform: translateX(0);
}

.sidebar__brand {
    font-size: 20px;
    font-weight: 700;
    color: var(--accent-primary);
    text-decoration: none;
    display: block;
    margin-bottom: 2rem;
    padding: 0 0.5rem;
}

.sidebar__nav {
    list-style: none;
}

.sidebar__item {
    margin-bottom: 0.25rem;
}

.sidebar__link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition-fast);
}

.sidebar__link:hover {
    background: var(--glass-bg);
    color: var(--text-primary);
}

.sidebar__link--active {
    background: var(--glass-bg);
    color: var(--accent-primary);
}

.sidebar__overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: calc(var(--z-sticky) - 1);
}

.sidebar--open + .sidebar__overlay {
    display: block;
}

@media (min-width: 1024px) {
    .sidebar {
        transform: translateX(0);
    }

    .sidebar__overlay {
        display: none !important;
    }

    .main-content--sidebar {
        margin-left: 260px;
    }
}

/* Bottom tab bar (mobile guest) */
.tab-bar {
    display: flex;
    justify-content: space-around;
    align-items: center;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(15, 15, 15, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--glass-border);
    padding: 0.5rem 0;
    z-index: var(--z-sticky);
}

.tab-bar__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 11px;
    font-weight: 500;
    transition: var(--transition-fast);
    -webkit-tap-highlight-color: transparent;
}

.tab-bar__item--active {
    color: var(--accent-primary);
}

.tab-bar__icon {
    font-size: 22px;
    line-height: 1;
}

/* --------------------------------------------------------------------------
 * 4. ALERTS / NOTIFICATIES
 * -------------------------------------------------------------------------- */
.alert {
    padding: 0.875rem 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    font-size: 14px;
    line-height: 1.5;
}

.alert-error {
    background: rgba(244, 67, 54, 0.15);
    border: 1px solid rgba(244, 67, 54, 0.3);
    color: var(--error);
}

.alert-success {
    background: rgba(76, 175, 80, 0.15);
    border: 1px solid rgba(76, 175, 80, 0.3);
    color: var(--success);
}

.alert-warning {
    background: rgba(255, 152, 0, 0.15);
    border: 1px solid rgba(255, 152, 0, 0.3);
    color: var(--warning);
}

.alert-info {
    background: rgba(33, 150, 243, 0.15);
    border: 1px solid rgba(33, 150, 243, 0.3);
    color: var(--info);
}

/* Toast (inline notificatie bovenin) */
.toast {
    position: fixed;
    top: 1rem;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    z-index: var(--z-toast);
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transition: transform 300ms ease-out;
    max-width: calc(100% - 2rem);
    width: max-content;
}

.toast--visible {
    transform: translateX(-50%) translateY(0);
}

.toast--success {
    background: rgba(76, 175, 80, 0.9);
    color: #fff;
}

.toast--error {
    background: rgba(244, 67, 54, 0.9);
    color: #fff;
}

/* --------------------------------------------------------------------------
 * 5. BADGES & TAGS
 * -------------------------------------------------------------------------- */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
}

.badge--gold {
    background: rgba(255, 193, 7, 0.2);
    color: var(--accent-primary);
    border: 1px solid rgba(255, 193, 7, 0.3);
}

.badge--green {
    background: rgba(76, 175, 80, 0.15);
    color: #4CAF50;
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.badge--success {
    background: rgba(76, 175, 80, 0.2);
    color: var(--success);
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.badge--error {
    background: rgba(244, 67, 54, 0.2);
    color: var(--error);
    border: 1px solid rgba(244, 67, 54, 0.3);
}

.badge--muted {
    background: var(--glass-bg);
    color: var(--text-secondary);
    border: 1px solid var(--glass-border);
}

.badge--lg {
    padding: 0.375rem 0.875rem;
    font-size: 14px;
}

/* Leeftijdsbadge (POS) */
.badge-age {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.badge-age--adult {
    background: rgba(76, 175, 80, 0.2);
    color: var(--success);
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.badge-age--minor {
    background: rgba(244, 67, 54, 0.2);
    color: var(--error);
    border: 1px solid rgba(244, 67, 54, 0.3);
}

/* --------------------------------------------------------------------------
 * 6. TABELLEN
 * -------------------------------------------------------------------------- */
.table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--glass-border);
}

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

.data-table th,
.table th {
    text-align: center;
    width: 16.66%;
    padding: 0.75rem 0.5rem;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.02);
}

.data-table td,
.table td {
    text-align: center;
    width: 16.66%;
    padding: 0.75rem 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
}

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

.data-table tr:hover td,
.table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

/* --------------------------------------------------------------------------
 * 7. LIJSTEN
 * -------------------------------------------------------------------------- */
.list {
    list-style: none;
}

.list__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: var(--transition-fast);
}

.list__item:last-child {
    border-bottom: none;
}

.list__item:hover {
    background: rgba(255, 255, 255, 0.02);
}

.list__item-content {
    flex: 1;
    min-width: 0;
}

.list__item-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.list__item-subtitle {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 0.125rem;
}

.list__item-action {
    flex-shrink: 0;
    margin-left: 0.75rem;
}

/* --------------------------------------------------------------------------
 * 8. MODALS / DIALOGEN
 * -------------------------------------------------------------------------- */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: var(--z-modal);
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-overlay--open {
    display: flex;
}

.modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--bg-lightest);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 420px;
    max-height: 90vh;
    overflow-y: auto;
    animation: fadeInUp 200ms ease-out;
    z-index: var(--z-modal);
}

.modal.show {
    display: block;
}

.modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--glass-border);
}

.modal__title {
    font-size: 18px;
    font-weight: 600;
}

.modal__body {
    padding: 1.5rem;
}

.modal__footer {
    display: flex;
    gap: 0.75rem;
    padding: 1.25rem 1.5rem;
    border-top: 1px solid var(--glass-border);
}

/* --------------------------------------------------------------------------
 * 9. AVATAR
 * -------------------------------------------------------------------------- */
.avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--glass-bg);
    border: 2px solid var(--glass-border);
    flex-shrink: 0;
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar--sm {
    width: 32px;
    height: 32px;
}

.avatar--lg {
    width: 64px;
    height: 64px;
}

.avatar--xl {
    width: 96px;
    height: 96px;
    border-width: 3px;
}

.avatar--validated {
    border-color: var(--success);
}

.avatar--blocked {
    border-color: var(--error);
}

.avatar__placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-gradient);
    color: #000;
    font-weight: 700;
    font-size: 18px;
}

/* --------------------------------------------------------------------------
 * 10. SEPARATOR / DIVIDER
 * -------------------------------------------------------------------------- */
.divider {
    border: none;
    border-top: 1px solid var(--glass-border);
    margin: 1.5rem 0;
}

.divider--text {
    display: flex;
    align-items: center;
    gap: 1rem;
    border: none;
    margin: 1.5rem 0;
    color: var(--text-muted);
    font-size: 12px;
}

.divider--text::before,
.divider--text::after {
    content: '';
    flex: 1;
    border-top: 1px solid var(--glass-border);
}

/* --------------------------------------------------------------------------
 * 11. SKELETON LOADING
 * -------------------------------------------------------------------------- */
.skeleton {
    background: linear-gradient(90deg, var(--glass-bg) 25%, rgba(255, 255, 255, 0.1) 50%, var(--glass-bg) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-md);
}

.skeleton--text {
    height: 16px;
    margin-bottom: 0.5rem;
}

.skeleton--title {
    height: 24px;
    width: 60%;
    margin-bottom: 0.75rem;
}

.skeleton--circle {
    border-radius: 50%;
}

.skeleton--card {
    height: 120px;
}

/* --------------------------------------------------------------------------
 * 12. EMPTY STATE
 * -------------------------------------------------------------------------- */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
}

.empty-state__icon {
    font-size: 48px;
    margin-bottom: 1rem;
    opacity: 0.3;
}

.empty-state__title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.empty-state__text {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

/* --------------------------------------------------------------------------
 * 13. STATISTIEK KAARTEN
 * -------------------------------------------------------------------------- */
.stat-card {
    text-align: center;
    padding: 1.25rem;
}

.stat-card__value {
    font-size: 28px;
    font-weight: 700;
    color: var(--accent-primary);
    line-height: 1.2;
}

.stat-card__label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.25rem;
}

/* Grid voor meerdere stat cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

@media (min-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}
