/* Custom CSS for Wizard & Validation (5.2.1, 5.1.2) */

.sticky-footer {
    position: sticky;
    bottom: 0;
    background: white;
    border-top: 1px solid var(--border-primary);
    z-index: 10;
}

/* Wizard Progress Header */
.wizard-progress {
    padding: 24px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-primary);
    position: sticky;
    top: 0;
    z-index: 10;
}

.wizard-steps {
    display: flex;
    justify-content: space-between;
    margin-bottom: 16px;
    position: relative;
    padding: 0 5%; /* Padding to allow space for connectors */
}

.wizard-steps::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 5%;
    right: 5%;
    height: 2px;
    background: var(--border-primary);
    z-index: 0;
}

.wizard-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    position: relative;
    flex: 1;
    z-index: 1;
}

.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: white;
    color: var(--text-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    border: 2px solid var(--border-primary);
    transition: all 0.3s;
    z-index: 2; /* Keep circle on top of the line */
}

.wizard-step.active .step-number {
    background: var(--primary-500);
    color: white;
    border-color: var(--primary-500);
}

.wizard-step.completed .step-number {
    background: var(--success-500);
    border-color: var(--success-500);
    color: white;
}

.step-check {
    position: absolute;
    top: 8px;
    right: 8px;
    color: white;
    font-size: 12px;
    opacity: 0;
    transition: opacity 0.3s;
}

.wizard-step.completed .step-check {
    opacity: 1;
}

.wizard-progress-bar {
    height: 4px;
    background: var(--bg-tertiary);
    border-radius: 2px;
    overflow: hidden;
    margin: 0 5%;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-500), var(--primary-600));
    transition: width 0.3s ease;
}

/* Inline Validation (5.1.2) */
.input-with-validation {
    position: relative;
}

.validation-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 3;
    pointer-events: none; /* Allows clicks to pass through to the input */
}

.input-with-validation input:valid:not(:placeholder-shown) ~ .validation-icon i {
    color: var(--success-500);
}
.input-with-validation input:valid:not(:placeholder-shown) ~ .validation-icon {
    opacity: 1;
}

.input-with-validation input.is-invalid ~ .validation-icon i {
    color: var(--danger-500);
}
.input-with-validation input.is-invalid ~ .validation-icon {
    opacity: 1;
}

/* TinyMCE Validation */
.tinymce-valid-icon {
    float: right;
    margin-top: -30px;
    margin-right: 10px;
    color: var(--success-500);
}
.tinymce-invalid-icon {
    float: right;
    margin-top: -30px;
    margin-right: 10px;
    color: var(--danger-500);
}


/* RSS Item Selection Grid (5.1.3) */
.rss-items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 12px;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 10px; /* Space for scrollbar */
}

.rss-item-card {
    position: relative;
}

.rss-item-label {
    display: block;
    background: white;
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    padding: 12px;
    transition: all 0.2s;
    cursor: pointer;
}

.rss-item-card input[type="checkbox"] {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 5;
}

.rss-item-label:hover {
    border-color: var(--primary-500);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.15);
}

.rss-item-card input[type="checkbox"]:checked + .rss-item-label {
    background: rgba(99, 102, 241, 0.1); /* Light primary background */
    border-color: var(--primary-500);
}

.rss-category-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    background: var(--primary-500);
    color: white;
    margin-bottom: 4px;
}

.rss-title {
    display: block;
    font-weight: 500;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.rss-meta {
    display: block;
    font-size: 11px;
    color: var(--text-tertiary);
}

.rss-item-card .form-check-input {
    /* Make the hidden checkbox accessible while clicking the card */
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    top: 0;
    left: 0;
    margin: 0;
    z-index: 4;
}
.rss-item-card .form-check-input[type="checkbox"] + .rss-item-label::before {
    /* Style the visual checkbox/checkmark */
    content: "\f00c"; /* Font Awesome checkmark */
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    position: absolute;
    top: 10px;
    right: 10px;
    width: 20px;
    height: 20px;
    border: 1px solid var(--border-primary);
    border-radius: 4px;
    background-color: white;
    color: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: all 0.2s;
    z-index: 5;
}

.rss-item-card .form-check-input[type="checkbox"]:checked + .rss-item-label::before {
    background-color: var(--primary-500);
    border-color: var(--primary-500);
    color: white;
}