/**
 * TMVN Accordion System Styles
 * Transforms FluentForms multi-step into accordion with timeline
 */

/* ===========================
   TIMELINE COMPONENT
   =========================== */

.tmvn-timeline-container {
    position: fixed;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 999;
    background: white;
    padding: 20px 15px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    max-height: 80vh;
    overflow-y: auto;
}

.tmvn-timeline {
    display: flex;
    flex-direction: column;
    gap: 24px;
    min-width: 60px;
}

.tmvn-timeline-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    cursor: pointer;
}

.tmvn-timeline-step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 40px;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 24px;
    background: #e0e0e0;
}

.tmvn-timeline-step.completed:not(:last-child)::after {
    background: #28a745;
}

.tmvn-timeline-step.active:not(:last-child)::after {
    background: linear-gradient(to bottom, #007bff 0%, #e0e0e0 100%);
}

.tmvn-timeline-number {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 16px;
    border: 2px solid #e0e0e0;
    background: white;
    color: #999;
    transition: all 0.3s ease;
}

.tmvn-timeline-step.active .tmvn-timeline-number {
    border-color: #007bff;
    background: #007bff;
    color: white;
    box-shadow: 0 0 0 4px rgba(0, 123, 255, 0.1);
}

.tmvn-timeline-step.completed .tmvn-timeline-number {
    border-color: #28a745;
    background: #28a745;
    color: white;
}

.tmvn-timeline-step.completed .tmvn-timeline-number::before {
    content: '\2713'; /* Checkmark */
    font-size: 18px;
}

.tmvn-timeline-step.completed .tmvn-timeline-number span {
    display: none;
}

.tmvn-timeline-label {
    margin-top: 8px;
    font-size: 11px;
    text-align: center;
    color: #666;
    max-width: 80px;
    line-height: 1.3;
}

.tmvn-timeline-step.active .tmvn-timeline-label {
    color: #007bff;
    font-weight: 600;
}

.tmvn-timeline-step.completed .tmvn-timeline-label {
    color: #28a745;
}

/* ===========================
   ACCORDION SECTIONS
   =========================== */

.tmvn-accordion-wrapper {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 20px;
}

.tmvn-accordion-section {
    background: white;
    border-radius: 8px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.tmvn-accordion-section.pending {
    opacity: 0.6;
    pointer-events: none;
}

.tmvn-accordion-section.active {
    border: 2px solid #007bff;
    box-shadow: 0 4px 16px rgba(0, 123, 255, 0.15);
}

.tmvn-accordion-section.completed {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border: 1px solid #28a745;
}

.tmvn-accordion-header {
    padding: 20px 24px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
}

.tmvn-accordion-section.pending .tmvn-accordion-header {
    cursor: not-allowed;
}

.tmvn-accordion-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.tmvn-accordion-step-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #f0f0f0;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    flex-shrink: 0;
}

.tmvn-accordion-section.active .tmvn-accordion-step-number {
    background: #007bff;
    color: white;
}

.tmvn-accordion-section.completed .tmvn-accordion-step-number {
    background: #28a745;
    color: white;
}

.tmvn-accordion-section.completed .tmvn-accordion-step-number::before {
    content: '\2713';
}

.tmvn-accordion-section.completed .tmvn-accordion-step-number span {
    display: none;
}

.tmvn-accordion-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.tmvn-accordion-section.completed .tmvn-accordion-title {
    color: #155724;
}

.tmvn-accordion-edit-btn {
    background: transparent;
    border: 1px solid #007bff;
    color: #007bff;
    padding: 6px 16px;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: none;
}

.tmvn-accordion-section.completed .tmvn-accordion-edit-btn {
    display: block;
}

.tmvn-accordion-edit-btn:hover {
    background: #007bff;
    color: white;
}

.tmvn-accordion-body {
    padding: 0 24px 24px 24px;
    display: none;
}

.tmvn-accordion-section.active .tmvn-accordion-body {
    display: block;
    animation: slideDown 0.3s ease;
}

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

/* ===========================
   FORM CONTROLS
   =========================== */

.tmvn-form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid #e0e0e0;
}

.tmvn-btn {
    padding: 12px 32px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.tmvn-btn-primary {
    background: #007bff;
    color: white;
}

.tmvn-btn-primary:hover {
    background: #0056b3;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

.tmvn-btn-secondary {
    background: #6c757d;
    color: white;
}

.tmvn-btn-secondary:hover {
    background: #545b62;
}

/* ===========================
   VRM LANDING SECTION
   =========================== */

.tmvn-vrm-landing {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 60px 20px;
    text-align: center;
    border-radius: 12px;
    margin-bottom: 40px;
    color: white;
}

.tmvn-vrm-landing h1 {
    font-size: 32px;
    margin-bottom: 16px;
    color: white;
}

.tmvn-vrm-landing p {
    font-size: 18px;
    margin-bottom: 32px;
    opacity: 0.95;
}

.tmvn-vrm-input-group {
    max-width: 500px;
    margin: 0 auto;
    display: flex;
    gap: 12px;
}

.tmvn-vrm-input {
    flex: 1;
    padding: 16px 20px;
    font-size: 18px;
    border: none;
    border-radius: 8px;
    text-transform: uppercase;
}

.tmvn-vrm-submit {
    padding: 16px 32px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tmvn-vrm-submit:hover {
    background: #218838;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
}

.tmvn-vrm-landing.completed {
    max-height: 0;
    overflow: hidden;
    padding: 0;
    margin: 0;
    opacity: 0;
    transition: all 0.5s ease;
}

/* ===========================
   VEHICLE CONFIRMATION MODAL
   =========================== */

.tmvn-vehicle-modal {
    background: white;
    max-width: 500px;
    margin: 0 auto;
    padding: 32px;
    border-radius: 12px;
}

.tmvn-vehicle-details {
    margin: 24px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.tmvn-vehicle-detail-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #e0e0e0;
}

.tmvn-vehicle-detail-row:last-child {
    border-bottom: none;
}

.tmvn-vehicle-detail-label {
    font-weight: 600;
    color: #666;
}

.tmvn-vehicle-detail-value {
    font-weight: 600;
    color: #333;
}

/* ===========================
   MOBILE RESPONSIVE
   =========================== */

@media (max-width: 768px) {
    .tmvn-timeline-container {
        position: relative;
        left: auto;
        top: auto;
        transform: none;
        margin-bottom: 24px;
        padding: 16px;
    }

    .tmvn-timeline {
        flex-direction: row;
        gap: 12px;
        overflow-x: auto;
        padding-bottom: 8px;
    }

    .tmvn-timeline-step:not(:last-child)::after {
        left: auto;
        top: 18px;
        right: -18px;
        width: 12px;
        height: 2px;
        transform: none;
    }

    .tmvn-timeline-label {
        display: none;
    }

    .tmvn-timeline-number {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }

    .tmvn-accordion-wrapper {
        padding: 20px 12px;
    }

    .tmvn-accordion-header {
        padding: 16px;
    }

    .tmvn-accordion-body {
        padding: 0 16px 16px 16px;
    }

    .tmvn-accordion-title {
        font-size: 16px;
    }

    .tmvn-vrm-landing h1 {
        font-size: 24px;
    }

    .tmvn-vrm-landing p {
        font-size: 16px;
    }

    .tmvn-vrm-input-group {
        flex-direction: column;
    }

    .tmvn-form-actions {
        flex-direction: column;
    }

    .tmvn-btn {
        width: 100%;
    }
}

/* ===========================
   HIDE ORIGINAL FLUENTFORM ELEMENTS
   =========================== */

.tmvn-accordion-enabled .ff-step-titles,
.tmvn-accordion-enabled .ff_step_titles,
.tmvn-accordion-enabled .fluentform .ff-btn-prev,
.tmvn-accordion-enabled .ff_multistep_progressbar {
    display: none !important;
}

/* ===========================
   SMOOTH TRANSITIONS
   =========================== */

.tmvn-smooth-scroll {
    scroll-behavior: smooth;
}

/* ===========================
   LOADING STATES
   =========================== */

.tmvn-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.6;
}

.tmvn-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #007bff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 0.6s linear infinite;
}

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

/* ===========================
   PRICE COMPARISON TABLE
   =========================== */

.tmvn-price-table {
    width: 100%;
    margin: 20px 0;
    border-collapse: collapse;
    background: #f8f9fa;
    border-radius: 8px;
    overflow: hidden;
}

.tmvn-price-table th,
.tmvn-price-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #dee2e6;
}

.tmvn-price-table th {
    background: #007bff;
    color: white;
    font-weight: 600;
}

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

.tmvn-price-table .price-highlight {
    font-weight: 700;
    color: #007bff;
    font-size: 18px;
}

/* ===========================
   HELPER TEXT & TOOLTIPS
   =========================== */

.tmvn-helper-text {
    font-size: 13px;
    color: #6c757d;
    margin-top: 4px;
    font-style: italic;
}

.tmvn-tooltip {
    position: relative;
    display: inline-block;
    margin-left: 4px;
}

.tmvn-tooltip .tmvn-tooltip-icon {
    width: 16px;
    height: 16px;
    background: #007bff;
    color: white;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    cursor: help;
}

.tmvn-tooltip:hover .tmvn-tooltip-text {
    visibility: visible;
    opacity: 1;
}

.tmvn-tooltip-text {
    visibility: hidden;
    opacity: 0;
    width: 200px;
    background: #333;
    color: white;
    text-align: center;
    padding: 8px;
    border-radius: 6px;
    position: absolute;
    z-index: 1000;
    bottom: 125%;
    left: 50%;
    margin-left: -100px;
    transition: opacity 0.2s;
    font-size: 12px;
}

.tmvn-tooltip-text::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #333 transparent transparent transparent;
}
