/* ABF Admin Console Styles */

:root {
    --primary: #1a365d;
    --primary-light: #2c5282;
    --primary-dark: #0f2942;
    --accent: #ed8936;
    --accent-hover: #dd6b20;
    --success: #38a169;
    --warning: #d69e2e;
    --error: #e53e3e;
    --background: #f7fafc;
    --surface: #ffffff;
    --text: #2d3748;
    --text-secondary: #718096;
    --border: #e2e8f0;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background-color: var(--background);
    color: var(--text);
    line-height: 1.6;
}

.hidden {
    display: none !important;
}

/* Login Screen */
.screen {
    min-height: 100vh;
}

#login-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
}

.login-container {
    background: var(--surface);
    padding: 48px;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 400px;
}

.logo {
    text-align: center;
    margin-bottom: 32px;
}

.logo h1 {
    font-size: 48px;
    color: var(--primary);
    font-weight: 700;
    letter-spacing: 4px;
}

.logo p {
    color: var(--text-secondary);
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-top: 8px;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 8px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    font-size: 16px;
    border: 2px solid var(--border);
    border-radius: 8px;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: var(--surface);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26, 54, 93, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.error-message {
    color: var(--error);
    font-size: 14px;
    margin-top: 12px;
    text-align: center;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    width: 100%;
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-light);
}

.btn-secondary {
    background: var(--border);
    color: var(--text);
}

.btn-secondary:hover {
    background: #cbd5e0;
}

/* Dashboard Header */
header {
    background: var(--primary);
    color: white;
    padding: 16px 24px;
    box-shadow: var(--shadow);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

header h1 {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 2px;
}

.header-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.header-actions select {
    padding: 8px 12px;
    border-radius: 6px;
    border: none;
    font-size: 14px;
    background: white;
    min-width: 200px;
}

/* Main Content */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
    display: grid;
    gap: 24px;
}

/* Cards */
.card {
    background: var(--surface);
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--shadow);
}

.card h2 {
    font-size: 18px;
    color: var(--primary);
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border);
}

/* Status Display */
.status-display {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--background);
    border-radius: 8px;
}

.status-badge {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    background: var(--border);
    color: var(--text-secondary);
}

.status-badge.checkin { background: #c6f6d5; color: #22543d; }
.status-badge.plenair { background: #bee3f8; color: #2a4365; }
.status-badge.break { background: #feebc8; color: #744210; }
.status-badge.end { background: #e2e8f0; color: #4a5568; }

.status-message {
    color: var(--text-secondary);
    font-size: 14px;
}

/* Runtime Buttons */
.runtime-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.btn-runtime {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    background: var(--background);
    border: 2px solid var(--border);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-runtime:hover {
    border-color: var(--primary);
    background: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn-runtime.active {
    border-color: var(--primary);
    background: var(--primary);
    color: white;
}

.btn-icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.btn-label {
    font-size: 14px;
    font-weight: 600;
}

.custom-message {
    margin-top: 16px;
}

.custom-message label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    display: block;
}

.custom-message input {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
}

/* Preset Buttons */
.preset-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
}

.btn-preset {
    padding: 16px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-preset:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

/* Activity Log */
#activity-log {
    max-height: 300px;
    overflow-y: auto;
}

.activity-item {
    padding: 12px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-type {
    font-weight: 600;
    color: var(--primary);
}

.activity-message {
    color: var(--text-secondary);
    font-size: 14px;
}

.activity-time {
    color: var(--text-secondary);
    font-size: 12px;
}

.empty-state {
    color: var(--text-secondary);
    text-align: center;
    padding: 24px;
    font-style: italic;
}

/* Footer */
footer {
    text-align: center;
    padding: 24px;
    color: var(--text-secondary);
    font-size: 14px;
}

/* Toast Notifications */
#toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast {
    padding: 16px 24px;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.3s ease;
    max-width: 400px;
}

.toast.success { background: var(--success); }
.toast.error { background: var(--error); }
.toast.warning { background: var(--warning); }
.toast.info { background: var(--primary); }

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Loading Overlay */
#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Tabs */
.tab-bar {
    display: flex;
    gap: 8px;
    border-bottom: 2px solid var(--border);
}

.tab-btn {
    padding: 12px 24px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.tab-btn:hover {
    color: var(--primary);
}

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.tab-content {
    display: grid;
    gap: 24px;
}

/* Card header with action */
.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border);
}

.card-header h2 {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.btn-add {
    width: auto;
    padding: 8px 16px;
    font-size: 14px;
}

/* Item lists */
.item-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 16px;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.list-item-main {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.list-item-title {
    font-weight: 600;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
}

.list-item-meta {
    font-size: 13px;
    color: var(--text-secondary);
}

.list-item-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--border);
    color: var(--text-secondary);
}

.tag.vip { background: #fefcbf; color: #744210; }
.tag.group { background: #bee3f8; color: #2a4365; }

/* Participants tab */
.card-header-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.search-input {
    width: 100%;
    padding: 10px 14px;
    margin-bottom: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    box-sizing: border-box;
}

.list-count {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.import-help summary {
    cursor: pointer;
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 600;
}

.import-help code {
    background: var(--border);
    padding: 1px 5px;
    border-radius: 4px;
    font-size: 12px;
}

/* Colour swatch shown before a group's name in the groepen list. */
.group-swatch {
    display: inline-block;
    width: 16px;
    height: 16px;
    border-radius: 4px;
    border: 1px solid var(--border, #e2e8f0);
    flex-shrink: 0;
}

/* Partner/sponsor list rows show the logo thumbnail next to the name. */
.list-item-main.sponsor-row {
    flex-direction: row;
    align-items: center;
    gap: 12px;
}

.sponsor-thumb {
    width: 56px;
    height: 40px;
    object-fit: contain;
    border-radius: 6px;
    background: #fff;
    padding: 4px;
    border: 1px solid var(--border, #e2e8f0);
    flex-shrink: 0;
}

.sponsor-thumb-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary, #718096);
    font-size: 18px;
}

.btn-icon-sm {
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: white;
    cursor: pointer;
    transition: all 0.15s;
}

.btn-edit { color: var(--primary); }
.btn-edit:hover { background: var(--primary); color: white; border-color: var(--primary); }

.btn-delete { color: var(--error); border-color: #fed7d7; }
.btn-delete:hover { background: var(--error); color: white; border-color: var(--error); }

/* Modal */
#modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    z-index: 1500;
    overflow-y: auto;
    padding: 40px 16px;
}

.modal {
    background: var(--surface);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 660px;
    margin: auto;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 2px solid var(--border);
}

.modal-header h2 {
    font-size: 20px;
    color: var(--primary);
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    line-height: 1;
    color: var(--text-secondary);
    cursor: pointer;
}

.modal-close:hover { color: var(--text); }

#modal-form { padding: 24px; }

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px 20px;
}

.form-grid .full { grid-column: 1 / -1; }

.form-grid .form-group { margin-bottom: 0; }

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.checkbox-row input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.checkbox-row label {
    margin-bottom: 0;
    cursor: pointer;
}

.field-hint {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* Spreker-foto: preview naast URL/upload-velden */
.photo-field {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

/* Header-afbeelding: preview boven de velden i.p.v. ernaast */
.photo-field-vertical {
    flex-direction: column;
}

.photo-preview-rect {
    width: 100%;
    max-width: 320px;
    height: 140px;
    border-radius: 8px;
    object-fit: cover;
    background: var(--surface-variant, #eee);
    border: 1px solid var(--border);
}

.photo-field-controls {
    flex: 1;
    min-width: 0;
}

.photo-preview {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--surface-variant, #eee);
    border: 1px solid var(--border);
    flex-shrink: 0;
}

.photo-upload-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
}

.photo-upload-row input[type="file"] {
    font-size: 13px;
}

.photo-remove {
    background: none;
    border: none;
    color: var(--danger, #c0392b);
    font-size: 12px;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
    white-space: nowrap;
}

.photo-remove:hover {
    opacity: 0.8;
}

.form-section-label {
    grid-column: 1 / -1;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    margin-top: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 2px solid var(--border);
}

.modal-actions .btn { width: auto; }

/* Responsive */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 16px;
    }

    .header-actions {
        width: 100%;
        flex-direction: column;
    }

    .header-actions select {
        width: 100%;
    }

    main {
        padding: 16px;
    }

    .runtime-buttons,
    .preset-buttons {
        grid-template-columns: repeat(2, 1fr);
    }

    .login-container {
        margin: 16px;
        padding: 32px 24px;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .list-item {
        flex-direction: column;
        align-items: flex-start;
    }
}
