/**
 * Denafa Smart Search - Styles
 * Design conforme a Bootstrap Italia
 * Palette Denafa: #0066CC (primary), #17324D (secondary), #00C5CA (accent)
 */

/* ========================================
   CONTAINER PRINCIPALE
   ======================================== */

.dss-container {
    width: 100%;
    max-width: 900px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.dss-box {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(23, 50, 77, 0.08);
    overflow: hidden;
    border: 1px solid rgba(0, 102, 204, 0.1);
}

/* ========================================
   HEADER
   ======================================== */

.dss-header {
    background: linear-gradient(135deg, #0066CC 0%, #17324D 100%);
    padding: 2.5rem 2rem;
    text-align: center;
    color: #ffffff;
    position: relative;
    overflow: hidden;
}

.dss-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: pulse 15s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.3; }
    50% { transform: scale(1.1); opacity: 0.5; }
}

.dss-title {
    margin: 0 0 0.75rem;
    font-size: 2rem;
    font-weight: 700;
    font-family: 'Titillium Web', sans-serif;
    position: relative;
    z-index: 1;
}

.dss-subtitle {
    margin: 0;
    font-size: 1.125rem;
    opacity: 0.95;
    font-weight: 400;
    position: relative;
    z-index: 1;
}

/* ========================================
   SEARCH FORM
   ======================================== */

.dss-search-form {
    padding: 2rem;
    background: #ffffff;
}

.dss-search-form .input-group {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid #0066CC;
    transition: all 0.3s ease;
}

.dss-search-form .input-group:focus-within {
    box-shadow: 0 6px 20px rgba(0, 102, 204, 0.2);
    border-color: #17324D;
}

.dss-search-icon {
    background: #ffffff;
    border: none;
    padding: 1rem 1.25rem;
    font-size: 1.5rem;
}

.dss-search-input {
    border: none;
    padding: 1rem 1.25rem;
    font-size: 1.125rem;
    font-family: 'Titillium Web', sans-serif;
    background: #ffffff;
}

.dss-search-input:focus {
    outline: none;
    box-shadow: none;
    border: none;
}

.dss-search-input::placeholder {
    color: #5c6f82;
    opacity: 0.7;
}

.dss-search-btn {
    background: #0066CC;
    border: none;
    color: #ffffff;
    padding: 1rem 2.5rem;
    font-size: 1.125rem;
    font-weight: 600;
    transition: all 0.3s ease;
    font-family: 'Titillium Web', sans-serif;
}

.dss-search-btn:hover {
    background: #17324D;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.3);
}

.dss-search-btn:active {
    transform: translateY(0);
}

.dss-btn-loader {
    display: inline-flex;
    align-items: center;
}

/* ========================================
   SUGGERIMENTI RAPIDI
   ======================================== */

.dss-quick-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.5rem;
    align-items: center;
}

.dss-suggestion-label {
    font-size: 0.875rem;
    color: #5c6f82;
    font-weight: 600;
    margin-right: 0.5rem;
}

.dss-suggestion-chip {
    background: rgba(0, 102, 204, 0.08);
    border: 1px solid rgba(0, 102, 204, 0.2);
    border-radius: 20px;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    color: #0066CC;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Titillium Web', sans-serif;
}

.dss-suggestion-chip:hover {
    background: #0066CC;
    color: #ffffff;
    border-color: #0066CC;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 102, 204, 0.2);
}

/* ========================================
   RESULTS CONTAINER
   ======================================== */

.dss-results {
    padding: 0 2rem 2rem;
}

.dss-results.d-none {
    display: none;
}

/* Understanding Box */
.dss-understanding {
    background: linear-gradient(135deg, rgba(0, 197, 202, 0.1) 0%, rgba(0, 102, 204, 0.05) 100%);
    border-left: 4px solid #00C5CA;
    padding: 1.25rem;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.dss-understanding-icon {
    font-size: 1.5rem;
    margin-right: 0.75rem;
}

.dss-understanding-text {
    font-size: 1rem;
    color: #17324D;
    line-height: 1.6;
    margin: 0;
}

/* Products Grid */
.dss-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

/* Product Card */
.dss-product-card {
    background: #ffffff;
    border: 2px solid rgba(0, 102, 204, 0.15);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    flex-direction: column;
}

.dss-product-card:hover {
    border-color: #0066CC;
    box-shadow: 0 8px 24px rgba(0, 102, 204, 0.15);
    transform: translateY(-4px);
}

.dss-product-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
    background: linear-gradient(135deg, #0066CC 0%, #17324D 100%);
}

.dss-product-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: #00C5CA;
    color: #ffffff;
    padding: 0.375rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dss-product-badge.relevance-alta {
    background: #008758;
}

.dss-product-badge.relevance-media {
    background: #00C5CA;
}

.dss-product-badge.relevance-bassa {
    background: #5c6f82;
}

.dss-product-body {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.dss-product-category {
    font-size: 0.875rem;
    color: #0066CC;
    font-weight: 600;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dss-product-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: #17324D;
    margin: 0 0 0.75rem;
    line-height: 1.3;
}

.dss-product-reason {
    font-size: 0.9375rem;
    color: #5c6f82;
    line-height: 1.6;
    margin-bottom: 1rem;
    flex: 1;
}

.dss-product-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid rgba(0, 102, 204, 0.1);
}

.dss-product-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: #0066CC;
}

.dss-product-btn {
    background: #0066CC;
    color: #ffffff;
    border: none;
    padding: 0.625rem 1.25rem;
    border-radius: 8px;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
}

.dss-product-btn:hover {
    background: #17324D;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.3);
}

/* No Results */
.dss-no-results {
    text-align: center;
    padding: 3rem 2rem;
    background: rgba(92, 111, 130, 0.05);
    border-radius: 12px;
    margin-top: 1.5rem;
}

.dss-no-results-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.dss-no-results-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #17324D;
    margin-bottom: 0.75rem;
}

.dss-no-results-text {
    font-size: 1rem;
    color: #5c6f82;
    margin-bottom: 1.5rem;
}

/* ========================================
   LOADING STATE
   ======================================== */

.dss-loading {
    text-align: center;
    padding: 3rem 2rem;
}

.dss-loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(0, 102, 204, 0.1);
    border-top-color: #0066CC;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1.5rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.dss-loading-text {
    font-size: 1.125rem;
    color: #5c6f82;
    font-weight: 500;
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
    .dss-container {
        margin: 1rem auto;
        padding: 0 0.5rem;
    }
    
    .dss-box {
        border-radius: 12px;
    }
    
    .dss-header {
        padding: 2rem 1.5rem;
    }
    
    .dss-title {
        font-size: 1.75rem;
    }
    
    .dss-subtitle {
        font-size: 1rem;
    }
    
    .dss-search-form {
        padding: 1.5rem 1rem;
    }
    
    .dss-search-form .input-group {
        flex-wrap: wrap;
    }
    
    .dss-search-btn {
        width: 100%;
        margin-top: 0.75rem;
        border-radius: 8px !important;
    }
    
    .dss-products-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .dss-results {
        padding: 0 1rem 1.5rem;
    }
    
    .dss-quick-suggestions {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .dss-search-input {
        font-size: 1rem;
        padding: 0.875rem 1rem;
    }
    
    .dss-search-icon {
        padding: 0.875rem 1rem;
    }
    
    .dss-product-body {
        padding: 1.25rem;
    }
}

/* ========================================
   ACCESSIBILITY
   ======================================== */

.dss-search-btn:focus,
.dss-suggestion-chip:focus,
.dss-product-btn:focus {
    outline: 3px solid #00C5CA;
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}