/**
 * MatterMind Components Stylesheet
 * Reusable UI components: buttons, forms, cards, modals, alerts, tables, wizards
 */

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    text-align: center;
}

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

.btn-primary:hover {
    background-color: var(--teal-dark);
    box-shadow: var(--shadow-hover);
    color: var(--white);
}

.btn-secondary {
    background-color: var(--grey-medium);
    color: var(--grey-dark);
}

.btn-secondary:hover {
    background-color: #B8B8B8;
}

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

.btn-danger:hover {
    background-color: #C0392B;
}

.btn-success {
    background-color: var(--green-success);
    color: var(--white);
}

.btn-success:hover {
    background-color: #229954;
}

.btn-warning {
    background-color: var(--yellow-warning);
    color: var(--white);
}

.btn-warning:hover {
    background-color: #E67E22;
}

.btn-block {
    width: 100%;
    display: block;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-lg {
    padding: 15px 30px;
    font-size: 16px;
}

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

.btn-clio {
    background-color: var(--teal-primary);
    color: var(--white);
    position: relative;
    overflow: hidden;
}

.btn-clio:hover:not(:disabled) {
    background-color: var(--teal-dark);
    box-shadow: 0 2px 8px rgba(0, 139, 139, 0.3);
}

.btn-clio:disabled {
    background-color: var(--teal-primary);
    opacity: 0.9;
    cursor: wait;
}

/* Modern syncing state with subtle shimmer */
.btn-clio.syncing {
    background: linear-gradient(90deg,
        var(--teal-primary) 0%,
        var(--teal-light) 50%,
        var(--teal-primary) 100%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--teal-primary);
    color: var(--teal-primary);
    padding: 4px 12px;
    font-size: 12px;
}

.btn-outline:hover {
    background: var(--teal-primary);
    color: white;
}

.btn-link {
    background: transparent;
    border: none;
    color: var(--teal-primary);
    text-decoration: underline;
    cursor: pointer;
}

.btn-link:hover {
    color: var(--teal-dark);
}

.btn-arrow {
    margin: 0 5px;
    font-size: 16px;
}

/* ============================================
   Modern Button Spinner
   ============================================ */

.btn-spinner {
    display: none;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.6s linear infinite;
    margin-left: 8px;
    vertical-align: middle;
}

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

/* Sync button specific styles */
#sync-btn-text,
#sync-firm-btn-text {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

#sync-btn-spinner,
#sync-firm-btn-spinner {
    display: none;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.7s linear infinite;
    vertical-align: middle;
}

/* When syncing, show spinner inline with text */
#sync-activities-btn.syncing #sync-btn-text {
    display: inline-flex;
    align-items: center;
}

#sync-activities-btn.syncing #sync-btn-spinner {
    display: inline-block;
    margin-left: 6px;
}

/* Cards */
.card {
    background: var(--white);
    border-radius: 8px;
    padding: 20px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

.card-header {
    background-color: var(--teal-primary);
    color: var(--white);
    padding: 15px 20px;
    border-radius: 8px 8px 0 0;
    font-size: 18px;
    font-weight: 600;
    margin: -20px -20px 20px -20px;
}

.card-header-warning {
    background-color: var(--yellow-warning) !important;
}

.card-header-danger {
    background-color: var(--red-alert) !important;
}

.card-header[style*="red-alert"] {
    background-color: var(--red-alert);
}

.card-body {
    padding: 20px;
}

.card-footer {
    border-top: 1px solid var(--grey-medium);
    padding-top: 15px;
    margin-top: 15px;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: var(--grey-dark);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid var(--grey-medium);
    border-radius: var(--border-radius);
    font-size: 14px;
    font-family: inherit;
    transition: var(--transition);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--teal-primary);
    box-shadow: 0 0 0 3px rgba(0, 139, 139, 0.1);
}

.form-textarea {
    min-height: 100px;
    resize: vertical;
}

.form-help {
    font-size: 12px;
    color: #777;
    margin-top: 5px;
}

.form-error {
    font-size: 12px;
    color: var(--red-alert);
    margin-top: 5px;
}

.form-static {
    padding: 10px 0;
    color: var(--grey-dark);
}

.form-input-sm {
    padding: 8px 12px;
    font-size: 13px;
}

/* Alerts */
.alert {
    padding: 15px 20px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    border: 1px solid transparent;
}

.alert-success {
    background-color: #D4EDDA;
    color: #155724;
    border-color: #C3E6CB;
}

.alert-warning {
    background-color: #FFF3CD;
    color: #856404;
    border-color: #FFEAA7;
}

.alert-danger {
    background-color: #F8D7DA;
    color: #721C24;
    border-color: #F5C6CB;
}

.alert-info {
    background-color: #D1ECF1;
    color: #0C5460;
    border-color: #BEE5EB;
}

/* Tables */
.table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.table thead {
    background-color: var(--teal-primary);
    color: var(--white);
}

.table th,
.table td {
    padding: 12px 15px;
    text-align: left;
}

.table tbody tr {
    border-bottom: 1px solid var(--grey-light);
}

.table tbody tr:hover {
    background-color: var(--grey-light);
}

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

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 500;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-success {
    background-color: var(--green-success);
    color: var(--white);
}

.badge-warning {
    background-color: var(--yellow-warning);
    color: var(--white);
}

.badge-danger {
    background-color: var(--red-alert);
    color: var(--white);
}

.badge-info {
    background-color: var(--teal-light);
    color: var(--white);
}

.badge-secondary {
    background-color: var(--grey-medium);
    color: var(--grey-dark);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    padding: 20px;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(2px);
}

.modal-content {
    position: relative;
    background: var(--white);
    border-radius: 12px;
    width: 100%;
    max-width: 450px;
    max-height: calc(100vh - 40px);
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    z-index: 1;
    animation: modalSlideIn 0.2s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--grey-medium);
    flex-shrink: 0;
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #999;
    padding: 0;
    line-height: 1;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.modal-close:hover {
    color: var(--grey-dark);
    background: var(--grey-light);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--grey-medium);
    background: var(--grey-light);
    border-radius: 0 0 12px 12px;
    flex-shrink: 0;
}

/* Large Modal */
.modal-lg {
    max-width: 680px;
}

/* Responsive Modal */
@media (max-width: 768px) {
    .modal {
        padding: 10px;
    }

    .modal-content {
        max-height: calc(100vh - 20px);
        border-radius: 8px;
        margin: 20px;
    }

    .modal-lg {
        max-width: 100%;
    }

    .modal-header {
        padding: 16px 20px;
    }

    .modal-header h3 {
        font-size: 16px;
    }

    .modal-body {
        padding: 20px;
    }

    .modal-footer {
        padding: 12px 20px;
        flex-wrap: wrap;
    }

    .modal-footer .btn {
        flex: 1;
        min-width: 120px;
    }
}

/* ===========================================================
   WIZARD STYLES
   =========================================================== */

.wizard-container {
    max-width: 800px;
    margin: 0 auto;
}

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

.wizard-header h1 {
    color: var(--teal-primary);
    margin-bottom: 5px;
}

/* Progress Bar */
.wizard-progress-bar {
    margin-bottom: 30px;
}

.progress-track {
    height: 8px;
    background-color: var(--grey-light);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 15px;
}

.progress-track .progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--teal-primary), var(--teal-light));
    border-radius: 4px;
    transition: width 0.4s ease;
}

.progress-steps {
    display: flex;
    justify-content: space-between;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
}

.progress-step .step-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: var(--grey-medium);
    margin-bottom: 8px;
    transition: var(--transition);
}

.progress-step .step-text {
    font-size: 12px;
    color: var(--grey-medium);
    font-weight: 500;
}

.progress-step.active .step-dot {
    background-color: var(--teal-primary);
    box-shadow: 0 0 0 4px rgba(0, 139, 139, 0.2);
}

.progress-step.active .step-text {
    color: var(--teal-primary);
    font-weight: 600;
}

.progress-step.completed .step-dot {
    background-color: var(--green-success);
}

.progress-step.completed .step-text {
    color: var(--green-success);
}

/* Wizard Content */
.wizard-content {
    margin-bottom: 20px;
}

.wizard-panel {
    animation: fadeIn 0.3s ease-in-out;
}

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

.wizard-buttons {
    display: flex;
    justify-content: space-between;
    gap: 15px;
}

.wizard-buttons .btn {
    min-width: 120px;
}

/* Horizontal Radio Options */
.radio-group-horizontal {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.radio-option {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    padding: 15px 20px;
    border: 2px solid var(--grey-medium);
    border-radius: var(--border-radius);
    transition: var(--transition);
    flex: 1;
    min-width: 200px;
}

.radio-option:hover {
    border-color: var(--teal-light);
    background-color: rgba(0, 139, 139, 0.02);
}

.radio-option input[type="radio"] {
    margin-right: 12px;
    margin-top: 3px;
    width: 18px;
    height: 18px;
    accent-color: var(--teal-primary);
    flex-shrink: 0;
}

.radio-option input[type="radio"]:checked ~ .radio-label .radio-title {
    color: var(--teal-primary);
}

.radio-option:has(input[type="radio"]:checked) {
    border-color: var(--teal-primary);
    background-color: rgba(0, 139, 139, 0.05);
}

.radio-label {
    display: flex;
    flex-direction: column;
}

.radio-title {
    font-weight: 600;
    color: var(--grey-dark);
    margin-bottom: 3px;
}

.radio-desc {
    font-size: 13px;
    color: #777;
}

/* Filter Section */
.filter-section {
    margin-bottom: 20px;
}

.filter-section h4 {
    margin-bottom: 8px;
}

.section-divider {
    margin: 25px 0;
    border-color: var(--grey-light);
}

/* Checkbox Grid for Practice Areas */
.practice-area-picker {
    background-color: var(--grey-light);
    border-radius: var(--border-radius);
    padding: 15px;
    margin-top: 15px;
}

.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
}

.checkbox-card {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    background: var(--white);
    border: 2px solid transparent;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
}

.checkbox-card:hover {
    border-color: var(--teal-light);
}

.checkbox-card input[type="checkbox"] {
    margin-right: 10px;
    width: 18px;
    height: 18px;
    accent-color: var(--teal-primary);
    flex-shrink: 0;
}

.checkbox-card:has(input[type="checkbox"]:checked) {
    border-color: var(--teal-primary);
    background-color: rgba(0, 139, 139, 0.05);
}

.checkbox-label {
    font-size: 14px;
    color: var(--grey-dark);
}

.loading-placeholder {
    grid-column: 1 / -1;
    text-align: center;
    padding: 30px;
}

.loading-placeholder p {
    margin-top: 10px;
    color: #777;
}

/* Column Preview */
.columns-preview {
    background-color: var(--grey-light);
    padding: 20px;
    border-radius: var(--border-radius);
}

.columns-preview h5 {
    margin-bottom: 10px;
}

.column-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.column-chip {
    background-color: var(--teal-primary);
    color: var(--white);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
}

/* Connection Status */
.connection-status {
    padding: 20px;
    background-color: var(--grey-light);
    border-radius: var(--border-radius);
}

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: 600;
}

.status-badge .status-icon {
    font-size: 18px;
    margin-right: 10px;
}

.status-connected {
    background-color: #D4EDDA;
    color: #155724;
}

.status-disconnected {
    background-color: #FFF3CD;
    color: #856404;
}

/* Preview Stats */
.preview-stats {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-bottom: 25px;
}

.stat-card {
    background: linear-gradient(135deg, var(--teal-primary), var(--teal-light));
    color: var(--white);
    padding: 25px 40px;
    border-radius: var(--border-radius);
    text-align: center;
    min-width: 150px;
}

.stat-card .stat-number {
    display: block;
    font-size: 42px;
    font-weight: 700;
    line-height: 1;
}

.stat-card .stat-label {
    font-size: 14px;
    opacity: 0.9;
    margin-top: 5px;
}

/* Preview Section */
.preview-section h5 {
    margin-bottom: 15px;
    color: var(--grey-dark);
}

.preview-list {
    max-height: 200px;
    overflow-y: auto;
    background-color: var(--grey-light);
    border-radius: var(--border-radius);
}

.preview-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: var(--white);
    margin: 5px;
    border-radius: var(--border-radius);
}

.preview-item-name {
    font-weight: 500;
}

/* Preview Table */
.preview-table-container {
    max-height: 300px;
    overflow-y: auto;
    border-radius: var(--border-radius);
    border: 1px solid var(--grey-medium);
}

.preview-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.preview-table thead {
    background-color: var(--teal-primary);
    color: var(--white);
    position: sticky;
    top: 0;
}

.preview-table th,
.preview-table td {
    padding: 10px 12px;
    text-align: left;
}

.preview-table tbody tr {
    border-bottom: 1px solid var(--grey-light);
}

.preview-table tbody tr:hover {
    background-color: var(--grey-light);
}

/* Progress Bar */
.progress-container {
    margin: 20px 0;
}

.progress-bar {
    height: 20px;
    background-color: var(--grey-light);
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background-color: var(--teal-primary);
    border-radius: 10px;
    transition: width 0.5s ease-in-out;
}

.progress-text {
    text-align: center;
    margin-top: 10px;
    color: var(--grey-dark);
}

/* Import Log */
.import-log {
    max-height: 200px;
    overflow-y: auto;
    background-color: var(--grey-light);
    border-radius: var(--border-radius);
    padding: 15px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 12px;
}

.log-entry {
    padding: 5px 0;
    border-bottom: 1px solid var(--grey-medium);
}

.log-entry:last-child {
    border-bottom: none;
}

/* Import Summary */
.import-summary {
    padding: 20px;
    background-color: var(--grey-light);
    border-radius: var(--border-radius);
    margin-bottom: 20px;
}

.import-summary p {
    margin-bottom: 10px;
}

.import-summary p:last-child {
    margin-bottom: 0;
}

/* Import Progress Container */
.import-progress-container {
    text-align: center;
}

.import-progress-bar {
    height: 24px;
    background-color: var(--grey-light);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 15px;
}

.import-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--teal-primary), var(--teal-light));
    border-radius: 12px;
    transition: width 0.5s ease-in-out;
}

.import-status {
    font-size: 16px;
    color: var(--grey-dark);
    margin: 0;
}

/* Success Message */
.success-message {
    text-align: center;
    padding: 30px;
}

.success-icon {
    width: 80px;
    height: 80px;
    background-color: var(--green-success);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    margin: 0 auto 20px;
}

.success-message h3 {
    color: var(--green-success);
    margin-bottom: 10px;
}

.success-message p {
    color: #777;
}

/* Error Message */
.error-message {
    text-align: center;
    padding: 30px;
}

.error-icon {
    width: 80px;
    height: 80px;
    background-color: var(--red-alert);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    margin: 0 auto 20px;
}

.error-message h3 {
    color: var(--red-alert);
    margin-bottom: 10px;
}

.error-message p {
    color: #777;
}

/* Import Summary Items */
.summary-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--grey-medium);
}

.summary-item:last-child {
    border-bottom: none;
}

.summary-label {
    font-weight: 500;
    color: #777;
}

.summary-value {
    font-weight: 700;
    color: var(--teal-primary);
    font-size: 18px;
}

/* Skip Link */
.skip-link {
    color: #999;
    font-size: 13px;
}

.skip-link:hover {
    color: var(--teal-primary);
}

/* Wizard Welcome (Step 1 Redesign) */
.wizard-welcome {
    text-align: center;
    padding: 40px 20px;
}

.wizard-welcome-header {
    margin-bottom: 40px;
}

.wizard-welcome-header h1 {
    font-size: 32px;
    font-weight: 700;
    color: var(--grey-dark);
    margin-bottom: 12px;
}

.wizard-welcome-subtitle {
    font-size: 18px;
    color: #666;
    margin: 0;
}

.wizard-value-props {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 500px;
    margin: 0 auto 40px;
    text-align: left;
}

.value-prop-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: #f8fafa;
    border-radius: var(--border-radius);
    border-left: 4px solid var(--teal-primary);
}

.value-prop-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--teal-primary);
    color: white;
    border-radius: 50%;
    font-size: 16px;
    font-weight: 700;
    flex-shrink: 0;
}

.value-prop-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.value-prop-text strong {
    font-size: 15px;
    color: var(--grey-dark);
}

.value-prop-text span {
    font-size: 13px;
    color: #777;
}

.wizard-connect-section {
    margin-top: 20px;
}

.wizard-connect-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 32px;
    font-size: 16px;
}

.wizard-connect-note {
    margin-top: 12px;
    font-size: 13px;
    color: #999;
}

/* Wizard Welcome Hero */
.wizard-welcome-hero {
    background: linear-gradient(170deg, #f0fdfa 0%, #ffffff 60%);
    border: 1px solid #e0f2f1;
    border-radius: 12px;
    padding: 48px 32px;
    text-align: center;
}

.wizard-hero-illustration {
    margin: 0 auto 24px;
    display: flex;
    justify-content: center;
}

.wizard-time-badge {
    display: inline-block;
    background: #f0fdfa;
    color: #0d9488;
    font-size: 12px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 12px;
    margin-left: 8px;
    vertical-align: middle;
}

.value-prop-enhanced {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: white;
    border-radius: 10px;
    border: 1px solid #f0f0f0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    text-align: left;
}

.value-prop-enhanced:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0,0,0,0.08);
}

.value-prop-icon-svg {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #0d9488 0%, #14b8a6 100%);
    border-radius: 50%;
    flex-shrink: 0;
}

.wizard-connect-enhanced {
    border-top: 1px solid #f0f0f0;
    margin-top: 32px;
    padding-top: 24px;
    text-align: center;
}

/* Wizard Celebration (Step 3) */
.success-celebration {
    text-align: center;
    position: relative;
    overflow: hidden;
    padding: 24px 0;
}

.success-check-animated {
    width: 80px;
    height: 80px;
    margin: 0 auto;
}

.checkmark-circle {
    stroke-dasharray: 226;
    stroke-dashoffset: 226;
    animation: checkCircleDraw 0.6s ease-out forwards;
}

.checkmark-path {
    stroke-dasharray: 60;
    stroke-dashoffset: 60;
    animation: checkPathDraw 0.3s ease-out 0.6s forwards;
}

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

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

.success-stats {
    display: flex;
    gap: 24px;
    justify-content: center;
    margin-top: 24px;
}

.success-stat-card {
    background: linear-gradient(135deg, #0d9488 0%, #14b8a6 100%);
    border-radius: 12px;
    padding: 20px 32px;
    min-width: 140px;
    color: white;
}

.success-stat-number {
    display: block;
    font-size: 36px;
    font-weight: 700;
    line-height: 1.2;
}

.success-stat-label {
    display: block;
    font-size: 13px;
    opacity: 0.9;
    margin-top: 4px;
}

#confetti-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

.confetti-piece {
    position: absolute;
    top: -10px;
    animation: confettiFall 2.5s ease-in forwards;
}

@keyframes confettiFall {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(400px) rotate(720deg);
        opacity: 0;
    }
}

/* Live Count Display */
.wizard-live-count {
    margin-top: 24px;
    padding: 16px 20px;
    background: linear-gradient(135deg, #f0fdfa 0%, #ccfbf1 100%);
    border: 2px solid #99f6e4;
    border-radius: var(--border-radius);
}

.live-count-inner {
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: center;
}

.live-count-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

.live-count-icon .spinner-small {
    width: 20px;
    height: 20px;
    border: 3px solid #e0e0e0;
    border-top-color: var(--teal-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.live-count-icon #live-count-check {
    font-size: 20px;
    color: var(--green-success);
    font-weight: 700;
}

.live-count-text {
    font-size: 15px;
    font-weight: 600;
    color: #0f766e;
}

/* Responsive Wizard */
@media (max-width: 768px) {
    .wizard-progress {
        flex-wrap: wrap;
    }

    .wizard-step-line {
        display: none;
    }

    .wizard-step {
        margin: 10px;
    }

    .preview-summary {
        flex-direction: column;
        gap: 15px;
    }

    .wizard-buttons {
        flex-direction: column;
    }

    .wizard-buttons .btn {
        width: 100%;
    }

    .radio-group-horizontal {
        flex-direction: column;
    }

    .radio-option {
        min-width: 100%;
    }

    .preview-stats {
        flex-direction: column;
        align-items: center;
    }

    .stat-card {
        width: 100%;
        max-width: 200px;
    }

    .progress-steps {
        gap: 5px;
    }

    .progress-step .step-text {
        font-size: 10px;
    }

    .checkbox-grid {
        grid-template-columns: 1fr;
    }
}

/* ===========================================================
   TASK TEMPLATE STYLES
   =========================================================== */

/* Suggestion Banner */
.template-suggestion-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    background: linear-gradient(135deg, #e0f7fa 0%, #e0f2f1 100%);
    border: 1px solid #b2dfdb;
    border-radius: var(--border-radius);
    margin-bottom: 15px;
    font-size: 14px;
    color: #00695c;
}

.template-suggestion-banner a {
    color: var(--teal-primary);
    font-weight: 600;
    text-decoration: none;
}

.template-suggestion-banner a:hover {
    text-decoration: underline;
}

/* Template Card in Modal */
.template-card {
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    margin-bottom: 10px;
    background: var(--white);
    transition: box-shadow 0.2s;
}

.template-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Template Item Row in Modal */
.template-item-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    border-bottom: 1px solid #f0f0f0;
}

.template-item-row:last-child {
    border-bottom: none;
}

.template-item-row input[type="checkbox"] {
    flex-shrink: 0;
}

/* Source Badges */
.template-badge-platform {
    display: inline-block;
    padding: 2px 8px;
    background: #e3f2fd;
    color: #1565c0;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 500;
}

.template-badge-account {
    display: inline-block;
    padding: 2px 8px;
    background: #f3e5f5;
    color: #7b1fa2;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 500;
}

.template-badge-applied {
    display: inline-block;
    padding: 2px 8px;
    background: #fff3e0;
    color: #e65100;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 500;
}
