/*
 * Running Wizard Styles
 * Combined styles for the Running Plan wizard
 * Includes: common styles + plan steps styles
 */

/* ============================================
   COMMON STYLES
   ============================================ */

/* === Container === */
.wizard-container {
    background: linear-gradient(180deg, #ffffff 0%, #fafbfc 100%);
    border: 1px solid rgba(37, 99, 235, 0.15);
    border-top: 3px solid #2563eb;
    border-radius: 12px;
    box-shadow:
        0 4px 6px -1px rgba(0, 0, 0, 0.1),
        0 10px 20px -5px rgba(37, 99, 235, 0.08),
        0 0 0 1px rgba(255, 255, 255, 0.8) inset;
    width: 100%;
    padding: 24px;
    margin-top: 6px;
    position: relative;
    overflow: hidden;
}

/* Subtle decorative accent */
.wizard-container::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100px;
    background: linear-gradient(180deg, rgba(37, 99, 235, 0.03) 0%, transparent 100%);
    pointer-events: none;
}

[data-bs-theme="dark"] .wizard-container {
    background: linear-gradient(180deg, var(--bs-secondary-bg) 0%, var(--bs-body-bg) 100%);
    border-color: rgba(96, 165, 250, 0.2);
    border-top-color: #60a5fa;
    box-shadow:
        0 4px 6px -1px rgba(0, 0, 0, 0.3),
        0 10px 20px -5px rgba(0, 0, 0, 0.2),
        0 0 0 1px rgba(255, 255, 255, 0.05) inset;
}

[data-bs-theme="dark"] .wizard-container::before {
    background: linear-gradient(180deg, rgba(96, 165, 250, 0.05) 0%, transparent 100%);
}

/* === Step Headers === */
.step-header {
    margin-bottom: 20px;
    text-align: center;
}

.step-badge {
    display: inline-block;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 6px 16px;
    border-radius: 20px;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
}

.wizard-container h2 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--bs-heading-color);
}

.wizard-container h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--bs-heading-color);
}

.step-description {
    font-size: 14px;
    color: var(--bs-secondary-color);
    margin: 0;
}

/* === Form Groups === */
.form-group {
    margin-bottom: 12px;
    position: relative;
}

.wizard-container label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--bs-heading-color);
}

/* === Form Inputs === */
input[type="text"],
input[type="number"],
input[type="email"],
input[type="password"],
input[type="date"],
select,
textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--bs-border-color);
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.2s ease;
    background-color: #ffffff;
    color: var(--bs-body-color);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04) inset;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12), 0 1px 2px rgba(0, 0, 0, 0.04) inset;
    background-color: #ffffff;
}

[data-bs-theme="dark"] input[type="text"],
[data-bs-theme="dark"] input[type="number"],
[data-bs-theme="dark"] input[type="email"],
[data-bs-theme="dark"] input[type="password"],
[data-bs-theme="dark"] input[type="date"],
[data-bs-theme="dark"] select,
[data-bs-theme="dark"] textarea {
    background-color: var(--bs-tertiary-bg);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1) inset;
}

[data-bs-theme="dark"] input:focus,
[data-bs-theme="dark"] select:focus,
[data-bs-theme="dark"] textarea:focus {
    background-color: var(--bs-tertiary-bg);
    border-color: #60a5fa;
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.15), 0 1px 2px rgba(0, 0, 0, 0.1) inset;
}

input::placeholder,
textarea::placeholder {
    color: var(--bs-secondary-color);
    opacity: 0.7;
}

/* === Error Styles === */
.error {
    border-color: #dc2626 !important;
}

.error-message {
    color: #dc2626;
    font-size: 13px;
    font-weight: 500;
    margin-top: 6px;
    padding: 8px 12px;
    background-color: #fee2e2;
    border-radius: 6px;
    display: none;
}

.error-message.visible {
    display: block;
}

/* === Helper Text === */
.helper-text {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    margin-top: 6px;
    padding: 8px 12px;
    border-radius: 6px;
    color: var(--bs-secondary-color);
    background-color: var(--bs-tertiary-bg);
}

.helper-text .info-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* === Buttons === */
.wizard-buttons {
    display: flex;
    justify-content: flex-end;
    margin-top: 24px;
    gap: 12px;
}

.btn {
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn.primary {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: white;
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.3);
}

.btn.primary:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(37, 99, 235, 0.4);
}

.btn.primary:active {
    transform: translateY(0);
}

.btn.primary:disabled {
    background: #93c5fd;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.btn.secondary {
    background-color: var(--bs-body-bg);
    border: 2px solid var(--bs-border-color);
    color: var(--bs-body-color);
}

.btn.secondary:hover {
    background-color: var(--bs-tertiary-bg);
    border-color: var(--bs-secondary-color);
}

/* === Processing State === */
.processing-state {
    text-align: center;
    padding: 40px 20px;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--bs-border-color);
    border-top: 4px solid #2563eb;
    border-radius: 50%;
    margin: 0 auto 16px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* === State Messages === */
.error-message-box {
    background-color: #fee2e2;
    border: 1px solid #ef4444;
    color: #b91c1c;
    padding: 16px;
    border-radius: 8px;
    margin-top: 12px;
    text-align: center;
}

.info-message-box {
    background-color: #dbeafe;
    border: 1px solid #3b82f6;
    color: #1e40af;
    padding: 16px;
    border-radius: 8px;
    margin-top: 12px;
    text-align: center;
}

.success-message-box {
    background-color: #dcfce7;
    border: 1px solid #22c55e;
    color: #166534;
    padding: 16px;
    border-radius: 8px;
    margin-top: 12px;
    text-align: center;
}

/* State Icons */
.error-icon,
.success-icon,
.welcome-icon,
.email-sent-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.error-icon {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #dc2626;
}

.success-icon {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
    color: #16a34a;
}

.welcome-icon,
.email-sent-icon {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: #2563eb;
}

.error-icon svg,
.success-icon svg,
.welcome-icon svg,
.email-sent-icon svg {
    width: 32px;
    height: 32px;
}

.error-state,
.success-state,
.existing-user-state {
    text-align: center;
    padding: 20px;
}

/* === Premium Notification === */
.premium-notification {
    background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
    border: 1px solid #fdba74;
    color: #c2410c;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 12px;
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
}

.premium-notification svg {
    flex-shrink: 0;
    color: #f97316;
    width: 20px;
    height: 20px;
}

/* === Utility Classes === */
.hidden {
    display: none !important;
}

/* === Dark Mode Support === */
[data-bs-theme="dark"] .error-message-box {
    background-color: rgba(239, 68, 68, 0.15);
    border-color: #ef4444;
    color: #fca5a5;
}

[data-bs-theme="dark"] .info-message-box {
    background-color: rgba(59, 130, 246, 0.15);
    border-color: #3b82f6;
    color: #93c5fd;
}

[data-bs-theme="dark"] .success-message-box {
    background-color: rgba(34, 197, 94, 0.15);
    border-color: #22c55e;
    color: #86efac;
}

[data-bs-theme="dark"] .premium-notification {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15) 0%, rgba(234, 88, 12, 0.1) 100%);
    border-color: #f97316;
    color: #fdba74;
}

[data-bs-theme="dark"] .error-icon {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.2) 0%, rgba(220, 38, 38, 0.15) 100%);
}

[data-bs-theme="dark"] .success-icon {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.2) 0%, rgba(22, 163, 74, 0.15) 100%);
}

[data-bs-theme="dark"] .welcome-icon,
[data-bs-theme="dark"] .email-sent-icon {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2) 0%, rgba(37, 99, 235, 0.15) 100%);
}

/* ============================================
   PLAN STEPS STYLES
   ============================================ */

/* === Step 1: Time Input === */
.time-input {
    display: flex;
    gap: 12px;
}

.time-field {
    flex: 1;
    position: relative;
}

.input-wrapper {
    position: relative;
    height: 52px;
}

.input-wrapper input {
    width: 100%;
    height: 100%;
    padding-right: 42px;
    font-size: 18px;
    text-align: center;
}

.time-label {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    font-weight: 500;
    color: var(--bs-secondary-color);
    pointer-events: none;
    z-index: 1;
}

/* === Step 1: Date Picker === */
.date-picker-wrapper {
    position: relative;
    display: flex;
    align-items: stretch;
}

.date-picker-wrapper input[type="date"] {
    flex: 1;
    padding-right: 56px;
    min-height: 52px;
    cursor: pointer;
}

.date-picker-wrapper input[type="date"]::-webkit-calendar-picker-indicator {
    position: absolute;
    right: 0;
    top: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.date-picker-btn {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: white;
}

.date-picker-btn:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
}

.date-picker-btn:active {
    transform: translateY(-50%) scale(0.95);
}

.date-picker-btn svg {
    width: 20px;
    height: 20px;
    pointer-events: none;
}

/* === Step 1: Custom Distance === */
.distance-container {
    display: flex;
    gap: 12px;
}

.distance-input {
    flex: 2;
}

.distance-unit {
    flex: 1;
}

/* === Step 2: Measurement Inputs === */
.measurement-input {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.flex-grow {
    flex: 2;
}

.unit-select {
    flex: 1;
}

/* === Step 3: Character Counter === */
.char-counter {
    margin-top: 6px;
    font-size: 12px;
    text-align: right;
    color: var(--bs-secondary-color);
}

/* === Step 4: Plan Creation Info === */
.plan-creation-info {
    padding: 20px;
    border: 1px solid #dbeafe;
    border-radius: 12px;
    margin-bottom: 20px;
    background: linear-gradient(135deg, rgba(219, 234, 254, 0.4) 0%, rgba(191, 219, 254, 0.25) 100%);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.08);
}

.plan-creation-info p {
    font-size: 15px;
    margin-bottom: 12px;
    color: var(--bs-body-color);
}

.feature-checklist {
    list-style: none;
    margin: 0;
    padding: 0;
}

.feature-checklist li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    font-size: 14px;
    color: var(--bs-body-color);
}

.feature-checklist .check-icon {
    width: 20px;
    height: 20px;
    color: #16a34a;
    flex-shrink: 0;
}

/* === Step 4: Checkbox Section === */
.checkbox-section {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--bs-border-color);
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.checkbox-group:last-child {
    margin-bottom: 0;
}

input[type="checkbox"] {
    width: 22px;
    height: 22px;
    border: 2px solid var(--bs-border-color);
    border-radius: 4px;
    cursor: pointer;
    accent-color: #2563eb;
}

.checkbox-group label {
    font-size: 14px;
    font-weight: 400;
    margin-bottom: 0;
    cursor: pointer;
}

.terms-link {
    color: #2563eb;
    text-decoration: none;
    font-weight: 500;
}

.terms-link:hover {
    text-decoration: underline;
}

/* === Step 4: Redirect Message === */
#redirect-message {
    margin-top: 12px;
    font-weight: 500;
}

#countdown {
    display: inline-block;
    min-width: 20px;
    font-weight: 700;
    color: #2563eb;
}

/* === Dark Mode === */
[data-bs-theme="dark"] .plan-creation-info {
    border-color: #1e40af;
    background: linear-gradient(135deg, rgba(30, 64, 175, 0.2) 0%, rgba(37, 99, 235, 0.1) 100%);
}

[data-bs-theme="dark"] .terms-link {
    color: #60a5fa;
}

[data-bs-theme="dark"] #countdown {
    color: #60a5fa;
}

/* ============================================
   MOBILE RESPONSIVENESS
   ============================================ */

@media (max-width: 640px) {
    /* Common Mobile Styles */
    .wizard-container {
        padding: 16px;
        border-top-width: 3px;
    }

    .wizard-container::before {
        height: 60px;
    }

    .wizard-container h2 {
        font-size: 20px;
    }

    .wizard-container h3 {
        font-size: 16px;
    }

    .wizard-container label {
        font-size: 14px;
    }

    input[type="text"],
    input[type="number"],
    input[type="email"],
    input[type="password"],
    input[type="date"],
    select,
    textarea {
        font-size: 16px;
        padding: 14px 16px;
    }

    .form-group {
        margin-bottom: 10px;
    }

    .wizard-buttons {
        gap: 8px;
    }

    .btn {
        width: 100%;
        padding: 14px;
        font-size: 16px;
    }

    .error-message {
        font-size: 14px;
    }

    .helper-text {
        font-size: 14px;
    }

    .processing-state {
        padding: 30px 15px;
    }

    /* Plan Steps Mobile Styles */
    .time-input {
        gap: 8px;
    }

    .time-field {
        flex: 1;
    }

    .input-wrapper input {
        font-size: 16px;
        padding-right: 36px;
    }

    .time-label {
        font-size: 12px;
        right: 8px;
    }

    .distance-container,
    .measurement-input {
        flex-direction: row;
        gap: 10px;
    }

    .date-picker-wrapper input[type="date"] {
        min-height: 54px;
        padding-right: 60px;
    }

    .date-picker-btn {
        width: 48px;
        height: 46px;
    }

    .checkbox-group label {
        font-size: 14px;
    }

    input[type="checkbox"] {
        width: 24px;
        height: 24px;
    }

    .plan-creation-info {
        padding: 14px;
    }

    .feature-checklist li {
        font-size: 13px;
    }
}
