/* ==========================================================================
   Fotballplan Frontend
   Clean, modern design for parents and players
   ========================================================================== */

.fotballplan-frontend {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    color: #1a1a2e;
    line-height: 1.5;
}

.fotballplan-frontend *, .fotballplan-frontend *::before, .fotballplan-frontend *::after {
    box-sizing: border-box;
}

/* Header */
.fp-front-header {
    text-align: center;
    margin-bottom: 28px;
}

.fp-front-title {
    font-size: 28px;
    font-weight: 800;
    margin: 0 0 4px;
    color: #1a1a2e;
}

.fp-front-subtitle {
    font-size: 15px;
    color: #6b7280;
    margin: 0;
}

/* Filters */
.fp-front-filters {
    margin-bottom: 24px;
}

.fp-front-filter-row {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}

.fp-front-field {
    flex: 1;
}

.fp-front-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 4px;
}

.fp-front-field select {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 15px;
    background: #fff;
    color: #1a1a2e;
    transition: border-color 0.2s;
    -webkit-appearance: none;
    appearance: none;
    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='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

.fp-front-field select:focus {
    outline: none;
    border-color: #2e7d32;
    box-shadow: 0 0 0 3px rgba(46,125,50,0.1);
}

/* Week nav */
.fp-front-week-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    position: relative;
}

.fp-front-week-label {
    font-size: 15px;
    font-weight: 700;
    color: #1a1a2e;
    min-width: 200px;
    text-align: center;
}

.fp-front-week-label-clickable {
    cursor: pointer;
    padding: 6px 14px;
    border-radius: 8px;
    transition: background 0.15s, color 0.15s;
    position: relative;
}

.fp-front-week-label-clickable:hover {
    background: #e8f1fb;
    color: #0053a1;
}

.fp-front-week-label-clickable::after {
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-left: 4px;
    vertical-align: middle;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat center/contain;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat center/contain;
    opacity: 0.4;
}

.fp-week-picker-hidden {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.fp-front-btn {
    padding: 8px 18px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
}

.fp-front-btn-outline {
    background: #fff;
    color: #2e7d32;
    border-color: #2e7d32;
}

.fp-front-btn-outline:hover {
    background: #2e7d32;
    color: #fff;
}

/* Results */
.fp-front-results {
    min-height: 200px;
}

.fp-front-loading {
    text-align: center;
    padding: 60px 20px;
    color: #6b7280;
}

.fp-front-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #e5e7eb;
    border-top: 3px solid #2e7d32;
    border-radius: 50%;
    animation: fp-spin 0.8s linear infinite;
    margin: 0 auto 12px;
}

@keyframes fp-spin {
    to { transform: rotate(360deg); }
}

.fp-front-empty {
    text-align: center;
    padding: 60px 20px;
    color: #6b7280;
    font-size: 15px;
}

.fp-front-empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

/* Day group */
.fp-front-day {
    margin-bottom: 24px;
}

.fp-front-day-header {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #2e7d32;
    padding-bottom: 8px;
    border-bottom: 2px solid #2e7d32;
    margin-bottom: 10px;
}

/* Session card */
.fp-front-card {
    display: flex;
    align-items: stretch;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    margin-bottom: 10px;
    overflow: hidden;
    transition: box-shadow 0.2s, border-color 0.2s;
}

.fp-front-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    border-color: #d1d5db;
}

.fp-front-card-time {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 14px 18px;
    background: #f0fdf4;
    min-width: 80px;
    border-right: 2px solid #e5e7eb;
}

.fp-front-card-time .time-start {
    font-size: 18px;
    font-weight: 800;
    color: #1a1a2e;
    line-height: 1.2;
}

.fp-front-card-time .time-end {
    font-size: 13px;
    color: #6b7280;
}

.fp-front-card-time .time-sep {
    font-size: 11px;
    color: #9ca3af;
}

.fp-front-card-body {
    flex: 1;
    padding: 14px 18px;
    min-width: 0;
}

.fp-front-card-team {
    font-size: 16px;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 4px;
}

.fp-front-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 13px;
    color: #6b7280;
}

.fp-front-card-meta span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.fp-front-card-zone {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px 18px;
}

.fp-front-zone-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: #2e7d32;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
}

.fp-front-zone-btn:hover {
    background: #1b5e20;
}

.fp-front-card-notes {
    font-size: 12px;
    color: #9ca3af;
    margin-top: 4px;
    font-style: italic;
}

/* Modal */
.fp-front-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(4px);
}

.fp-front-modal-content {
    background: #fff;
    border-radius: 16px;
    padding: 28px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

.fp-front-modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #6b7280;
    line-height: 1;
    padding: 4px;
}

.fp-front-modal-close:hover {
    color: #1a1a2e;
}

.fp-front-modal-content h3 {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 16px;
    color: #1a1a2e;
    padding-right: 30px;
}

/* Modal zone map (SVG pitch) */
.fp-front-modal-map {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.15);
}

.fp-front-modal-map svg {
    display: block;
    width: 100%;
    height: auto;
}

/* Responsive */
@media (max-width: 640px) {
    .fp-front-filter-row {
        flex-direction: column;
        gap: 10px;
    }

    .fp-front-card {
        flex-direction: column;
    }

    .fp-front-card-time {
        flex-direction: row;
        gap: 6px;
        border-right: none;
        border-bottom: 2px solid #e5e7eb;
        padding: 10px 18px;
    }

    .fp-front-card-zone {
        padding: 10px 18px;
        justify-content: flex-start;
    }

    .fp-front-week-nav {
        flex-wrap: wrap;
    }

    .fp-front-week-label {
        min-width: auto;
        width: 100%;
        order: -1;
    }

    .fp-front-title {
        font-size: 22px;
    }
}

/* Week Picker Calendar */
.fp-weekpicker {
    position: absolute;
    z-index: 999999;
    background: #fff;
    border: 1px solid #d0d5dd;
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(0,0,0,0.12);
    padding: 14px;
    width: 310px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    user-select: none;
}

.fp-wp-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.fp-wp-title {
    font-weight: 700;
    font-size: 15px;
    color: #1a1a2e;
}

.fp-wp-nav {
    background: none;
    border: 1px solid #d0d5dd;
    border-radius: 6px;
    cursor: pointer;
    padding: 6px 8px;
    color: #1a1a2e;
    transition: all 0.15s;
    line-height: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.fp-wp-nav:hover {
    background: #e8f1fb;
    color: #0053a1;
    border-color: #0070d7;
}

.fp-wp-nav svg {
    display: block;
}

.fp-wp-grid {
    display: grid;
    grid-template-columns: 36px repeat(7, 1fr);
    gap: 0;
}

.fp-wp-head { margin-bottom: 2px; }

.fp-wp-dh {
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    padding: 4px 0;
}

.fp-wp-wn {
    font-size: 10px;
    color: #94a3b8;
    font-weight: 600;
    text-align: center;
    padding: 4px 0;
}

.fp-wp-row {
    display: grid;
    grid-template-columns: 36px repeat(7, 1fr);
    gap: 0;
    cursor: pointer;
    border-radius: 6px;
    transition: background 0.1s;
    padding: 1px 0;
}

.fp-wp-row:hover { background: #e8f1fb; }
.fp-wp-row:hover .fp-wp-day { color: #1a1a2e; }
.fp-wp-row:hover .fp-wp-other { color: #64748b; }
.fp-wp-row:hover .fp-wp-wn { color: #0070d7; }

.fp-wp-row.fp-wp-active { background: #0053a1; }
.fp-wp-row.fp-wp-active .fp-wp-day,
.fp-wp-row.fp-wp-active .fp-wp-wn { color: #fff; }
.fp-wp-row.fp-wp-active .fp-wp-other { color: rgba(255,255,255,0.5); }
.fp-wp-row.fp-wp-active:hover { background: #003d7a; }

.fp-wp-day {
    text-align: center;
    font-size: 13px;
    padding: 6px 0;
    color: #1a1a2e;
    border-radius: 4px;
}

.fp-wp-other { color: #94a3b8; }

.fp-wp-today { font-weight: 700; position: relative; }
.fp-wp-today::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #0070d7;
}
.fp-wp-row.fp-wp-active .fp-wp-today::after { background: #fff; }

.fp-wp-footer {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #f3f4f6;
    text-align: center;
}

.fp-wp-today-btn {
    background: none;
    border: 1px solid #d0d5dd;
    border-radius: 6px;
    cursor: pointer;
    padding: 6px 18px;
    font-size: 13px;
    color: #0053a1;
    font-weight: 600;
    transition: all 0.15s;
}

.fp-wp-today-btn:hover {
    background: #e8f1fb;
    border-color: #0070d7;
}
