/* PlaneMatcher Form Styles */

/* Prevent horizontal overflow on mobile only */
@media (max-width: 768px) {
    body.page-template .plane-matcher-container,
    body .plane-matcher-container {
        max-width: 100vw;
        overflow-x: hidden;
    }
}

.plane-matcher-container {
    max-width: 600px;
    margin: 40px auto;
    padding: 30px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    transition: max-width 0.3s ease;
}

/* Keep container centered on desktop for form */
@media (min-width: 769px) {
    .plane-matcher-container {
        max-width: 600px !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }

    /* Only expand when results are shown, not the form */
    .plane-matcher-container:has(.plane-matcher-result.show) {
        max-width: 1400px !important;
        box-shadow: none;
    }

    /* Keep form elements constrained even when container expands */
    .plane-matcher-form,
    .plane-matcher-progress {
        max-width: 600px;
        margin-left: auto;
        margin-right: auto;
    }
}

.plane-matcher-progress {
    display: flex;
    justify-content: space-between;
    margin-bottom: 30px;
    position: relative;
}

.plane-matcher-progress::before {
    content: '';
    position: absolute;
    top: 15px;
    left: 0;
    right: 0;
    height: 2px;
    background: #e0e0e0;
    z-index: 0;
}

.plane-matcher-progress-step {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #e0e0e0;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    position: relative;
    z-index: 1;
    transition: all 0.3s ease;
}

.plane-matcher-progress-step.active {
    background: #2563eb;
    color: #ffffff;
}

.plane-matcher-progress-step.completed {
    background: #10b981;
    color: #ffffff;
}

.plane-matcher-form-step {
    display: none;
    animation: fadeIn 0.4s ease-in;
}

.plane-matcher-form-step.active {
    display: block;
}

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

.plane-matcher-question {
    font-size: 24px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 24px;
    line-height: 1.4;
}

.plane-matcher-select-wrapper {
    position: relative;
    margin-bottom: 30px;
}

.plane-matcher-select {
    width: 100%;
    padding: 14px 16px;
    font-size: 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    background: #ffffff;
    color: #1f2937;
    cursor: pointer;
    transition: all 0.3s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 20px;
    padding-right: 45px;
}

.plane-matcher-select:hover {
    border-color: #2563eb;
}

.plane-matcher-select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.plane-matcher-select option {
    padding: 10px;
}

.plane-matcher-buttons {
    display: flex;
    gap: 12px;
    justify-content: space-between;
    margin-top: 30px;
}

.plane-matcher-btn {
    flex: 1;
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.plane-matcher-btn-prev {
    background: #f3f4f6;
    color: #4b5563;
}

.plane-matcher-btn-prev:hover {
    background: #e5e7eb;
}

.plane-matcher-btn-prev:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.plane-matcher-btn-next {
    background: #2563eb;
    color: #ffffff;
}

.plane-matcher-btn-next:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.plane-matcher-btn-next:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.plane-matcher-btn-submit {
    background: #10b981;
    color: #ffffff;
}

.plane-matcher-btn-submit:hover {
    background: #059669;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.plane-matcher-error {
    color: #ef4444;
    font-size: 14px;
    margin-top: 8px;
    display: none;
}

.plane-matcher-error.show {
    display: block;
}

.plane-matcher-result {
    display: none;
    padding: 20px 0;
    animation: fadeIn 0.5s ease-in;
}

.plane-matcher-result.show {
    display: block;
}

.plane-matcher-back-button {
    background: #f1f5f9;
    color: #475569;
    border: 2px solid #e2e8f0;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 20px;
    width: 100%;
    justify-content: center;
}

.plane-matcher-back-button:hover {
    background: #e2e8f0;
    border-color: #cbd5e1;
    transform: translateX(-4px);
}

.plane-matcher-back-button svg {
    transition: transform 0.3s ease;
}

.plane-matcher-back-button:hover svg {
    transform: translateX(-4px);
}

/* Two-column layout */
.plane-matcher-result-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 30px;
    align-items: start;
}

/* Loading state */
.plane-matcher-loading-text {
    display: none;
    text-align: center;
    padding: 60px 20px;
}

.plane-matcher-loading-text .spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #e5e7eb;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 20px;
}

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

.plane-matcher-loading-text h3 {
    font-size: 20px;
    color: #1f2937;
    margin-bottom: 10px;
    font-weight: 600;
}

.plane-matcher-loading-text p {
    font-size: 16px;
    color: #6b7280;
}

/* User Selections Sidebar */
.plane-matcher-sidebar {
    position: sticky;
    top: 20px;
}

.plane-matcher-selections-box {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.plane-matcher-selections-box h3 {
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 20px 0;
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 16px;
    border-bottom: 2px solid #cbd5e1;
}

.plane-matcher-selections-box h3 svg {
    color: #10b981;
    flex-shrink: 0;
}

.plane-matcher-selections-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.selection-item {
    animation: slideIn 0.3s ease-out forwards;
    opacity: 0;
}

.selection-item:nth-child(1) { animation-delay: 0.1s; }
.selection-item:nth-child(2) { animation-delay: 0.15s; }
.selection-item:nth-child(3) { animation-delay: 0.2s; }
.selection-item:nth-child(4) { animation-delay: 0.25s; }
.selection-item:nth-child(5) { animation-delay: 0.3s; }
.selection-item:nth-child(6) { animation-delay: 0.35s; }
.selection-item:nth-child(7) { animation-delay: 0.4s; }

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

.selection-label {
    font-size: 12px;
    font-weight: 600;
    color: #000000;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
    background: #dbeafe;
    padding: 6px 12px;
    border-radius: 6px;
    display: block;
}

.selection-value {
    font-size: 14px;
    color: #1e293b;
    font-weight: 500;
    line-height: 1.5;
}

/* Main Content Area */
.plane-matcher-main-content {
    background: #ffffff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    min-height: 400px;
}

/* Markdown Content Styles */
.plane-matcher-recommendations {
    text-align: left;
    line-height: 1.5;
    color: #334155;
}

.plane-matcher-recommendations h1,
.plane-matcher-recommendations h2,
.plane-matcher-recommendations h3,
.plane-matcher-recommendations h4 {
    color: #1e293b;
    margin-top: 16px;
    margin-bottom: 12px;
    font-weight: 700;
    line-height: 1.3;
}

.plane-matcher-recommendations h1 {
    font-size: 32px;
    color: #2563eb;
    margin-top: 0;
}

.plane-matcher-recommendations h2 {
    font-size: 24px;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 10px;
    margin-top: 20px;
}

.plane-matcher-recommendations h3 {
    font-size: 20px;
    color: #475569;
}

.plane-matcher-recommendations h4 {
    font-size: 18px;
}

.plane-matcher-recommendations p {
    font-size: 16px;
    margin-bottom: 12px;
    line-height: 1.5;
}

.plane-matcher-recommendations ul,
.plane-matcher-recommendations ol {
    margin: 12px 0 12px 24px;
    line-height: 1.6;
}

.plane-matcher-recommendations li {
    margin-bottom: 10px;
}

.plane-matcher-recommendations ul li {
    list-style-type: disc;
}

.plane-matcher-recommendations ol li {
    list-style-type: decimal;
}

.plane-matcher-recommendations li ul,
.plane-matcher-recommendations li ol {
    font-size: 13px;
    margin-top: 6px;
}

.plane-matcher-recommendations li ul li,
.plane-matcher-recommendations li ol li {
    margin-bottom: 4px;
    font-size: 13px;
}

.plane-matcher-recommendations table {
    width: 100%;
    border-collapse: collapse;
    margin: 24px 0;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
}

.plane-matcher-recommendations th,
.plane-matcher-recommendations td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.plane-matcher-recommendations th {
    background: #f1f5f9;
    font-weight: 700;
    color: #1e293b;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.plane-matcher-recommendations td {
    color: #475569;
    font-size: 15px;
}

.plane-matcher-recommendations tr:last-child td {
    border-bottom: none;
}

.plane-matcher-recommendations tr:hover {
    background: #f8fafc;
}

.plane-matcher-recommendations strong {
    font-weight: 700;
    color: #1e293b;
}

.plane-matcher-recommendations em {
    font-style: italic;
    color: #64748b;
}

.plane-matcher-recommendations code {
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 14px;
    color: #be123c;
}

.plane-matcher-recommendations pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 16px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 20px 0;
}

.plane-matcher-recommendations pre code {
    background: none;
    color: inherit;
    padding: 0;
}

.plane-matcher-recommendations blockquote {
    border-left: 4px solid #2563eb;
    padding-left: 20px;
    margin: 20px 0;
    color: #64748b;
    font-style: italic;
}

.plane-matcher-recommendations a {
    color: #2563eb;
    text-decoration: underline;
    transition: color 0.2s;
}

.plane-matcher-recommendations a:hover {
    color: #1d4ed8;
}

.plane-matcher-recommendations hr {
    border: none;
    border-top: 2px solid #e2e8f0;
    margin: 32px 0;
}

/* Error message styles */
.plane-matcher-error-message {
    text-align: center;
    padding: 40px 20px;
}

.plane-matcher-error-message h2 {
    font-size: 24px;
    color: #ef4444;
    margin-bottom: 16px;
}

.plane-matcher-error-message p {
    font-size: 16px;
    color: #6b7280;
    margin-bottom: 24px;
}

.plane-matcher-error-message .plane-matcher-btn {
    max-width: 200px;
    margin: 0 auto;
}

/* Responsive design */
@media (max-width: 1024px) {
    .plane-matcher-result-layout {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .plane-matcher-sidebar {
        position: static;
        order: 2;
    }

    .plane-matcher-main-content {
        order: 1;
    }

    .plane-matcher-selections-box {
        max-width: 600px;
        margin: 0 auto;
    }
}

/* Thank You Modal */
.plane-matcher-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease-in;
}

.plane-matcher-modal {
    background: #ffffff;
    border-radius: 16px;
    padding: 40px;
    max-width: 500px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease-out;
}

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

.plane-matcher-modal-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 24px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.plane-matcher-modal-icon svg {
    color: #ffffff;
}

.plane-matcher-modal h2 {
    font-size: 28px;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 16px 0;
}

.plane-matcher-modal p {
    font-size: 16px;
    color: #64748b;
    line-height: 1.6;
    margin: 0 0 32px 0;
}

.plane-matcher-modal-close {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #ffffff;
    border: none;
    padding: 14px 32px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.plane-matcher-modal-close:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

.plane-matcher-modal-close:active {
    transform: translateY(0);
}

@media (max-width: 768px) {
    .plane-matcher-container {
        max-width: 100%;
        padding: 0px;
        margin: 0px auto;
        box-shadow: none;
    }

    .plane-matcher-main-content {
        padding: 16px;
    }

    .plane-matcher-selections-box {
        padding: 16px;
        box-shadow: none;
    }

    .plane-matcher-recommendations h1 {
        font-size: 26px;
    }

    .plane-matcher-recommendations h2 {
        font-size: 22px;
    }
}

@media (max-width: 640px) {
    .plane-matcher-container {
        padding: 12px;
        margin: 8px;
        overflow-x: hidden;
    }

    .plane-matcher-question {
        font-size: 20px;
    }

    .plane-matcher-buttons {
        flex-direction: column;
    }

    .plane-matcher-btn {
        width: 100%;
    }

    .plane-matcher-progress-step {
        width: 25px;
        height: 25px;
        font-size: 12px;
    }

    .plane-matcher-main-content {
        padding: 12px;
        overflow-x: hidden;
    }

    .plane-matcher-selections-box {
        padding: 12px;
    }

    .plane-matcher-recommendations {
        overflow-x: hidden;
    }

    .plane-matcher-recommendations h1 {
        font-size: 24px;
    }

    .plane-matcher-recommendations h2 {
        font-size: 20px;
    }

    /* Make table scrollable within container */
    .plane-matcher-recommendations table {
        font-size: 11px;
        display: block;
        width: 100%;
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .plane-matcher-recommendations thead,
    .plane-matcher-recommendations tbody {
        display: block;
        width: 100%;
    }

    .plane-matcher-recommendations tr {
        display: flex;
        width: 100%;
        min-width: max-content;
    }

    .plane-matcher-recommendations th,
    .plane-matcher-recommendations td {
        padding: 8px 4px;
        font-size: 11px;
        flex: 1;
        min-width: 60px;
        white-space: nowrap;
    }

    /* Reduce paragraph and list font sizes */
    .plane-matcher-recommendations p {
        font-size: 14px;
    }

    .plane-matcher-recommendations li {
        font-size: 14px;
        margin-bottom: 8px;
    }

    .plane-matcher-recommendations ul,
    .plane-matcher-recommendations ol {
        margin-left: 16px;
    }

    /* Reduce heading sizes further */
    .plane-matcher-recommendations h3 {
        font-size: 18px;
    }

    .plane-matcher-recommendations h4 {
        font-size: 16px;
    }

    /* Make container adapt better */
    .plane-matcher-container {
        margin: 10px;
        padding: 16px;
    }

    /* Fix selection labels on mobile */
    .selection-label {
        font-size: 10px;
        padding: 4px 8px;
    }

    .selection-value {
        font-size: 13px;
    }
}

/* Contact Form CTA */
.plane-matcher-cta {
    margin-top: 48px;
    padding: 32px;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    border-radius: 16px;
    color: #ffffff;
    box-shadow: 0 10px 40px rgba(37, 99, 235, 0.2);
}

.plane-matcher-cta-header {
    text-align: center;
    margin-bottom: 32px;
}

.plane-matcher-cta-header h3 {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 12px 0;
    color: #ffffff;
}

.plane-matcher-cta-header p {
    font-size: 16px;
    color: #e0e7ff;
    margin: 0;
    line-height: 1.6;
}

.plane-matcher-contact-form {
    max-width: 600px;
    margin: 0 auto;
}

.plane-matcher-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.plane-matcher-form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.plane-matcher-form-group label {
    font-size: 14px;
    font-weight: 600;
    color: #e0e7ff;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.plane-matcher-form-group input {
    padding: 14px 16px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    font-size: 16px;
    transition: all 0.3s ease;
}

.plane-matcher-form-group input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.plane-matcher-form-group input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.1);
}

.plane-matcher-cta-button {
    width: 100%;
    margin-top: 8px;
    padding: 16px 32px;
    background: #ffffff;
    color: #2563eb;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.plane-matcher-cta-button:hover {
    background: #f0f9ff;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.plane-matcher-cta-button:active {
    transform: translateY(0);
}

.plane-matcher-cta-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.plane-matcher-cta-button svg {
    flex-shrink: 0;
}

.plane-matcher-form-message {
    margin-top: 16px;
    padding: 12px 16px;
    border-radius: 8px;
    text-align: center;
    font-weight: 600;
    display: none;
}

.plane-matcher-form-message.success {
    display: block;
    background: rgba(16, 185, 129, 0.2);
    border: 2px solid #10b981;
    color: #ffffff;
}

.plane-matcher-form-message.error {
    display: block;
    background: rgba(239, 68, 68, 0.2);
    border: 2px solid #ef4444;
    color: #ffffff;
}

/* CTA Responsive */
@media (max-width: 768px) {
    .plane-matcher-cta {
        padding: 20px 12px;
        margin-top: 24px;
    }

    .plane-matcher-cta-header h3 {
        font-size: 24px;
    }

    .plane-matcher-form-row {
        grid-template-columns: 1fr;
    }

    .plane-matcher-cta-button {
        font-size: 16px;
        padding: 14px 24px;
    }
}

/* Extra small devices (phones in portrait, less than 480px) */
@media (max-width: 480px) {
    .plane-matcher-container {
        margin: 4px;
        padding: 8px;
        border-radius: 8px;
        max-width: calc(100vw - 8px);
        overflow-x: hidden;
    }

    .plane-matcher-main-content {
        padding: 10px;
        overflow-x: hidden;
    }

    .plane-matcher-selections-box {
        padding: 10px;
    }

    .plane-matcher-recommendations {
        overflow-x: hidden;
    }

    .plane-matcher-recommendations h1 {
        font-size: 20px;
        word-wrap: break-word;
    }

    .plane-matcher-recommendations h2 {
        font-size: 18px;
        word-wrap: break-word;
    }

    .plane-matcher-recommendations h3 {
        font-size: 16px;
        word-wrap: break-word;
    }

    .plane-matcher-recommendations h4 {
        font-size: 14px;
        word-wrap: break-word;
    }

    .plane-matcher-recommendations p,
    .plane-matcher-recommendations li {
        font-size: 13px;
        word-wrap: break-word;
    }

    /* Ultra compact table for very small screens */
    .plane-matcher-recommendations table {
        font-size: 10px;
        display: block;
        width: 100%;
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .plane-matcher-recommendations thead,
    .plane-matcher-recommendations tbody {
        display: block;
        width: 100%;
    }

    .plane-matcher-recommendations tr {
        display: flex;
        width: 100%;
        min-width: max-content;
    }

    .plane-matcher-recommendations th,
    .plane-matcher-recommendations td {
        padding: 6px 3px;
        font-size: 10px;
        flex: 1;
        min-width: 50px;
        white-space: nowrap;
    }

    .plane-matcher-cta {
        padding: 16px 8px;
        margin-top: 20px;
    }

    .plane-matcher-cta-header h3 {
        font-size: 20px;
    }

    .plane-matcher-cta-header p {
        font-size: 14px;
    }

    .selection-label {
        font-size: 9px;
        padding: 3px 6px;
    }

    .selection-value {
        font-size: 12px;
    }
}
