/* ============================================
   CableBuilder - Save Configuration Modal Styles
   Version 2.2.1 - Deduplicated & Cleaned
   ============================================ */

/* Modal Container */
.cablebuilder-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100000;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.cablebuilder-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(3px);
    animation: fadeIn 0.3s ease-out;
}

.cablebuilder-modal-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 16px;
    width: 90%;
    max-width: 520px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(0, 0, 0, 0.05);
    animation: modalSlideIn 0.3s ease-out;
    overflow: hidden;
}

@keyframes modalSlideIn {
    from {
        transform: translate(-50%, -60%);
        opacity: 0;
    }
    to {
        transform: translate(-50%, -50%);
        opacity: 1;
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Modal Header */
.cablebuilder-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.cablebuilder-modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.cablebuilder-modal-header h3::before {
    content: "💾";
    font-size: 22px;
}

.cablebuilder-modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: white;
    padding: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.cablebuilder-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

/* Modal Body */
.cablebuilder-modal-body {
    padding: 24px;
    max-height: 60vh;
    overflow-y: auto;
}

/* Form Groups */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
    font-size: 14px;
}

.form-group label .required {
    color: #e74c3c;
    margin-left: 4px;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e8ed;
    border-radius: 10px;
    font-size: 14px;
    transition: all 0.2s ease;
    background: white;
    font-family: inherit;
    box-sizing: border-box;
}

.form-control:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-control::placeholder {
    color: #bdc3c7;
}

.form-text {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: #7f8c8d;
}

/* Checkbox Styling */
.form-group label input[type="checkbox"] {
    width: auto;
    margin-right: 8px;
    vertical-align: middle;
    cursor: pointer;
}

.form-group label:has(input[type="checkbox"]) {
    display: flex;
    align-items: center;
    cursor: pointer;
}

/* Modal Footer */
.cablebuilder-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 20px 24px;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease;
    font-family: inherit;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: #e9ecef;
    color: #495057;
}

.btn-secondary:hover {
    background: #dee2e6;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* ============================================
   Load Configuration Menu Styles
   ============================================ */

.load-config-menu {
    position: absolute;
    bottom: 100%;
    right: 0;
    background: white;
    min-width: 380px;
    max-height: 500px;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    z-index: 1000;
    margin-bottom: 10px;
    animation: menuSlideUp 0.2s ease-out;
}

@keyframes menuSlideUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Menu Header */
.load-menu-header {
    padding: 16px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px 12px 0 0;
    position: sticky;
    top: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    z-index: 10;
}

.load-menu-header strong {
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.load-menu-header strong::before {
    content: "📁";
    font-size: 18px;
}

#refreshConfigsBtn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    cursor: pointer;
    font-size: 18px;
    padding: 6px 10px;
    border-radius: 8px;
    transition: all 0.2s ease;
    color: white;
}

#refreshConfigsBtn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(180deg);
}

/* Project Sections */
.project-section {
    margin-bottom: 0;
    border-bottom: 1px solid #e9ecef;
}

.project-section:last-child {
    border-bottom: none;
}

.project-header {
    padding: 14px 20px;
    background: #f8f9fa;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    transition: background 0.2s ease;
    border-left: 4px solid #667eea;
}

.project-header:hover {
    background: #e9ecef;
}

.project-name {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: #2c3e50;
}

.project-toggle-icon,
.dept-toggle-icon {
    font-size: 12px;
    color: #667eea;
    transition: transform 0.2s ease;
}

.project-count {
    background: #e9ecef;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 11px;
    color: #6c757d;
    font-weight: normal;
}

/* Department Sections */
.department-section {
    border-top: 1px solid #f1f3f5;
}

.department-header {
    padding: 10px 20px 10px 40px;
    background: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
    color: #495057;
    border-left: 2px solid #ced4da;
    transition: background 0.2s ease;
}

.department-header:hover {
    background: #f8f9fa;
}

.department-header::before {
    content: "📂";
    font-size: 14px;
}

.department-configs {
    display: block;
}

/* Config List Items */
.config-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px 12px 60px;
    border-top: 1px solid #f1f3f5;
    transition: all 0.2s ease;
    cursor: pointer;
}

.config-list-item:hover {
    background: #f8f9fa;
    padding-left: 65px;
}

.config-item-content {
    flex: 1;
}

.config-item-name {
    font-weight: 600;
    margin-bottom: 6px;
    color: #2c3e50;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.config-item-name .default-badge {
    background: #28a745;
    color: white;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: normal;
}

.config-item-meta {
    font-size: 11px;
    color: #adb5bd;
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.config-date,
.config-updated {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.config-item-actions {
    display: flex;
    gap: 8px;
}

.config-load-btn,
.config-delete-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s ease;
    font-family: inherit;
}

.config-load-btn {
    background: #667eea;
    color: white;
}

.config-load-btn:hover {
    background: #5a67d8;
    transform: scale(1.02);
}

.config-delete-btn {
    background: #e74c3c;
    color: white;
}

.config-delete-btn:hover {
    background: #c0392b;
    transform: scale(1.02);
}

/* No Configs Message */
#noConfigsMsg {
    text-align: center;
    padding: 40px 20px;
    color: #adb5bd;
    font-size: 14px;
}

#noConfigsMsg::before {
    content: "📭";
    display: block;
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.5;
}

/* Loading State */
.config-loading {
    text-align: center;
    padding: 40px;
    color: #667eea;
}

.config-loading::after {
    content: "";
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #e9ecef;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-left: 8px;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Scrollbar Styling */
.load-config-menu::-webkit-scrollbar,
.cablebuilder-modal-body::-webkit-scrollbar {
    width: 6px;
}

.load-config-menu::-webkit-scrollbar-track,
.cablebuilder-modal-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.load-config-menu::-webkit-scrollbar-thumb,
.cablebuilder-modal-body::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 3px;
}

.load-config-menu::-webkit-scrollbar-thumb:hover,
.cablebuilder-modal-body::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .cablebuilder-modal-container {
        width: 95%;
        max-width: 95%;
        border-radius: 12px;
    }
    
    .cablebuilder-modal-header {
        padding: 16px 20px;
    }
    
    .cablebuilder-modal-body {
        padding: 20px;
    }
    
    .cablebuilder-modal-footer {
        padding: 16px 20px;
    }
    
    .load-config-menu {
        min-width: 320px;
        right: -10px;
    }
    
    .config-list-item {
        padding: 10px 15px 10px 50px;
        flex-wrap: wrap;
    }
    
    .config-item-actions {
        margin-top: 8px;
        width: 100%;
        justify-content: flex-end;
    }
    
    .config-load-btn,
    .config-delete-btn {
        padding: 4px 10px;
    }
    
    .department-header {
        padding: 8px 15px 8px 35px;
    }
}

/* Cable Builder Menu Item - PrestaShop 9 */
.cablebuilder-nav-item {
    position: relative;
    margin: 0 5px;
}

.cablebuilder-nav-link {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    border-radius: 40px;
    background: linear-gradient(135deg, #667eea, #1a96d2);
    color: white !important;
    transition: all 0.3s ease;
    text-decoration: none;
    font-weight: 500;
}

.cablebuilder-nav-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    color: white !important;
}

/* Mobile responsive for nav link */
@media (max-width: 768px) {
    .cablebuilder-nav-link {
        padding: 6px 12px;
        font-size: 13px;
    }
    
    .cablebuilder-nav-link svg {
        width: 16px;
        height: 16px;
    }
}

/* ============================================
   CABLE BUILDER PAGE STYLES (Consolidated)
   Brand Color: #1a96d2 (Wassalat Blue)
   ============================================ */

/* HERO SECTION */
.builder-hero {
    background: linear-gradient(135deg, rgba(26, 150, 210, 0.05) 0%, rgba(26, 150, 210, 0.08) 100%);
    padding: 40px 20px;
    border-radius: 20px;
}

.builder-hero .hero-icon svg path,
.builder-hero .hero-icon svg circle {
    stroke: #1a96d2;
}

.hero-features .feature {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    padding: 6px 14px;
    background: white;
    border-radius: 30px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(26, 150, 210, 0.2);
}

.hero-features .feature .material-icons {
    font-size: 16px;
    color: #1a96d2;
}

/* FAQ SECTION */
.faq-item {
    transition: transform 0.2s, box-shadow 0.2s;
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.faq-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.faq-item .material-icons {
    vertical-align: middle;
    color: #1a96d2;
}

/* CABLE TYPE CARDS */
.cable-type-card {
    transition: transform 0.2s, box-shadow 0.2s;
    background: white;
    cursor: pointer;
    text-decoration: none;
    display: block;
}

.cable-type-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.cable-type-card .material-icons {
    color: #1a96d2;
}

/* CONNECTOR BADGES */
.connector-badge {
    display: inline-block;
    background: #f8f9fa;
    padding: 6px 14px;
    border-radius: 30px;
    font-size: 12px;
    border: 1px solid #e9ecef;
    transition: all 0.2s;
    color: #333;
}

.connector-badge:hover {
    background: #1a96d2;
    border-color: #1a96d2;
    color: white;
}

/* LAUNCH TOOL BUTTON */
.launch-tool-btn {
    animation: pulse 2s infinite;
    box-shadow: 0 4px 15px rgba(26, 150, 210, 0.3);
    background-color: #1a96d2;
    border-color: #1a96d2;
}

.launch-tool-btn:hover {
    background-color: #147bb3;
    border-color: #147bb3;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 4px 15px rgba(26, 150, 210, 0.3);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 6px 20px rgba(26, 150, 210, 0.4);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 4px 15px rgba(26, 150, 210, 0.3);
    }
}

/* PRICE EXAMPLES TABLE */
.price-examples table {
    font-size: 13px;
}

.price-examples th,
.price-examples td {
    padding: 8px 12px;
    vertical-align: middle;
}

.price-examples .table-light {
    background-color: rgba(26, 150, 210, 0.1);
}

/* SHARE BUTTONS */
.share-buttons .btn {
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s ease;
}

.share-buttons .btn:hover {
    background-color: #1a96d2;
    border-color: #1a96d2;
    color: white;
}

.share-buttons .material-icons {
    font-size: 16px;
}

        .builder-trust {
            margin-top: 5rem;
            padding-top: 3rem;
            text-align: center;
            border-top: 1px solid var(--gray-200);
        }

        .trust-badges {
            display: flex;
            justify-content: center;
            align-items: center;
            gap: 2rem;
            flex-wrap: wrap;
            flex-direction: row;
        }
        
        .trust-badges .text-center {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 0.5rem;
        }
        
        .trust-badges .material-icons {
            font-size: 2rem;
        }
        
        .trust-badges .small {
            font-size: 0.7rem;
        }

        /* Same as share-buttons horizontal style */
        .share-buttons {
            display: flex;
            justify-content: center;
            gap: 0.75rem;
            flex-wrap: wrap;
            flex-direction: row;
        }
        
        .share-buttons .btn {
            display: inline-flex;
            align-items: center;
            gap: 0.5rem;
        }

/* CABLE BUILDER CONTAINER OVERRIDES */
.cable-builder-page-container .btn-primary {
    background-color: #1a96d2;
    border-color: #1a96d2;
}

.cable-builder-page-container .btn-primary:hover {
    background-color: #147bb3;
    border-color: #147bb3;
}

.cable-builder-page-container .btn-outline-primary {
    border-color: #1a96d2;
    color: #1a96d2;
}

.cable-builder-page-container .btn-outline-primary:hover {
    background-color: #1a96d2;
    border-color: #1a96d2;
    color: white;
}

.cable-builder-page-container .text-primary {
    color: #1a96d2 !important;
}

.cable-builder-page-container .bg-primary {
    background-color: #1a96d2 !important;
}

.cable-builder-page-container .border-primary {
    border-color: #1a96d2 !important;
}

/* PROGRESS STEPS */
.builder-steps .step .step-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: white;
    border: 2px solid #dee2e6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    transition: all 0.3s ease;
}

.builder-steps .step.active .step-circle {
    background: #1a96d2;
    border-color: #1a96d2;
    color: white;
}

.builder-steps .step.completed .step-circle {
    background: #28a745;
    border-color: #28a745;
    color: white;
}

/* MODAL STYLES (for component selection) */
.modal-option-card {
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.modal-option-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border-color: #1a96d2;
}

/* CONFIGURATION PANEL STYLES */
.config-buttons-row {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.config-buttons-row .btn-primary {
    flex: 1;
    background-color: #1a96d2;
    border-color: #1a96d2;
}

.config-labels-row {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.config-labels-row .form-control {
    flex: 1;
}

.config-length-qty-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.length-group {
    flex: 2;
}

.quantity-group {
    flex: 1;
}

.length-inputs {
    display: flex;
    gap: 10px;
}

.config-notes-row {
    margin-bottom: 15px;
}

/* REVIEW SECTION STYLES */
.review-visualization {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    flex-wrap: wrap;
}

.review-card {
    flex: 1;
    text-align: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 12px;
    transition: transform 0.2s;
}

.review-card:hover {
    transform: translateY(-2px);
}

.review-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 10px;
}

/* Badge styles for A/B connectors */
.badge-a {
    background-color: #1a96d2;
}

.badge-b {
    background-color: #e74c3c;
}

.badge-c {
    background-color: #6c757d;
}

.connector-badge {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: white;
}

.review-image img {
    max-height: 80px;
    width: auto;
    margin-bottom: 10px;
}

/* ============================================
   CART CONFIGURATION PANEL STYLES (Deduplicated)
   ============================================ */
.cablebuilder-cart-config-panel {
    margin: 15px 0;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    overflow: hidden;
    background: white;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: linear-gradient(135deg, rgba(26, 150, 210, 0.05) 0%, rgba(26, 150, 210, 0.1) 100%);
    cursor: pointer;
    border-bottom: 1px solid #e9ecef;
}

.panel-header:hover {
    background: linear-gradient(135deg, rgba(26, 150, 210, 0.08) 0%, rgba(26, 150, 210, 0.12) 100%);
}

.config-images-row {
    display: flex;
    justify-content: space-around;
    padding: 15px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.config-image-item {
    text-align: center;
    position: relative;
}

.config-image-item .badge-img {
    position: absolute;
    top: -8px;
    left: -8px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    color: white;
}

.config-img {
    max-height: 60px;
    width: auto;
}

.config-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    padding: 15px;
}

.config-item {
    background: #f8f9fa;
    padding: 10px;
    border-radius: 8px;
}

.item-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #6c757d;
    margin-bottom: 5px;
}

.item-value {
    font-size: 14px;
}

.label-tag {
    display: inline-block;
    background: rgba(26, 150, 210, 0.1);
    color: #1a96d2;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 10px;
    margin-left: 6px;
}

.price-summary {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-top: 15px;
}

.price-row {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
}

.total-row {
    border-top: 2px solid #1a96d2;
    margin-top: 8px;
    padding-top: 8px;
    font-size: 16px;
}

.total-price {
    color: #1a96d2;
    font-size: 18px;
}

/* ============================================
   RESPONSIVE DESIGN (Consolidated)
   ============================================ */
@media (max-width: 768px) {
    /* Hero & FAQ */
    .builder-hero {
        padding: 30px 15px;
    }
    
    .hero-features .feature {
        font-size: 11px;
        padding: 4px 10px;
    }
    
    .faq-item .h6 {
        font-size: 14px;
    }
    
    .faq-item p {
        font-size: 12px;
    }
    
    /* Cards & Badges */
    .cable-type-card .h6 {
        font-size: 12px;
    }
    
    .connector-badge {
        font-size: 10px;
        padding: 4px 10px;
    }
    
    /* Price Examples */
    .price-examples table {
        font-size: 11px;
    }
    
    .price-examples th,
    .price-examples td {
        padding: 6px 8px;
    }
    
    /* Config Grid */
    .config-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .config-buttons-row {
        flex-direction: row;
    }
    
    .config-labels-row {
        flex-direction: row;
    }
    
    .config-length-qty-row {
        flex-direction: column;
    }
    
    /* Review */
    .review-visualization {
        flex-direction: row;
    }
    
    /* Cart Panel */
    .config-images-row {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }
}

@media (max-width: 480px) {
    .hero-features {
        gap: 8px !important;
    }
    
    .hero-features .feature {
        font-size: 10px;
        padding: 3px 8px;
    }
    
    .launch-tool-btn {
        font-size: 14px;
        padding: 10px 16px;
    }
}