/*
 * Team-side setup UI building blocks, shared by the team creation wizard, the explore sport
 * picker, the welcome (onboarding) step, quick team setup and the player profile form.
 * Moved out of templates/teams/team_create_wizard.html so every setup page looks the same.
 * Load with {% static 'css/wizard-ui.css' %} in a page's extra_css block (after custom.css).
 */

:root {
    --grundee-green-light: #e9f5db;
    --wizard-secondary: #f8f9fa;
    --wizard-text: #2d3436;
    --wizard-muted: #636e72;
}

.wizard-container {
    max-width: 900px;
    margin: 2rem auto;
}

/* Selectable cards: sport (activity) cards and option cards */
.activity-card, .option-card {
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid transparent;
    height: 100%;
    border-radius: 12px;
    background: #fff;
}

.activity-card:hover, .option-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
    border-color: var(--grundee-green-light);
}

.activity-card.selected, .option-card.selected,
.card-choice .btn-check:checked + .activity-card,
.card-choice .btn-check:checked + .option-card {
    border-color: var(--grundee-green);
    background-color: var(--grundee-green-light);
}

/* Keyboard focus on the visually hidden radio/checkbox behind a card */
.card-choice .btn-check:focus-visible + .activity-card,
.card-choice .btn-check:focus-visible + .option-card {
    outline: 3px solid var(--grundee-green);
    outline-offset: 2px;
}

.activity-img-container {
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: #fcfcfc;
    border-radius: 10px 10px 0 0;
}

.activity-picker-compact .activity-img-container {
    height: 72px;
    padding: 0.5rem;
}

.activity-img {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
}

.icon-box {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    background: var(--wizard-secondary);
    color: var(--grundee-green-text);
    font-size: 1.5rem;
}

.selected .icon-box,
.card-choice .btn-check:checked + .option-card .icon-box {
    background: var(--grundee-green);
    color: var(--grundee-on-green);   /* dark on the bright green: white fails WCAG AA there */
}

/* Form styles */
.form-control:focus, .form-select:focus {
    border-color: var(--grundee-green);
    box-shadow: 0 0 0 0.25rem var(--grundee-green-light);
}

.search-group .form-control:focus {
    box-shadow: 0 0 0 0.25rem rgba(84, 163, 0, 0.15);
    background-color: #fff !important;
}

.help-text {
    font-size: 0.85rem;
    color: var(--wizard-muted);
}

.error-feedback {
    font-size: 0.85rem;
    color: #e74c3c;
    margin-top: 0.25rem;
    display: block;
}

/* Setting rows (icon + title + optional switch, with content underneath) */
.visual-row {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: all 0.2s ease;
}

.visual-row:hover {
    border-color: var(--grundee-green-light);
    box-shadow: 0 4px 12px rgba(0,0,0,0.03);
}

.visual-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--grundee-green-light);
    color: var(--grundee-green-text);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.visual-row .form-switch .form-check-input {
    width: 3.5rem;
    height: 1.75rem;
    cursor: pointer;
}

/* The team badge picker (teams/components/badge_upload.html) */
.badge-preview {
    width: 120px; height: 120px; border-radius: 50%; border: 2px dashed #ddd; display: flex; align-items: center;
    justify-content: center; overflow: hidden; margin: 0 auto; background: #fdfdfd; cursor: pointer;
    transition: all 0.3s ease;
}
.badge-preview:hover, .badge-preview:focus-visible { border-color: var(--grundee-green); background: var(--grundee-green-light); }
.badge-preview img { width: 100%; height: 100%; object-fit: cover; }

/* Where we usually play (components/place_picker.html): the wizard's step 2 and the team's settings page */
.team-place {
    padding: 1rem;
    border: 1px solid #e1e6dc;
    border-radius: 16px;
    background: #fafbf8;
}

.team-place__title {
    display: flex;
    align-items: center;
    gap: 8px;
    float: none;
    width: auto;
    margin-bottom: 0.25rem;
    font-size: 1rem;
    font-weight: 700;
}

.team-place__title .fa-location-dot {
    color: var(--grundee-green-text);
}

.team-place__optional {
    padding: 1px 8px;
    border-radius: 999px;
    background: #eceee8;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--wizard-muted);
}

.team-place__choices {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 0.75rem;
}

.team-place__choice {
    position: relative;
    cursor: pointer;
}

.team-place__choice input {
    position: absolute;
    opacity: 0;
}

.team-place__choice span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border: 1px solid #d8ded3;
    border-radius: 999px;
    background: #fff;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.15s ease;
}

.team-place__choice input:checked + span {
    border-color: var(--grundee-green);
    background: var(--grundee-green-light);
    color: var(--grundee-green-text);
}

.team-place__choice input:focus-visible + span {
    outline: 3px solid var(--grundee-green);
    outline-offset: 2px;
}

/* The team's own places (settings page): pick one as the main place */
.team-place__existing {
    display: grid;
    gap: 8px;
}

.team-place__option {
    position: relative;
    display: block;
    cursor: pointer;
}

.team-place__option input {
    position: absolute;
    opacity: 0;
}

.team-place__option-body {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border: 1px solid #d8ded3;
    border-radius: 14px;
    background: #fff;
    transition: all 0.15s ease;
}

.team-place__option-icon {
    color: #4d574f;
}

.team-place__option-text {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-width: 0;
}

.team-place__option-text small {
    color: var(--wizard-muted);
}

.team-place__main {
    flex: none;
    padding: 1px 8px;
    border-radius: 999px;
    background: var(--grundee-green-light);
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--grundee-green-text);
}

.team-place__option input:checked + .team-place__option-body {
    border-color: var(--grundee-green);
    background: var(--grundee-green-light);
    box-shadow: inset 0 0 0 1px var(--grundee-green);
}

.team-place__option input:focus-visible + .team-place__option-body {
    outline: 3px solid var(--grundee-green);
    outline-offset: 2px;
}
