/* ========================================
   SEASON WIZARD (FASE E.7)
   ======================================== */

.wizard-step-indicator {
    font-size: 0.85em;
    color: var(--text-secondary);
    margin-top: 4px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.wizard-field {
    margin-bottom: 12px;
}

.wizard-field label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    font-size: 0.9em;
    color: var(--text-primary);
}

.wizard-select,
.wizard-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.95em;
    box-sizing: border-box;
}

.wizard-select:focus,
.wizard-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(var(--accent-primary-rgb, 46, 125, 50), 0.15);
}

.wizard-portal-badge {
    display: inline-block;
    padding: 6px 16px;
    background: var(--portal-primary, var(--accent-primary));
    color: var(--text-inverse, white);
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9em;
}

.wizard-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.wizard-stat-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 14px;
    text-align: center;
}

.wizard-stat-card.wizard-stat-success {
    border-color: var(--color-success-dark);
    background: var(--color-success-light);
}

.wizard-stat-value {
    font-size: 1.4em;
    font-weight: 700;
    color: var(--text-primary);
}

.wizard-stat-label {
    font-size: 0.8em;
    color: var(--text-secondary);
    margin-top: 2px;
}

.wizard-stat-detail {
    font-size: 0.75em;
    color: var(--text-secondary);
    margin-top: 4px;
}

.wizard-warning {
    background: var(--status-warning-bg);
    border: 1px solid var(--status-warning-border);
    border-radius: 8px;
    padding: 12px 14px;
    margin-top: 12px;
    font-size: 0.9em;
    color: var(--status-warning-text);
}

.wizard-warning.wizard-warning-minor {
    background: var(--status-secondary-bg);
    border-color: var(--status-secondary-border);
    color: var(--status-secondary-text);
}

.wizard-error {
    background: var(--status-error-bg);
    border: 1px solid var(--status-error-border);
    border-radius: 8px;
    padding: 12px 14px;
    color: var(--status-error-text);
    font-size: 0.9em;
}

.wizard-detail-list {
    margin: 8px 0 0 0;
    padding-left: 20px;
    font-size: 0.9em;
}

.wizard-detail-list li {
    margin-bottom: 3px;
}

.wizard-confirm-section {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.wizard-confirm-warning {
    font-size: 1em;
    padding: 14px;
    background: var(--status-warning-bg);
    border: 1px solid var(--status-warning-border);
    border-radius: 8px;
    color: var(--status-warning-text);
    text-align: center;
}

.wizard-info-box {
    padding: 12px 14px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.9em;
    color: var(--text-primary);
}

.wizard-confirm-box {
    padding: 14px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.wizard-confirm-box label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9em;
    color: var(--text-primary);
}

/* Wizard buttons */
.btn-wizard {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9em;
    transition: opacity 0.2s ease;
}

.btn-wizard:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-wizard-primary {
    background: var(--accent-primary);
    color: white;
}

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

.btn-wizard-danger {
    background: var(--color-danger);
    color: white;
}

/* ========================================
   CLOSED SEASON BADGE & ROW PROTECTION
   ======================================== */

.season-closed-badge {
    display: inline-block;
    font-size: 0.7em;
    padding: 1px 6px;
    margin-left: 6px;
    background: var(--color-danger);
    color: white;
    border-radius: 8px;
    font-weight: 600;
    vertical-align: middle;
}

/* SEASON-011-CLEANUP S317: .badge-cross-season rimosso (cross-season = normale) */

/* Locked row styling for closed seasons */
tr.season-locked {
    background: repeating-linear-gradient(
        -45deg,
        transparent,
        transparent 8px,
        rgba(0, 0, 0, 0.015) 8px,
        rgba(0, 0, 0, 0.015) 16px
    ) !important;
    position: relative;
}

tr.season-locked > td {
    color: var(--text-secondary);
}

tr.season-locked > td:first-child {
    border-left: 3px solid var(--season-accent);
}

tr.season-locked td.editable {
    cursor: default;
}

tr.season-locked .btn-row-delete,
tr.season-locked [data-action="delete-pos-row"] {
    opacity: 0.15;
    pointer-events: none;
}

tr.season-locked .row-checkbox {
    pointer-events: none;
    opacity: 0.25;
}

tr.season-locked:hover {
    background: rgba(0, 0, 0, 0.03) !important;
}

tr.season-locked .stagione-cell {
    position: relative;
    padding-right: 24px;
}

tr.season-locked .stagione-cell::after {
    content: "\1F512";
    font-size: 0.75em;
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.6;
}

/* ========================================
   FASE F.7 - Welcome Banner Nuova Stagione
   ======================================== */

.welcome-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    margin: 0 15px 0 15px;
    background: linear-gradient(135deg, rgba(46, 125, 50, 0.08), rgba(21, 101, 192, 0.08));
    border: 1px solid rgba(46, 125, 50, 0.25);
    border-radius: 10px;
    animation: welcomeSlideIn 0.4s ease-out;
}

.welcome-banner-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.welcome-banner-icon {
    font-size: 1.3em;
    color: var(--accent-primary);
}

.welcome-banner-text {
    font-size: 0.95em;
    color: var(--text-primary);
    line-height: 1.4;
}

.welcome-banner-dismiss {
    background: none;
    border: none;
    font-size: 1.3em;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    line-height: 1;
    transition: color 0.2s ease, background 0.2s ease;
}

.welcome-banner-dismiss:hover {
    color: var(--text-primary);
    background: rgba(0, 0, 0, 0.05);
}

@keyframes welcomeSlideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.welcome-banner-hiding {
    animation: welcomeSlideOut 0.3s ease-in forwards;
}

@keyframes welcomeSlideOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}

/* ========================================
   FASE F.8 - Wizard Step 3 Celebration
   ======================================== */

.wizard-celebration {
    text-align: center;
    margin-bottom: 20px;
}

.wizard-celebration-checkmark {
    width: 64px;
    height: 64px;
    margin: 0 auto 12px;
}

.wizard-checkmark-svg {
    width: 64px;
    height: 64px;
}

.wizard-checkmark-circle {
    stroke: var(--accent-primary);
    stroke-width: 2.5;
    stroke-dasharray: 150;
    stroke-dashoffset: 150;
    animation: wizardCircleDraw 0.5s ease-out 0.1s forwards;
}

.wizard-checkmark-path {
    stroke: var(--accent-primary);
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 50;
    stroke-dashoffset: 50;
    animation: wizardCheckDraw 0.35s ease-out 0.5s forwards;
}

.wizard-celebration-title {
    color: var(--accent-primary);
    margin: 0;
    opacity: 0;
    animation: wizardFadeInUp 0.4s ease-out 0.7s forwards;
}

.wizard-celebration-card {
    opacity: 0;
    animation: wizardFadeInUp 0.35s ease-out forwards;
}

@keyframes wizardCircleDraw {
    to {
        stroke-dashoffset: 0;
    }
}

@keyframes wizardCheckDraw {
    to {
        stroke-dashoffset: 0;
    }
}

@keyframes wizardFadeInUp {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* F.8 Fix F3: classe per nota informativa step 3 (invece di inline styles) */
.wizard-celebration-note {
    margin-top: 15px;
    padding: 12px;
    background: var(--bg-tertiary, #f5f5f5);
    border-radius: 8px;
    font-size: 0.9em;
    color: var(--text-secondary);
}

/* F.8 Fix F1: prefers-reduced-motion - contenuto visibile senza animazioni */
@media (prefers-reduced-motion: reduce) {
    .wizard-checkmark-circle,
    .wizard-checkmark-path {
        animation: none;
        stroke-dashoffset: 0;
    }
    .wizard-celebration-title,
    .wizard-celebration-card {
        animation: none;
        opacity: 1;
        transform: none;
    }
    .storico-chevron {
        transition: none;
    }
    .undo-toast,
    .undo-toast.hiding {
        animation: none;
    }
    .annullamenti-chevron {
        transition: none;
    }
    .annullamenti-content {
        transition: none;
    }
}

/* ========================================
   FASE E.8 - Faldone Storico Stagioni
   ======================================== */

.storico-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.storico-stat-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 18px;
    text-align: center;
    border-top: 3px solid var(--border-color);
}

.storico-stat-card[data-type="caparre"] {
    border-top-color: var(--accent-primary);
}

.storico-stat-card[data-type="gir"] {
    border-top-color: var(--season-accent);
}

.storico-stat-card[data-type="pos"] {
    border-top-color: var(--storico-pos-accent);
}

.storico-stat-card[data-type="pareggi"] {
    border-top-color: var(--storico-pareggi-accent);
}

.storico-stat-card .stat-label {
    font-size: 0.85em;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
}

.storico-stat-card .stat-value {
    font-size: 1.6em;
    font-weight: 700;
    color: var(--text-primary);
}

.storico-stat-card .stat-detail {
    font-size: 0.8em;
    color: var(--text-secondary);
    margin-top: 4px;
}

.storico-section {
    margin-bottom: 25px;
}

.storico-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 18px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s;
}

.storico-section-header:hover {
    background: var(--hover-bg);
}

.storico-section-header h3 {
    margin: 0;
    font-size: 1.05em;
    color: var(--text-primary);
}

.storico-section-header .storico-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.storico-section-header .storico-chevron {
    display: inline-block;
    transition: transform 0.25s ease;
    font-size: 0.8em;
    color: var(--text-secondary);
}

.storico-section-header.expanded .storico-chevron {
    transform: rotate(90deg);
}

.storico-section-header .count-badge {
    background: var(--accent-primary);
    color: white;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: 600;
}

.storico-section-body {
    border: 1px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 8px 8px;
    overflow: hidden;
}

.storico-table {
    width: 100%;
    border-collapse: collapse;
}

.storico-table th {
    background: var(--bg-secondary);
    padding: 10px 15px;
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-color);
}

.storico-table td {
    padding: 10px 15px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

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

.storico-table tr:hover {
    background: var(--hover-bg);
}

/* S49 Step 2: Contenitore scrollabile per carry-forward con molte caparre */
.storico-cf-scroll {
    max-height: 400px;
    overflow-y: auto;
}

/* Sticky header nella tabella carry-forward scrollabile */
.storico-cf-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--bg-secondary);
}

.storico-cf-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.storico-cf-table th {
    text-align: left;
    padding: 6px 12px;
    font-size: 0.8em;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: var(--storico-cf-header);
    border-bottom: 1px solid rgba(255, 152, 0, 0.3);
}

.storico-cf-table td {
    padding: 6px 12px;
    font-size: 0.88em;
    color: var(--text-primary);
    border-bottom: 1px solid rgba(255, 152, 0, 0.15);
}

.storico-cf-table tr:last-child td {
    border-bottom: none;
}

.storico-meta {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    padding: 12px 18px;
    background: var(--bg-secondary);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    font-size: 0.9em;
    color: var(--text-secondary);
}

.storico-meta span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.storico-meta .meta-icon {
    font-size: 1.1em;
    opacity: 0.7;
}

.storico-meta strong {
    color: var(--text-primary);
}

/* SEASON-005: Badge caparre migrate */
.badge-migrata {
    display: inline-block;
    font-size: 0.75em;
    padding: 1px 6px;
    margin-left: 6px;
    border-radius: 3px;
    background: var(--status-secondary);
    color: var(--text-primary);
    vertical-align: middle;
    white-space: nowrap;
}
