/* Frontend Styles for Product Finder */

.product-finder-container {
    max-width: 900px;
    margin: 40px auto;
    padding: 30px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

/* Progress Bar */
.pf-progress-bar {
    width: 100%;
    height: 6px;
    background: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 15px;
}

.pf-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #0073aa, #00a0d2);
    transition: width 0.4s ease;
}

/* Step Indicator */
.pf-step-indicator {
    text-align: center;
    font-size: 14px;
    color: #666;
    margin-bottom: 30px;
    font-weight: 600;
}

.pf-current-step {
    color: #98020A;
    font-size: 18px;
}

/* Step Container */
.pf-step {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.pf-step-title {
    font-size: 24px;
    font-weight: 700;
    color: #333;
    margin-bottom: 30px;
    text-align: center;
}

/* Options Grid */
.pf-options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    max-width: 100%;
    gap: 20px;
    margin-bottom: 30px;
}

@media (min-width: 900px) {
    .pf-options-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 899px) and (min-width: 600px) {
    .pf-options-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 599px) and (min-width: 400px) {
    .pf-options-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 399px) {
    .pf-options-grid {
        grid-template-columns: 1fr;
    }
}

/* Option Card */
.pf-option-card {
    position: relative;
    cursor: pointer;
    border: 3px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    background: #fff;
    display: block;
}

.pf-option-card:hover {
    border-color: #0073aa;
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 115, 170, 0.15);
}

.pf-option-card.pf-option-active {
    border-color: #0073aa;
    background: #f0f8ff;
    box-shadow: 0 8px 25px rgba(0, 115, 170, 0.2);
}

.pf-option-card.pf-option-active::after {
    content: '✓';
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    background: #0073aa;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 18px;
}

/* Option Image */
.pf-option-image {
    width: 100%;
    height: 180px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    background-color: #f5f5f5;
}

.pf-option-no-image {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.pf-option-icon {
    font-size: 60px;
    opacity: 0.8;
}

/* Option Label */
.pf-option-label {
    padding: 15px;
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    background: #fff;
}

.pf-option-active .pf-option-label {
    color: #0073aa;
}

/* Step Buttons */
.pf-step-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
}

.pf-prev-btn,
.pf-next-btn,
.pf-submit-btn {
    padding: 14px 30px;
    font-size: 16px;
    font-weight: 600;
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.pf-prev-btn {
    background: #f5f5f5;
    color: #666;
    border-color: #ddd;
}

.pf-prev-btn:hover {
    background: #e0e0e0;
    border-color: #bbb;
    transform: translateY(-2px);
}

.pf-next-btn,
.pf-submit-btn {
    background: #0073aa;
    color: #fff;
    flex: 1;
    max-width: 300px;
}

.pf-next-btn:hover:not(:disabled),
.pf-submit-btn:hover:not(:disabled) {
    background: #005a87;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 115, 170, 0.3);
}

.pf-next-btn:disabled,
.pf-submit-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Results Section */
#pf-results {
    animation: fadeIn 0.5s ease;
}

#pf-results h3 {
    font-size: 28px;
    font-weight: 700;
    color: #333;
    text-align: center;
    margin-bottom: 30px;
}

#pf-products-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
    margin-bottom: 30px;
}

@media (max-width: 900px) {
    #pf-products-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    #pf-products-container {
        grid-template-columns: 1fr;
    }
}

.pf-product-card {
    padding: 20px;
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.pf-product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    border-color: #0073aa;
}

.pf-product-image {
    width: 100%;
    height: 200px;
    object-fit: contain;
    background-color: #f5f5f5;
    border-radius: 8px;
    margin-bottom: 15px;
    padding: 10px;
}

.pf-product-name {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 10px;
    color: #333;
}

.pf-product-description {
    font-size: 14px;
    line-height: 1.6;
    color: #666;
    margin-bottom: 15px;
    flex-grow: 1;
}

.pf-product-link {
    display: block;
    padding: 12px 20px;
    background: #0073aa;
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.3s;
    text-align: center;
    font-weight: 600;
    margin-top: auto;
}

.pf-product-link:hover {
    background: #005a87;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 115, 170, 0.3);
}

/* Restart Button */
.pf-restart-btn {
    display: block;
    margin: 0 auto;
    padding: 12px 30px;
    background: #f5f5f5;
    color: #666;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.pf-restart-btn:hover {
    background: #e0e0e0;
    border-color: #bbb;
    transform: translateY(-2px);
}

/* Loading */
#pf-loading {
    text-align: center;
    padding: 60px 30px;
    font-size: 20px;
    color: #666;
    font-weight: 600;
}

#pf-loading::after {
    content: '...';
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

/* No Results */
.pf-no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 40px;
    font-size: 18px;
    color: #666;
    background: #f9f9f9;
    border-radius: 12px;
    border: 2px dashed #ddd;
}

.pf-no-results p {
    margin: 0;
    line-height: 1.6;
}

/* Error Message */
.pf-error-message {
    padding: 20px;
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-radius: 8px;
    text-align: center;
    margin: 20px 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .product-finder-container {
        padding: 20px;
        margin: 20px 10px;
    }
    
    .pf-step-title {
        font-size: 20px;
    }
    
    .pf-options-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    #pf-products-container {
        grid-template-columns: 1fr;
    }
    
    .pf-step-buttons {
        flex-direction: column;
    }
    
    .pf-prev-btn,
    .pf-next-btn,
    .pf-submit-btn {
        width: 100%;
        max-width: 100%;
    }
}
    color: #666;
    margin: 0;
    box-sizing: border-box;
}

/* Responsive Design */
@media (max-width: 768px) {
    .product-finder-container {
        width: 100%;
        max-width: 100%;
        padding: 15px;
    }
    
    .pf-button-row {
        flex-direction: column;
    }
    
    .pf-submit-btn,
    .pf-reset-btn {
        width: 100%;
    }
    
    #pf-products-container {
        grid-template-columns: 1fr;
        max-width: 100%;
    }
}

@media (min-width: 769px) and (max-width: 1200px) {
    .product-finder-container {
        width: 50%;
    }
}
