/* ===================================
   LINDAUER SPORTPARK V2 - Training
   =================================== */

/* ==============================
   Page Header
   ============================== */
.page-header {
    padding: 140px 0 60px;
    text-align: center;
}

.page-title {
    font-family: 'Inter', sans-serif;
    font-size: clamp(36px, 5vw, 56px);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.03em;
    margin-top: 16px;
}

.page-subtitle {
    font-size: 17px;
    color: var(--text-secondary);
    margin-top: 12px;
}

/* ==============================
   Plan Section
   ============================== */
.plan-section {
    padding: 0 0 100px;
}

.plan-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-radius: var(--radius-lg);
    margin-bottom: 32px;
}

.plan-name-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

.plan-name {
    font-size: 22px;
    font-weight: 700;
    outline: none;
    border-bottom: 2px solid transparent;
    padding-bottom: 2px;
    transition: border-color var(--transition-fast);
    cursor: text;
    min-width: 40px;
}

.plan-name:focus {
    border-bottom-color: var(--accent-light);
}

.plan-name-edit {
    width: 28px;
    height: 28px;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color var(--transition-fast);
}

.plan-name-edit:hover {
    color: var(--accent-light);
}

.plan-name-edit svg {
    width: 16px;
    height: 16px;
}

.plan-day-count {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* ==============================
   Days Grid
   ============================== */
.days-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.day-card {
    position: relative;
    padding: 24px 20px;
    border-radius: var(--radius-lg);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    cursor: pointer;
    transition: all var(--transition-medium);
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.day-card:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.day-card-name {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.day-card-count {
    font-size: 13px;
    color: var(--text-secondary);
}

.day-card-indicator {
    position: absolute;
    top: 0;
    left: 20px;
    right: 20px;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), var(--accent-light));
    border-radius: 0 0 3px 3px;
}

/* ==============================
   Empty State
   ============================== */
.days-empty {
    text-align: center;
    padding: 60px 20px;
}

.empty-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
    color: var(--text-secondary);
    opacity: 0.4;
}

.empty-icon svg {
    width: 100%;
    height: 100%;
}

.days-empty p {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.days-empty span {
    font-size: 14px;
    color: var(--text-secondary);
}

/* ==============================
   Add Day Button
   ============================== */
.btn-add-day {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 16px;
    border-radius: var(--radius-lg);
    background: none;
    border: 2px dashed var(--glass-border);
    color: var(--text-secondary);
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-add-day svg {
    width: 20px;
    height: 20px;
}

.btn-add-day:hover {
    border-color: var(--accent);
    color: var(--accent-light);
    background: rgba(22, 163, 74, 0.05);
}

/* ==============================
   Day Detail Overlay
   ============================== */
.day-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: var(--bg-dark);
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.day-overlay.open {
    transform: translateY(0);
}

.day-overlay-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 24px;
    min-height: 100vh;
}

.day-overlay-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 32px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--glass-border);
}

.day-overlay-back {
    display: flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.day-overlay-back svg {
    width: 18px;
    height: 18px;
}

.day-overlay-back:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.day-overlay-title {
    flex: 1;
    font-size: 24px;
    font-weight: 700;
    outline: none;
    border-bottom: 2px solid transparent;
    padding-bottom: 2px;
    transition: border-color var(--transition-fast);
    text-align: center;
}

.day-overlay-title:focus {
    border-bottom-color: var(--accent-light);
}

.day-overlay-delete {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    flex-shrink: 0;
    padding: 0;
}

.day-overlay-delete svg {
    width: 20px;
    height: 20px;
}

.day-overlay-delete:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

/* ==============================
   Exercise Card
   ============================== */
.exercise-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    margin-bottom: 16px;
    overflow: hidden;
}

.exercise-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--glass-border);
}

.exercise-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.exercise-nummer {
    font-size: 12px;
    font-weight: 700;
    color: var(--accent-light);
    padding: 3px 8px;
    background: rgba(22, 163, 74, 0.12);
    border-radius: 4px;
}

.exercise-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.exercise-marke {
    font-size: 12px;
    color: var(--text-secondary);
    margin-left: 8px;
}

.exercise-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.exercise-action-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    padding: 0;
}

.exercise-action-btn svg {
    width: 16px;
    height: 16px;
}

.exercise-action-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
}

.exercise-action-btn.delete:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

/* Sets Table */
.sets-table {
    padding: 12px 20px 16px;
}

.sets-header {
    display: grid;
    grid-template-columns: 48px 1fr 1fr 40px;
    gap: 8px;
    padding: 0 0 8px;
    margin-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.sets-header span {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
}

.set-row {
    display: grid;
    grid-template-columns: 48px 1fr 1fr 40px;
    gap: 8px;
    align-items: center;
    margin-bottom: 6px;
}

.set-number {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-secondary);
    text-align: center;
}

.set-input {
    width: 100%;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    text-align: center;
    outline: none;
    transition: all var(--transition-fast);
    -moz-appearance: textfield;
}

.set-input::-webkit-outer-spin-button,
.set-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.set-input:focus {
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.06);
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.1);
}

.set-delete {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.2);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    padding: 0;
}

.set-delete svg {
    width: 14px;
    height: 14px;
}

.set-delete:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.08);
}

.btn-add-set {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    padding: 6px 12px;
    background: none;
    border: 1px dashed rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-add-set svg {
    width: 14px;
    height: 14px;
}

.btn-add-set:hover {
    border-color: var(--accent);
    color: var(--accent-light);
}

/* ==============================
   Add Exercise Button
   ============================== */
.btn-add-exercise {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 16px;
    border-radius: var(--radius-lg);
    background: none;
    border: 2px dashed var(--glass-border);
    color: var(--text-secondary);
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition-fast);
    margin-top: 8px;
}

.btn-add-exercise svg {
    width: 20px;
    height: 20px;
}

.btn-add-exercise:hover {
    border-color: var(--accent);
    color: var(--accent-light);
    background: rgba(22, 163, 74, 0.05);
}

/* ==============================
   Exercise Picker Overlay
   ============================== */
.picker-overlay {
    position: fixed;
    inset: 0;
    z-index: 3000;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.picker-overlay.open {
    opacity: 1;
    pointer-events: all;
}

.picker-content {
    width: 100%;
    max-width: 600px;
    max-height: 80vh;
    background: var(--bg-mid);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    border: 1px solid var(--glass-border);
    border-bottom: none;
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.picker-overlay.open .picker-content {
    transform: translateY(0);
}

.picker-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 20px 0;
}

.picker-header h3 {
    font-size: 18px;
    font-weight: 700;
}

.picker-close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    padding: 0;
}

.picker-close svg {
    width: 20px;
    height: 20px;
}

.picker-close:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
}

.picker-tabs {
    display: flex;
    gap: 4px;
    padding: 16px 20px 0;
}

.picker-tab {
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    background: none;
    border: 1px solid transparent;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: inherit;
}

.picker-tab:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.picker-tab.active {
    color: var(--accent-light);
    background: rgba(22, 163, 74, 0.12);
    border-color: rgba(22, 163, 74, 0.3);
    font-weight: 600;
}

.picker-search {
    position: relative;
    padding: 12px 20px;
}

.picker-search svg {
    position: absolute;
    left: 32px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--text-secondary);
    pointer-events: none;
}

.picker-search input {
    width: 100%;
    padding: 10px 12px 10px 38px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: all var(--transition-fast);
}

.picker-search input::placeholder {
    color: var(--text-secondary);
}

.picker-search input:focus {
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.06);
}

.picker-grid {
    flex: 1;
    overflow-y: auto;
    padding: 0 20px 20px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.picker-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.picker-item:hover {
    background: rgba(22, 163, 74, 0.08);
    border-color: rgba(22, 163, 74, 0.2);
}

.picker-item-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.picker-item-nr {
    font-size: 11px;
    font-weight: 700;
    color: var(--accent-light);
    padding: 2px 7px;
    background: rgba(22, 163, 74, 0.12);
    border-radius: 4px;
}

.picker-item-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.picker-item-marke {
    font-size: 12px;
    color: var(--text-secondary);
    margin-left: 4px;
}

.picker-item-add {
    font-size: 12px;
    font-weight: 600;
    color: var(--accent-light);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.picker-item:hover .picker-item-add {
    opacity: 1;
}

.picker-empty {
    text-align: center;
    padding: 40px 20px;
}

.picker-empty p {
    color: var(--text-secondary);
    font-size: 14px;
}

/* ==============================
   Toast
   ============================== */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    padding: 12px 24px;
    border-radius: var(--radius-md);
    background: rgba(22, 163, 74, 0.95);
    color: white;
    font-size: 14px;
    font-weight: 500;
    z-index: 9999;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    pointer-events: none;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* ==============================
   Confirm Dialog
   ============================== */
.confirm-overlay {
    position: fixed;
    inset: 0;
    z-index: 5000;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.confirm-overlay.open {
    opacity: 1;
    pointer-events: all;
}

.confirm-box {
    background: var(--bg-mid);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 28px;
    max-width: 360px;
    width: calc(100% - 40px);
    text-align: center;
}

.confirm-box p {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
}

.confirm-box span {
    font-size: 14px;
    color: var(--text-secondary);
    display: block;
    margin-bottom: 24px;
}

.confirm-buttons {
    display: flex;
    gap: 10px;
}

.confirm-buttons button {
    flex: 1;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition-fast);
    border: none;
}

.confirm-cancel {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
    border: 1px solid var(--glass-border) !important;
}

.confirm-cancel:hover {
    background: rgba(255, 255, 255, 0.1);
}

.confirm-delete {
    background: #ef4444;
    color: white;
}

.confirm-delete:hover {
    background: #dc2626;
}

/* ==============================
   Responsive
   ============================== */
@media (max-width: 768px) {
    .page-header {
        padding: 120px 0 40px;
    }

    .plan-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        padding: 16px 20px;
    }

    .days-grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .day-overlay-content {
        padding: 16px;
    }

    .day-overlay-title {
        font-size: 20px;
    }

    .exercise-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        padding: 14px 16px;
    }

    .exercise-actions {
        align-self: flex-end;
    }

    .sets-table {
        padding: 10px 16px 14px;
    }

    .sets-header {
        grid-template-columns: 36px 1fr 1fr 32px;
    }

    .set-row {
        grid-template-columns: 36px 1fr 1fr 32px;
    }

    .picker-content {
        max-height: 85vh;
    }
}

@media (max-width: 480px) {
    .days-grid {
        grid-template-columns: 1fr;
    }

    .day-card {
        min-height: auto;
        padding: 20px 16px;
    }

    .plan-name {
        font-size: 18px;
    }

    .exercise-name {
        font-size: 14px;
    }

    .set-input {
        padding: 6px 6px;
        font-size: 13px;
    }
}

/* ===================================
   Plan Switcher (Multi-Plan)
   =================================== */

.plan-switcher-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
}

.plan-switcher-wrapper::-webkit-scrollbar {
    display: none;
}

.plan-switcher {
    display: flex;
    gap: 6px;
    flex: 1;
    overflow-x: auto;
    scrollbar-width: none;
    padding: 2px;
}

.plan-switcher::-webkit-scrollbar {
    display: none;
}

.plan-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 99px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
    position: relative;
    user-select: none;
}

.plan-chip:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

.plan-chip.active {
    background: rgba(34, 197, 94, 0.12);
    border-color: rgba(34, 197, 94, 0.3);
    color: #22c55e;
    font-weight: 600;
}

.plan-chip.active::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #22c55e;
    flex-shrink: 0;
}

.plan-chip-name {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.plan-chip-days {
    font-size: 11px;
    opacity: 0.6;
}

.plan-chip-delete {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: inherit;
    cursor: pointer;
    padding: 0;
    opacity: 0;
    transition: all 0.15s;
    flex-shrink: 0;
}

.plan-chip:hover .plan-chip-delete {
    opacity: 0.5;
}

.plan-chip-delete:hover {
    opacity: 1 !important;
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.plan-chip-delete svg {
    width: 12px;
    height: 12px;
}

.plan-switcher-add {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px dashed rgba(255, 255, 255, 0.15);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s;
}

.plan-switcher-add:hover {
    border-color: var(--accent);
    color: var(--accent-light);
    background: rgba(34, 197, 94, 0.05);
}

.plan-switcher-add svg {
    width: 16px;
    height: 16px;
}

/* Plan Rename Modal */
.plan-rename-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.plan-rename-box {
    padding: 28px;
    border-radius: var(--radius-lg);
    max-width: 400px;
    width: 90%;
}

.plan-rename-box h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 16px;
}

.plan-rename-box .plan-delete-text {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.plan-rename-input {
    width: 100%;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 14px;
    margin-bottom: 16px;
}

.plan-rename-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.15);
}

.plan-rename-btns {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

/* Responsive: plan switcher */
@media (max-width: 768px) {
    .plan-chip-name {
        max-width: 80px;
    }

    .plan-chip {
        padding: 6px 10px;
        font-size: 12px;
    }

    .plan-chip-delete {
        opacity: 0.4;
    }
}
