/**********************************************************
Form & Field Styles
Basic Build Form Formatting
 *********************************************************/
.form-section.active {
    display: block;
}

.build-form {
    max-width: 850px;
    margin: 1rem auto;
    padding: 1rem;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    box-sizing: border-box;
}

.build-form .form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.build-form .form-field {
    display: flex;
    flex-direction: column;
}

.build-form .form-span-2 {
    grid-column: span 1;
}

.build-form label {
    font-size: 0.95rem;
}

.build-form input[type="text"],
.build-form input[type="email"],
.build-form input[type="tel"] {
    padding: 0.6rem 0.7rem;
    border: 1px solid #cfd6e4;
    border-radius: 6px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}


/**********************************************************
General Form Styles
Build form, labels, sub forms, et.
 *********************************************************/
.form-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
}

.form-question {
    flex: 1;
    margin-right: 20px;
}

.form-section > legend {
    font-size: 1.25rem;
    font-weight: bold;
    margin-bottom: 10px;
}

.form-section {
    display: none;
    border: none;
    background: none;
    padding: 0;
    margin: 0;
}

.form-row input,
.form-row select {
    flex: 1;
}


/**********************************************************
Form Buttons
Next, Back, Clear, Submit, et.
 *********************************************************/
.build-form button {
    appearance: none;
    border: none;
    padding: 0.6rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.2s, transform 0.1s;
    background: #1f2937;
    color: #fff;
}

.form-buttons {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    gap: 10px;
}

.build-form button.submitBtn {
    background: #28a745;
    border: none;
    color: white;
    font-weight: bold;
    padding: 12px 28px;
    border-radius: 20px;
    transition: background 0.2s, transform 0.1s;
}

.build-form button.reset-card-btn {
    background: transparent;
    border: none;
    color: #e63946;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    padding: 2px 4px;
    line-height: 1;
    transition: color 0.2s ease;
}

.build-form button.features-card-btn {
    background: transparent;
    border: 2px solid #457b9d;
    color: #457b9d;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: all 0.2s ease;
}

.build-form button.toggle-view-btn {
    appearance: none;
    background: transparent;
    border: none;
    color: #394c60;
    font-size: 20px;
    padding: 4px;
    width: 26px;
    height: 26px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    cursor: pointer;
    box-sizing: border-box;
}

#shelf-package-btn,
#shelf-package-btn-pup {
    background-color: #394c60;
}


/**********************************************************
Behaviours
Button/Input, Sliders, toggle groups, et.
 *********************************************************/
.build-form input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.submitBtn:hover {
    transform: scale(1.02);
}

.nextBtn:hover {
    transform: scale(1.02);
}

.backBtn:hover {
    transform: scale(1.02);
}

.build-form button.reset-card-btn:hover {
    color: #b71c1c;
}

.build-form button.features-card-btn:hover {
    background-color: #457b9d;
    color: #fff;
}

#shelf-package-btn:hover,
#shelf-package-btn-pup:hover {
    transform: scale(1.02);
}

.slider:hover {
    background: #aab3c5;
    transform: scale(1.05);
}


/**********************************************************
Toggle Group Styles
Disable defaults, label formatting, background colours
 *********************************************************/
/* Hide default radio and checkboxes */
.toggle-group input[type="radio"],
.toggle-group input[type="checkbox"] {
    display: none;
}

.toggle-group {
    display: flex;
    gap: 10px;
}

.toggle-group label {
    padding: 6px 14px;
    border: 1px solid #ccc;
    border-radius: 6px;
    cursor: pointer;
    background: #f9f9f9;
    transition: all 0.2s ease;
    user-select: none;
}

.toggle-group input[type="radio"]:checked + label,
.toggle-group input[type="checkbox"]:checked + label {
    background-color: #394c60;
    color: #fff;
}

/* Dropdown Options Style */
.dropdown-toggle {
    padding: 6px 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    background-size: 16px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}


/**********************************************************
Inline Preview Card Styles
Each preview card represents a section (heading) of form
 *********************************************************/
.preview-card {
    border: 1px solid #cfd6e4;
    border-radius: 20px;
    padding: 15px;
    margin-bottom: 20px;
    background: #f9f9f9;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    grid-column: span 2;
}

.preview-card img {
    border-radius: 8px;
}

.preview-card-title {
    flex: 1;
    text-align: center;
    color: #394c60;
}

.preview-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
    margin: 0;
    font-size: 1.40rem;
    padding: 10px 0;
}

.preview-card-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}


/**********************************************************
Table Styles
Pros & cons, flat bed specs, future preview card tables
 *********************************************************/
#flatbed-specs-table {
    width: 100%;
    border-collapse: collapse;
    margin:15px 0;
    display: none;
    background-color: #ffffff;
    border: 1px solid #cfd6e4;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

#flatbed-specs-table th,
#flatbed-specs-table td {
    padding: 8px 8px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
    font-size: 0.95rem;
}

#flatbed-specs-table th {
    background-color: #e2e7ed;
    font-weight: bold;
    text-align: center;
}

/* B-Train Table Styles */
.btrain-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 15px 0;
    background-color: #ffffff;
    border: 1px solid #cfd6e4;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.btrain-table td select {
    display: block;
    margin: 0 auto;
    padding: 4px 8px;
    font-size: 0.95rem;
    vertical-align: middle;
}

.btrain-table th,
.btrain-table td {
    padding: 8px 20px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
    font-size: 0.95rem;
}

.btrain-table th {
    background-color: #e2e7ed;
    font-weight: bold;
    text-align: center;
}

.btrain-table td input[type="radio"] {
    display: block;
    margin: 0 auto;
    cursor: pointer;
}

.btrain-table tbody tr:hover {
    background-color: #f5f5f5;
}

.btrain-table caption {
    caption-side: top;
    text-align: left;
    font-size: 1rem;
    margin-bottom: 8px;
}

.btrain-table .toggle-group.table-toggle {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.btrain-table .toggle-group.table-toggle label {
    padding: 4px 10px;
    font-size: 0.9rem;
}

.btrain-table .table-toggle input[type="radio"] {
    display: none;
}

.btrain-table input[type="radio"] {
    appearance: none;
    width: 20px;
    height: 20px;
    border: 1px solid #444;
    border-radius: 4px;
    cursor: pointer;
    display: inline-block;
    vertical-align: middle;
    background-color: #fff;
    transition: all 0.2s ease;
}

.btrain-table input[type="radio"]:checked {
    background-color: #394c60;
}


/**********************************************************
Containers, Image Previews & Diagrams
For images displayed within inline CSS preview cards
 *********************************************************/
#flatbed-preview-container {
    position: relative;
    width:100%;
    max-width:400px;
    margin: 20px auto;
}

#product-options-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

#tarp-options, #flatbed-options {
    flex: 1 1 300px;
    padding: 10px;
    border-radius: 6px;
    box-sizing: border-box;
}

#flatbed-diagram {
    width: 100%;
    display: block;
}


/**********************************************************
Sub Menu Styles
For "Yes" selected options under certain customizations
 *********************************************************/
.form-submenu {
    margin-top: 10px;
    margin-bottom: 10px;
    padding: 10px 0 10px 15px;
    border-left: 4px solid #ccc;
    background-color: #f9f9f9;
    border-radius: 6px;
}

.form-submenu .form-question {
    font-weight: 500;
    font-size: 0.95rem;
    color: #333;
}

.form-submenu select {
    width: 50%;
    padding: 5px 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background-color: #fff;
    font-size: 0.9rem;
}

.form-submenu .submenu-intro {
    margin: 0 0 8px 0;
    font-size: 0.9rem;
    color: #555;
    font-style: italic;
}


/**********************************************************
CSS Animations & Geometry
For further interactivity between toggle and img preview
 *********************************************************/
@keyframes pulse {
    0%   { transform: translateX(-50%) scale(1); opacity: 1; }
    50%  { transform: translateX(-50%) scale(1.3); opacity: 0.6; }
    100% { transform: translateX(-50%) scale(1); opacity: 1; }
}

/* Highlight Circle Styles */
.highlight-circle {
    position: absolute;
    width: 30px;
    height: 30px;
    border: 3px solid red;
    border-radius: 50%;
    display: none;
    pointer-events: none;
    top: 60px;
    left: 80%;
    transform: translateX(-50%);
    animation: pulse 2.0s infinite;
}


/**********************************************************
Misc.
Dividers, sliders, unit formatting, line breaks, et.
 *********************************************************/
/* Text Area Style for Build Form */
.build-form textarea {
    padding: 0.6rem 0.7rem;
    margin-bottom: 2rem;
    border: 1px solid #cfd6e4;
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    width: 100%;
    box-sizing: border-box;
    resize: none;
}

.divider-row {
    display: flex;
    align-items: center;
    margin: 1.5rem 0 1rem;
}

.divider-label {
    font-weight: bold;
    font-style: italic;
    margin-right: 0.75rem;
    white-space: nowrap;
    color: #333;
}

.divider-line {
    flex-grow: 1;
    border: none;
    border-top: 2px solid #ccc;
}

.slider {
    appearance: none;
    width: 50%;
    height: 6px;
    margin-right: 20px;
    border-radius: 5px;
    background: #cfd6e4;
    outline: none;
    transition: background 0.2s;
}

.unit-group {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    flex: 1;
}

.unit-group input[type="text"] {
    width: 100%;
}

.badge {
    display: inline-block;
    padding: 2px 8px;
    margin-right: 5px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #fff;
    line-height: 1.2;
    vertical-align: middle;
}

.badge-standard {
    background-color: #f59e0b;
}

.badge-new {
    background-color: #10b981;
}

.features-popup {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.features-popup.active {
    opacity: 1;
    pointer-events: auto;
}

.features-popup-content {
    background: #fff;
    padding: 1.5rem;
    border-radius: 30px;
    max-width: 900px;
    width: 50%;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    transform: translateY(-20px);
    transition: transform 0.3s ease;
}

.features-popup.active .features-popup-content {
    transform: translateY(0);
}

.features-popup-close {
    background: transparent;
    border: none;
    font-size: 20px;
    cursor: pointer;
    float: right;
}


/**********************************************************
Media Queries for Different Screen Sizes
Needs to be implemented further once form demo is complete
 *********************************************************/
/* Desktop & larger screens */
@media (min-width: 900px) {
    .build-form .form-grid {
        grid-template-columns: 1fr;
        align-items: start;
    }

    .preview-card {
        grid-column: auto;
    }

    .form-section,
    .form-row,
    .form-field {
        grid-column: auto;
    }

    .contact-info .form-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .contact-info .form-span-2 {
        grid-column: span 2;
    }

}