/* css/bag-visualizer.css */

/* Stili per il container principale */
.bag-visualizer-container {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin: 20px 0;
}

/* Controlli per selezione corporatura */
.body-type-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
    justify-content: center;
}

.body-type-button {
    padding: 10px 16px;
    border: 2px solid #e9ecef;
    background: #ffffff;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 14px;
}

.body-type-button:hover {
    border-color: #F41345;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(244, 19, 69, 0.15);
}

.body-type-button.active {
    background: #F41345;
    color: white;
    border-color: #F41345;
}

/* Controlli per modalità di trasporto */
.carry-style-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    justify-content: center;
}

.carry-style-button {
    padding: 8px 20px;
    border: 2px solid #F41345;
    background: #ffffff;
    color: #F41345;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.carry-style-button:hover {
    background: #F41345;
    color: white;
    transform: scale(1.05);
}

.carry-style-button.active {
    background: #28a745;
    color: white;
}

/* Controlli per selezione prodotto */
.product-selection {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 25px;
    justify-content: center;
}

.product-button {
    padding: 8px 16px;
    border: 2px solid #F6B8B8;
    background: #ffffff;
    color: #7A7A7A;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 13px;
}

.product-button:hover {
    background: #F6B8B8;
    color: white;
}

.product-button.active {
    background: #F6B8B8;
    color: white;
}

/* Container del visualizzatore */
.visualizer-display {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    position: relative;
    margin-bottom: 20px;
}

.silhouette-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.silhouette-image {
    width: 100%;
    height: 100%;
    max-width: 320px;
    max-height: 480px;
    object-fit: contain;
    transition: opacity 0.3s ease;
}

.silhouette-svg {
    width: 100%;
    height: 100%;
    max-width: 320px;
    max-height: 480px;
}

.bag-image {
    position: absolute;
    max-width: none;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
    z-index: 10;
}

.bag-image:hover {
    filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.3));
}

/* Informazioni prodotto */
.product-info {
    text-align: center;
    padding: 20px;
    background: white;
    border-radius: 0 0 12px 12px;
}

.product-name {
    font-size: 18px;
    font-weight: 600;
    color: #F41345;
    margin-bottom: 8px;
}

.product-description {
    font-size: 14px;
    color: #6c757d;
    margin-bottom: 15px;
    line-height: 1.4;
}

.product-price {
    font-size: 16px;
    font-weight: 700;
    color: #F41345;
    margin-bottom: 15px;
}

.view-product-button {
    padding: 12px 24px;
    background: linear-gradient(135deg, #F41345 0%, #F6B8B8 100%);
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.view-product-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
    color: white;
    text-decoration: none;
}

/* Loading states */
.loading-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #F6B8B8;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-message {
    text-align: center;
    color: #6c757d;
    font-style: italic;
}

/* Responsive design */
@media (max-width: 768px) {
    .bag-visualizer-container {
        padding: 15px;
        border-radius: 8px;
    }
    
    .body-type-controls,
    .carry-style-controls,
    .product-selection {
        flex-direction: column;
        align-items: center;
    }
    
    .body-type-button,
    .carry-style-button,
    .product-button {
        width: 200px;
        text-align: center;
    }
    
    .visualizer-display {
        height: 400px;
    }
    
    .product-name {
        font-size: 16px;
    }
    
    .view-product-button {
        width: 100%;
        box-sizing: border-box;
    }
}

@media (max-width: 480px) {
    .visualizer-display {
        height: 350px;
    }
    
    .product-info {
        padding: 15px;
    }
}

/* Stili per l'amministrazione */
.bag-visualizer-admin {
    background: #fff;
    border: 1px solid #ccd0d4;
    border-radius: 4px;
    padding: 20px;
}

.bag-image-upload-area {
    border: 2px dashed #ccd0d4;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.bag-image-upload-area:hover {
    border-color: #007cba;
    background-color: #f8f9fa;
}

.bag-image-upload-area.drag-over {
    border-color: #007cba;
    background-color: #e3f2fd;
}

.upload-instructions {
    color: #6c757d;
    font-size: 14px;
    margin-top: 10px;
}

.image-preview {
    margin-top: 15px;
    padding: 10px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    background: #fafafa;
}

.remove-image-button {
    margin-left: 10px;
    background: #F41345;
    color: white;
    border-color: #F41345;
}

.remove-image-button:hover {
    background: #7A7A7A;
    border-color: #7A7A7A;
}

/* Tab per le diverse corporature */
.body-type-tabs {
    display: flex;
    border-bottom: 1px solid #ccd0d4;
    margin-bottom: 20px;
}

.body-type-tab {
    padding: 10px 15px;
    border: none;
    background: none;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
}

.body-type-tab:hover {
    background: #f8f9fa;
}

.body-type-tab.active {
    border-bottom-color: #F41345;
    color: #F41345;
    font-weight: 600;
}

.positioning-panel {
    display: none;
    padding: 20px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    background: #fafafa;
}

.positioning-panel.active {
    display: block;
}

.position-control-group {
    margin-bottom: 15px;
}

.position-control-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
}

.position-control {
    width: 100%;
    margin-bottom: 5px;
}

.position-value {
    font-size: 12px;
    color: #6c757d;
    font-weight: normal;
}

.position-save-feedback {
    color: #28a745;
    font-size: 12px;
    font-weight: 600;
    display: none;
}

/* Anteprima posizionamento */
.position-preview-container {
    position: relative;
    width: 200px;
    height: 300px;
    border: 1px solid #ccd0d4;
    border-radius: 4px;
    background: white;
    margin: 20px 0;
    overflow: hidden;
}

.position-preview-silhouette {
    width: 100%;
    height: 100%;
    opacity: 0.3;
}

.position-preview-bag {
    position: absolute;
    max-width: 50px;
    opacity: 0.8;
    transition: all 0.3s ease;
}

/* Effetti di transizione */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.slide-in {
    animation: slideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideIn {
    from { transform: translateX(-100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Errore e stati vuoti */
.error-message {
    text-align: center;
    color: #dc3545;
    font-weight: 500;
    padding: 20px;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    margin: 20px 0;
}

.empty-state {
    text-align: center;
    color: #6c757d;
    padding: 40px 20px;
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.5;
}

.empty-state-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
}

.empty-state-description {
    font-size: 14px;
    line-height: 1.5;
}

/* Accessibilità */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus states per accessibilità */
.body-type-button:focus,
.carry-style-button:focus,
.product-button:focus,
.view-product-button:focus {
    outline: 2px solid #F41345;
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .bag-visualizer-container {
        box-shadow: none;
        border: 1px solid #000;
    }
    
    .body-type-controls,
    .carry-style-controls,
    .product-selection {
        display: none;
    }
}