/* Improved 5-Step Quote Builder CSS */

.ssci-quote-builder-5step {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 20px;
    background: #f8f7f5;
    border-radius: 12px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* ==================== PROGRESS BAR ==================== */
.progress-container {
    margin-bottom: 40px;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: #e0e0e0;
    border-radius: 10px;
    margin-bottom: 20px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--dt-pri-color) 0%, #C17456 100%);
    border-radius: 10px;
    transition: width 0.5s ease;
}

.progress-steps {
    display: flex;
    justify-content: space-between;
    gap: 15px;
}

.progress-step {
    flex: 1;
    text-align: center;
    opacity: 0.5;
    transition: all 0.3s ease;
}

.progress-step.active {
    opacity: 1;
}

.progress-step.active .step-number {
    background: var(--dt-pri-color);
    color: white;
    box-shadow: 0 4px 12px rgba(160, 82, 61, 0.3);
}

.step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: #f0f0f0;
    border: 2px solid #ddd;
    border-radius: 50%;
    font-weight: bold;
    color: #666;
    margin-bottom: 8px;
    transition: all 0.3s ease;
}

.step-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.progress-step.active .step-label {
    color: var(--dt-pri-color);
}

.progress-step::after {
    display: none !important;
}

/* ==================== FORM MESSAGES ==================== */
#form-message {
    display: none;
    padding: 15px 20px;
    margin-bottom: 20px;
    border-radius: 8px;
    font-weight: 500;
    animation: slideDown 0.3s ease;
}

#form-message.error {
    background: #fee;
    color: #c33;
    border-left: 4px solid #c33;
}

#form-message.success {
    background: #efe;
    color: #3c3;
    border-left: 4px solid #3c3;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==================== FORM STEPS ==================== */
.form-step {
    display: none;
    opacity: 0;
    animation: fadeIn 0.3s ease;
}

.form-step {
    display: block;
    opacity: 1;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.step-header {
    text-align: center;
    margin-bottom: 40px;
}

.step-header h2 {
    font-size: 28px;
    color: #333;
    margin: 0 0 10px 0;
    font-weight: 600;
}

.step-header p {
    color: #888;
    font-size: 16px;
    margin: 0;
}

/* ==================== CATEGORIES GRID ==================== */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.category-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: white;
    border: 2px solid #ddd;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    min-height: 140px;
}

.category-card:hover {
    border-color: var(--dt-pri-color);
    box-shadow: 0 4px 15px rgba(160, 82, 61, 0.15);
    transform: translateY(-2px);
}

.category-card.selected {
    background: var(--dt-pri-light);
    border-color: var(--dt-pri-color);
    box-shadow: 0 4px 15px rgba(160, 82, 61, 0.25);
}

.category-card input {
    display: none;
}

.card-icon {
    font-size: 40px;
    margin-bottom: 10px;
}

.card-icon.large {
    font-size: 50px;
}

.card-name {
    font-weight: 600;
    color: #333;
    text-align: center;
    font-size: 14px;
    margin-bottom: 5px;
}

.card-count {
    font-size: 12px;
    color: #999;
}

/* ==================== SERVICES GRID ==================== */
.services-search {
    margin-bottom: 25px;
}

.search-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--dt-pri-color);
    box-shadow: 0 0 0 3px rgba(160, 82, 61, 0.1);
    color: #333;
}

.services-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: 30px;
}

.services-group {
    margin-bottom: 35px;
    background: linear-gradient(280deg, #fe581769, #ffffff87);
    border-radius: 6px;
    padding: 0px 6px 7px;
}

.services-group-header {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 16px 20px;
    background: var(--dt-pri-light);
    border-left: 5px solid var(--dt-pri-color);
    margin-bottom: 18px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
}

.services-group-header:hover {
    background: rgba(160, 82, 61, 0.12);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.group-icon {
    font-size: 24px;
    min-width: 30px;
    flex-shrink: 0;
}

.group-title {
    font-weight: 700;
    color: #1a1a1a;
    font-size: 16px;
    flex: 1;
}

.group-count {
    color: #666;
    font-weight: 600;
    margin: 0 10px 0 0;
}

.group-toggle {
    color: var(--dt-pri-color);
    font-weight: bold;
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.services-group-header.collapsed .group-toggle {
    transform: rotate(-90deg);
}

.services-group-content {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
    padding: 0;
}

.service-card {
    background: white;
    border: 2px solid #ddd;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    cursor: pointer;
}

.service-card:hover {
    border-color: var(--dt-pri-color);
    box-shadow: 0 8px 20px rgba(160, 82, 61, 0.15);
    transform: translateY(-4px);
}

.service-card.selected {
    border-color: var(--dt-pri-color);
    background: var(--dt-pri-light);
    box-shadow: 0 8px 20px rgba(160, 82, 61, 0.25);
}

.card-image {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-content {
    padding: 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.card-title {
    font-size: 16px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 6px 0;
    line-height: 1.4;
}

.card-code {
    font-size: 12px;
    color: var(--dt-pri-color);
    font-weight: 600;
    margin-bottom: 8px;
}

.card-description {
    font-size: 13px;
    color: #444;
    margin: 0 0 12px 0;
    flex: 1;
    line-height: 1.5;
}

.card-price {
    font-size: 18px;
    font-weight: 700;
    color: var(--dt-pri-color);
}

.card-actions {
    display: flex;
    gap: 8px;
    padding-top: 12px;
    border-top: 1px solid #eee;
}

.checkbox-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.checkbox-wrapper input {
    display: none;
}

.checkbox-custom {
    width: 24px;
    height: 24px;
    border: 2px solid #ddd;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: bold;
    color: white;
}

.checkbox-wrapper input:checked + .checkbox-custom {
    background: var(--dt-pri-color);
    border-color: var(--dt-pri-color);
}

.checkbox-wrapper input:checked + .checkbox-custom::before {
    content: '✓';
}

.product-details-btn {
    flex: 1;
    padding: 8px 12px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    color: #666;
    transition: all 0.3s ease;
}

.product-details-btn:hover {
    background: var(--dt-pri-color);
    color: white;
    border-color: var(--dt-pri-color);
}

/* ==================== ADD-ONS SECTION ==================== */
.section-box {
    background: white;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    border: 1px solid #eee;
}

.section-box h3 {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 20px 0;
    color: #333;
}

.section-box h3 i {
    color: var(--dt-pri-color);
    margin-right: 8px;
}

.addons-grouped {
    display: grid;
    gap: 20px;
}

.addon-group {
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 15px;
    background: #f9f9f9;
}

.addon-group h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--dt-pri-color);
    margin: 0 0 15px 0;
}

.addon-card {
    display: flex;
    flex-direction: column;
    padding: 12px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

.addon-card:last-child {
    margin-bottom: 0;
}

.addon-card.selected {
    background: #f5e6e1;
    border-color: var(--dt-pri-color);
}

.addon-checkbox-row {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.addon-checkbox-row input {
    display: none;
}

.addon-checkbox-row input + .checkbox-custom {
    flex-shrink: 0;
}

.addon-name {
    flex: 1;
    font-weight: 600;
    color: #333;
}

.addon-price {
    font-weight: 700;
    color: var(--dt-pri-color);
}

.addon-controls {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #eee;
}

.addon-controls label {
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.addon-controls input {
    width: 60px;
    padding: 6px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 12px;
}

/* ==================== QUANTITY DISPLAY ==================== */
.services-quantity-list {
    display: grid;
    gap: 12px;
}

.quantity-item {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 15px;
    align-items: center;
    padding: 12px;
    background: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 8px;
}

.service-name {
    font-weight: 600;
    color: #333;
}

.quantity-control {
    display: flex;
    gap: 8px;
    align-items: center;
}

.quantity-control label {
    font-weight: 600;
    font-size: 12px;
}

.quantity-control input {
    width: 60px;
    padding: 6px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* ==================== FORM INPUTS ==================== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--dt-pri-color);
    box-shadow: 0 0 0 3px rgba(160, 82, 61, 0.1);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 600px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

/* ==================== RISK SLIDER ==================== */
.risk-section {
    background: linear-gradient(135deg, rgba(160, 82, 61, 0.05), rgba(160, 82, 61, 0.02));
    padding: 25px;
    border-radius: 10px;
    margin-top: 20px;
}

.risk-section h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 8px 0;
    color: #333;
}

.risk-description {
    font-size: 13px;
    color: #888;
    margin: 0 0 20px 0;
}

.risk-slider-container {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.risk-label {
    font-size: 12px;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    min-width: 50px;
    text-align: center;
}

.risk-slider {
    flex: 1;
    height: 8px;
    border-radius: 5px;
    background: linear-gradient(90deg, #4CAF50 0%, #FFC107 50%, #F44336 100%);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.risk-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: white;
    border: 3px solid var(--dt-pri-color);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.risk-slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: white;
    border: 3px solid var(--dt-pri-color);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.risk-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.risk-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--dt-pri-color);
}

.risk-text {
    font-size: 16px;
    font-weight: 600;
    color: #666;
}

.risk-multiplier {
    font-size: 14px;
    color: #666;
}

/* ==================== REVIEW/QUOTE TABLE ==================== */
.quote-section {
    background: white;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    border: 1px solid #eee;
}

.quote-section h3 {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin: 0 0 15px 0;
}

.quote-section h3 i {
    color: var(--dt-pri-color);
    margin-right: 8px;
}

.quote-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.quote-table tr {
    border-bottom: 1px solid #eee;
}

.quote-table tr:last-child {
    border-bottom: none;
}

.quote-table td {
    padding: 10px;
}

.quote-table .label {
    font-weight: 600;
    color: #666;
    width: 40%;
}

.quote-table .value {
    color: #333;
}

.quote-table .price {
    font-weight: 600;
    color: var(--dt-pri-color);
    text-align: right;
}

.quote-table thead {
    background: #f9f9f9;
    font-weight: 600;
    color: #333;
}

.quote-table th {
    padding: 10px;
    text-align: left;
    border-bottom: 2px solid #ddd;
}

.quote-table .text-right {
    text-align: right;
}

.quote-table .text-center {
    text-align: center;
}

.price-summary {
    background: linear-gradient(135deg, rgba(160, 82, 61, 0.08), rgba(160, 82, 61, 0.03)) !important;
    border-color: var(--dt-pri-color) !important;
}

.total-row {
    background: #f5e6e1;
    font-weight: 700;
    font-size: 16px;
}

.total-row .price {
    font-size: 18px;
    color: var(--dt-pri-color);
}

/* ==================== SUCCESS BOX ==================== */
.success-box {
    text-align: center;
    padding: 40px;
    background: white;
    border-radius: 12px;
    border: 2px solid #4CAF50;
}

.success-box i {
    font-size: 64px;
    color: #4CAF50;
    margin-bottom: 15px;
}

.success-box h2 {
    color: #333;
    margin: 15px 0 10px 0;
}

.success-box p {
    color: #666;
    margin: 0 0 30px 0;
}

.success-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.success-actions .btn {
    padding: 10px 18px;
    font-size: 13px;
}

/* ==================== BUTTONS ==================== */
.step-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    justify-content: center;
}

.btn {
    padding: 12px 32px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-secondary {
    background: #f0f0f0;
    color: #666;
    border: 2px solid #ddd;
}

.btn-secondary:hover:not(:disabled) {
    background: #e8e8e8;
    border-color: #ccc;
}

.btn-primary {
    background: var(--dt-pri-color);
    color: white;
    border: 2px solid var(--dt-pri-color);
}

.btn-primary:hover:not(:disabled) {
    background: var(--dt-pri-hover);
    box-shadow: 0 4px 12px rgba(160, 82, 61, 0.3);
    transform: translateY(-2px);
}

.btn-success {
    background: #4CAF50;
    color: white;
    border: 2px solid #4CAF50;
}

.btn-success:hover:not(:disabled) {
    background: #45a049;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
    transform: translateY(-2px);
}

.btn-info {
    background: #2196F3;
    color: white;
    border: 2px solid #2196F3;
}

.btn-info:hover:not(:disabled) {
    background: #0b7dda;
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.3);
}

/* ==================== MODAL ==================== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 12px;
    max-width: 600px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    color: #999;
    cursor: pointer;
    z-index: 10;
    transition: color 0.3s ease;
}

.modal-close:hover {
    color: var(--dt-pri-color);
}

.modal-body {
    padding: 30px;
}

.modal-image {
    width: 100%;
    margin-bottom: 20px;
}

.modal-image-container {
    width: 100%;
    height: 250px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.modal-info h2 {
    font-size: 24px;
    font-weight: 700;
    color: #333;
    margin: 0 0 10px 0;
}

/* ==================== EMAIL MODAL ==================== */
#email-modal .modal-body h2 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 20px;
}

#email-modal .form-group label {
    font-weight: 600;
    margin-bottom: 5px;
    display: block;
}

#email-modal .form-group input,
#email-modal .form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: inherit;
    margin-bottom: 15px;
}

#email-modal .form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.modal-actions .btn {
    flex-shrink: 0;
}

.modal-code {
    font-size: 12px;
    color: var(--dt-pri-color);
    font-weight: 600;
    margin-bottom: 15px;
    text-transform: uppercase;
}

.modal-price {
    font-size: 18px;
    font-weight: 700;
    color: var(--dt-pri-color);
    margin-bottom: 20px;
}

.modal-price .label {
    color: #666;
    font-weight: 600;
    margin-right: 8px;
}

.modal-description {
    margin-bottom: 20px;
    font-size: 14px;
    color: #666;
    line-height: 1.6;
}

.modal-description h4 {
    color: #333;
    font-weight: 600;
    margin: 15px 0 8px 0;
    font-size: 14px;
}

.modal-details {
    background: #f8f7f5;
    padding: 15px;
    border-radius: 8px;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 13px;
    color: #666;
}

/* ==================== UTILITIES ==================== */
.loading {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

.loading i {
    margin-right: 8px;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #999;
    font-size: 14px;
}

.empty-state i {
    margin-right: 8px;
    font-size: 24px;
}

.error {
    color: #c33;
    background: #fee;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #c33;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
    .ssci-quote-builder-5step {
        padding: 20px 15px;
    }

    .progress-steps {
        gap: 10px;
    }

    .step-number {
        width: 36px;
        height: 36px;
        font-size: 12px;
    }

    .categories-grid {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: 10px;
    }

    .services-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 15px;
    }

    .step-actions {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    .quote-table {
        font-size: 12px;
    }

    .quote-table td {
        padding: 8px;
    }

    .quantity-item {
        grid-template-columns: 1fr;
    }

    .success-actions {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .services-grid {
        grid-template-columns: 1fr;
    }

    .step-header h2 {
        font-size: 22px;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .btn-primary {
        background: var(--dt-pri-color) !important;
        color: white !important;
        border: var(--dt-pri-color) !important;
    }

    .btn-primary:hover:not(:disabled) {
        background: var(--dt-pri-hover) !important;
        color: white !important;
        border: var(--dt-pri-hover) !important;
    }
}
