/**
 * Shared Wire Rope Product Styles
 * Extracted from proven SmallDiameterLanyards.cshtml implementation
 * Used by lanyards, custom assemblies, and future wire rope product pages
 */

/* Construction Comparison Cards - Following brake cables catalog-card pattern */
.catalog-card {
    transition: all 0.3s ease;
    cursor: pointer;
    border: 1px solid rgba(0,0,0,0.1) !important;
}

.catalog-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15) !important;
    border-color: var(--bs-primary) !important;
}

.catalog-card.selected {
    border-color: var(--bs-primary) !important;
    box-shadow: 0 8px 25px rgba(0,123,255,0.2) !important;
    transform: translateY(-3px);
}

.construction-diagram img {
    transition: transform 0.3s ease;
}

.catalog-card:hover .construction-diagram img {
    transform: scale(1.05);
}

.badge-group {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    justify-content: center;
}

/* Mobile optimizations for construction cards */
@media (max-width: 768px) {
    .catalog-card {
        margin-bottom: 1rem;
    }

    .construction-diagram img {
        max-height: 150px !important;
    }

    .catalog-card .btn {
        font-size: 1rem;
        padding: 0.75rem 1.5rem;
    }
}

/* Smooth transitions for dynamic content */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.btn-loading {
    position: relative;
    color: transparent !important;
}

.btn-loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid transparent;
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Selection Guide Styles */
.selection-guide-container {
    background: #f8f9fa;
    border-radius: 0.5rem;
    padding: 2rem;
}

.selection-card {
    transition: all 0.3s ease;
    cursor: pointer;
    min-height: 180px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border: 2px solid transparent !important;
}

.selection-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border-color: var(--bs-primary) !important;
}

.selection-card.selected {
    border-color: var(--bs-primary) !important;
    background-color: rgba(13, 110, 253, 0.1);
    transform: translateY(-3px);
}

.step-content {
    min-height: 300px;
}

.progress-bar {
    transition: width 0.5s ease;
}

.form-range::-webkit-slider-thumb {
    background: var(--bs-primary);
}

.form-range::-moz-range-thumb {
    background: var(--bs-primary);
    border: none;
}

/* Mobile optimizations for selection guide */
@media (max-width: 768px) {
    .selection-guide-container {
        padding: 1.5rem;
    }

    .selection-card {
        min-height: 150px;
        margin-bottom: 1rem;
    }
}

/* Progressive Selection System Styles */
.selection-system {
    max-width: 1000px;
    margin: 0 auto;
}

.progress-steps {
    margin-bottom: 2rem;
}

.step-indicator {
    flex: 1;
    text-align: center;
    position: relative;
}

.step-indicator:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 15px;
    left: 50%;
    width: 100%;
    height: 2px;
    background: #dee2e6;
    z-index: 1;
}

.step-indicator.active::after {
    background: var(--bs-primary);
}

.step-number {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #dee2e6;
    color: #6c757d;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 5px;
    font-weight: bold;
    font-size: 14px;
    position: relative;
    z-index: 2;
}

.step-indicator.active .step-number {
    background: var(--bs-primary);
    color: white;
}

.step-indicator.completed .step-number {
    background: var(--bs-success);
    color: white;
}

.step-label {
    font-size: 12px;
    font-weight: 500;
    color: #6c757d;
}

.step-indicator.active .step-label {
    color: var(--bs-primary);
}

.step-indicator.completed .step-label {
    color: var(--bs-success);
}

.selection-step {
    display: none;
    margin-bottom: 2rem;
}

.selection-step.active {
    display: block;
}

.selection-step.disabled {
    opacity: 0.5;
    pointer-events: none;
}

.construction-selection {
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent !important;
}

.construction-selection:hover {
    border-color: var(--bs-primary) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.construction-selection.selected {
    border-color: var(--bs-primary) !important;
    background-color: rgba(var(--bs-primary-rgb), 0.05);
}

.diameter-button {
    border: 2px solid #dee2e6;
    background: white;
    color: #495057;
    padding: 1rem;
    text-align: center;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 0.25rem;
    min-width: 120px;
}

.diameter-button:hover {
    border-color: var(--bs-primary);
    background-color: rgba(var(--bs-primary-rgb), 0.05);
}

.diameter-button.selected {
    border-color: var(--bs-primary);
    background-color: var(--bs-primary);
    color: white;
}

.diameter-specs {
    font-size: 0.75rem;
    color: #6c757d;
}

@media (max-width: 768px) {
    .progress-steps {
        overflow-x: auto;
        white-space: nowrap;
    }

    .step-indicator {
        min-width: 80px;
    }

    .selection-card {
        margin-bottom: 1rem;
    }

    .step-content {
        min-height: 250px;
    }
}

/* Filter Controls Styles */
.filter-controls {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 0.5rem;
    border: 1px solid #dee2e6;
}

.filter-controls .form-select {
    font-size: 0.9rem;
}

.filter-controls .form-label {
    font-weight: 500;
    color: #495057;
}

/* Table Styles */
#specifications-table {
    font-size: 0.9rem;
}

#specifications-table th {
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background-color: #343a40;
    color: white;
    border-color: #454d55;
}

#specifications-table td {
    vertical-align: middle;
}

.table-hover tbody tr:hover {
    background-color: rgba(var(--bs-primary-rgb), 0.05);
}

.configure-btn {
    font-size: 0.8rem;
    padding: 0.25rem 0.75rem;
    white-space: nowrap;
}

/* Clickable rows */
.clickable-row {
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.clickable-row:hover {
    background-color: rgba(var(--bs-primary-rgb), 0.05);
}

/* Guide Sections */
.guide-sections {
    scroll-margin-top: 80px;
}

.guide-sections h3 {
    scroll-margin-top: 80px;
}

.table-row-hidden {
    display: none;
}

/* Results info */
.results-info {
    font-size: 0.9rem;
    color: #6c757d;
    margin-bottom: 1rem;
}

/* Pagination Styles */
.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #dee2e6;
}

.pagination-info {
    font-size: 0.9rem;
    color: #6c757d;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pagination-controls .btn {
    font-size: 0.8rem;
}

.info-icon {
    color: #6c757d;
    cursor: pointer;
    margin-left: 0.5rem;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.info-icon:hover {
    color: var(--bs-primary);
}

/* Filter badges */
.filter-badge {
    display: inline-block;
    background: #e9ecef;
    color: #495057;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    margin: 0.2rem;
}

.filter-badge .remove {
    margin-left: 0.5rem;
    cursor: pointer;
    color: #dc3545;
}

/* Clear filters button */
.clear-filters-btn {
    font-size: 0.8rem;
    padding: 0.25rem 0.75rem;
}

/* Construction badges */
.construction-badge {
    font-weight: 600;
    font-size: 0.9rem;
}

.construction-badge.rigid {
    color: #0d6efd;
}

.construction-badge.flexible {
    color: #198754;
}

/* Material indicators */
.material-indicator {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 0.5rem;
}

.material-indicator.galvanized {
    background-color: #6c757d;
}

.material-indicator.stainless {
    background-color: #0dcaf0;
}

/* Coating indicators */
.coating-indicator {
    font-size: 0.8rem;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-weight: 500;
}

.coating-indicator.none {
    background-color: #e9ecef;
    color: #495057;
}

.coating-indicator.pvc {
    background-color: #d1ecf1;
    color: #0c5460;
}

.coating-indicator.nylon {
    background-color: #d4edda;
    color: #155724;
}

/* Application tags */
.application-tag {
    display: inline-block;
    font-size: 0.75rem;
    padding: 0.2rem 0.4rem;
    margin: 0.1rem;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 3px;
    color: #495057;
}

/* Strength indicators */
.strength-value {
    font-weight: 600;
    color: #198754;
}

.working-load {
    color: #6c757d;
    font-size: 0.9rem;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .filter-controls {
        padding: 1rem;
    }

    .filter-controls .row > div {
        margin-bottom: 0.5rem;
    }

    #specifications-table {
        font-size: 0.8rem;
    }

    #specifications-table th {
        font-size: 0.75rem;
        padding: 0.5rem 0.25rem;
    }

    #specifications-table td {
        padding: 0.5rem 0.25rem;
    }

    .configure-btn {
        font-size: 0.7rem;
        padding: 0.2rem 0.5rem;
    }

    .pagination-container {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }

    .d-flex.gap-3.justify-content-center.flex-wrap .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }

    /* Stack table cells on very small screens */
    @media (max-width: 576px) {
        .table-responsive {
            border: none;
        }

        #specifications-table,
        #specifications-table thead,
        #specifications-table tbody,
        #specifications-table th,
        #specifications-table td,
        #specifications-table tr {
            display: block;
        }

        #specifications-table thead tr {
            position: absolute;
            top: -9999px;
            left: -9999px;
        }

        #specifications-table tr {
            border: 1px solid #ccc;
            margin-bottom: 0.5rem;
            border-radius: 6px;
            background: white;
            padding: 0.5rem;
        }

        #specifications-table td {
            border: none;
            position: relative;
            padding: 0.25rem 0;
            text-align: left;
        }

        #specifications-table td:before {
            font-weight: bold;
            display: block;
            font-size: 0.8rem;
            color: #6c757d;
            margin-bottom: 0.2rem;
        }

        /* Add labels for mobile view - override in specific implementations */
        #specifications-table td:nth-of-type(1):before { content: "Diameter:"; }
        #specifications-table td:nth-of-type(2):before { content: "Construction:"; }
        #specifications-table td:nth-of-type(3):before { content: "Material:"; }
        #specifications-table td:nth-of-type(4):before { content: "Coating:"; }
        #specifications-table td:nth-of-type(5):before { content: "Overall Diameter:"; }
        #specifications-table td:nth-of-type(6):before { content: "Breaking Strength:"; }
        #specifications-table td:nth-of-type(7):before { content: "Working Load:"; }
        #specifications-table td:nth-of-type(8):before { content: "Configure:"; }
    }
}

/* Loading state */
.specifications-loading {
    text-align: center;
    padding: 2rem;
    color: #6c757d;
}

.specifications-loading .spinner-border {
    width: 2rem;
    height: 2rem;
}

/* Empty state */
.specifications-empty {
    text-align: center;
    padding: 2rem;
    color: #6c757d;
}

.specifications-empty .bi {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}