/**
 * PowerVariantes CSS
 * Modern interface for product variant generation
 * Copyright (C) 2025 Massaoud Bouzenad <massaoud@dzprod.net>
 */
/* Base styles */
.powervariantes-container {
    margin: 20px 0;
}

.powervariantes-step {
    margin-bottom: 30px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 20px;
}

.powervariantes-step .titre {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 15px;
    color: #333;
    border-bottom: 2px solid #007cba;
    padding-bottom: 10px;
}

/* Attribute selection */
.attributes-selection .attribute-group {
    transition: all 0.3s ease;
}

.attributes-selection .attribute-group.selected {
    background-color: #f8f9fa;
    border-color: #007cba !important;
}

.attribute-value-tag {
    cursor: default;
    transition: background-color 0.2s ease;
}

.attribute-value-tag:hover {
    background-color: #e9ecef !important;
}

/* Combinations estimate */
#combinations-estimate {
    border-left: 4px solid #007cba;
}

#estimate-warning {
    font-weight: bold;
}

/* Preview table */
#combinations-preview {
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Editable cells */
.editable-cell {
    cursor: pointer;
    position: relative;
    transition: background-color 0.2s ease;
}

.editable-cell:hover {
    background-color: #f8f9fa;
}

.editable-cell.modified {
    background-color: #fff3cd;
    border-left: 3px solid #ffc107;
}

.editable-cell.saved {
    background-color: #d4edda;
    border-left: 3px solid #28a745;
}

.editable-cell.error {
    background-color: #f8d7da;
    border-left: 3px solid #dc3545;
}

.editable-cell input {
    border: 1px solid #007cba;
    padding: 4px 8px;
    font-size: 12px;
}

/* Progress bar */
.powervariantes-progress {
    width: 100%;
    height: 20px;
    background-color: #f8f9fa;
    border-radius: 10px;
    overflow: hidden;
    margin: 10px 0;
}

.powervariantes-progress-bar {
    height: 100%;
    background: linear-gradient(45deg, #007cba, #0056b3);
    transition: width 0.3s ease;
    border-radius: 10px;
}

/* Alerts */
.powervariantes-alert {
    border-radius: 4px;
    font-size: 14px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Buttons */
.button.button-save {
    background-color: #28a745;
    border-color: #28a745;
    color: white;
}

.button.button-save:hover {
    background-color: #218838;
    border-color: #1e7e34;
}

.button-secondary {
    background-color: #6c757d;
    border-color: #6c757d;
    color: white;
}

.button-secondary:hover {
    background-color: #5a6268;
    border-color: #545b62;
}

/* Toolbar */
.combinations-toolbar {
    border-bottom: 1px solid #ddd;
    padding-bottom: 10px;
}

/* Table improvements */
.combinations-table-container {
    overflow-x: auto;
}

#combinations-table {
    width: 100%;
    font-size: 13px;
}

#combinations-table td {
    vertical-align: middle;
}

#combinations-table .badge {
    font-size: 11px;
    padding: 4px 8px;
}

/* Form improvements */
.form-control {
    border: 1px solid #ced4da;
    border-radius: 4px;
    padding: 6px 12px;
    font-size: 14px;
}

.form-control:focus {
    border-color: #007cba;
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.25);
}

/* Responsive design */
@media (max-width: 768px) {
    .powervariantes-step {
        padding: 15px;
    }
    
    .combinations-table-container {
        font-size: 12px;
    }
    
    .attribute-group {
        margin-bottom: 10px !important;
        padding: 8px !important;
    }
    
    .attribute-value-tag {
        margin: 1px !important;
        padding: 2px 6px !important;
        font-size: 0.8em !important;
    }
}

/* Loading animation */
.powervariantes-loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007cba;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 5px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Utility classes */
.text-muted {
    color: #6c757d !important;
}

.text-success {
    color: #28a745 !important;
}

.text-danger {
    color: #dc3545 !important;
}

.text-warning {
    color: #ffc107 !important;
}

.nowraponall {
    white-space: nowrap;
}

.center {
    text-align: center;
}

/* Enhanced focus states */
.attribute-checkbox:focus + label {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

/* Enhanced hover states */
.button:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.2s ease;
}

/**
 * DZProd FrameWork CSS
 */
 .dzprod-update-notification {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 12px;
    margin: 20px 0;
    display: flex;
    align-items: flex-start;
    gap: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    animation: slideInDown 0.5s ease-out;
}

.dzprod-update-notification .update-icon {
    font-size: 2rem;
    opacity: 0.9;
}

.dzprod-update-notification .update-content {
    flex: 1;
}

.dzprod-update-notification .update-content h4 {
    margin: 0 0 10px 0;
    color: white;
    font-size: 1.2rem;
}

.dzprod-update-notification .update-content p {
    margin: 0 0 15px 0;
    opacity: 0.95;
}

.dzprod-update-notification .changelog {
    background: rgba(255,255,255,0.1);
    padding: 10px;
    border-radius: 6px;
    margin: 10px 0;
    font-size: 0.9rem;
}

.dzprod-update-notification .update-actions {
    margin-top: 15px;
}

.dzprod-update-notification .update-actions .butAction {
    background: rgba(255,255,255,0.2) !important;
    color: white !important;
    border: 1px solid rgba(255,255,255,0.3) !important;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.dzprod-update-notification .update-actions .butAction:hover {
    background: rgba(255,255,255,0.3) !important;
    transform: translateY(-2px);
}

.version-current {
    font-weight: bold;
    color: #2d3748;
    background: #f7fafc;
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid #e2e8f0;
}

.version-latest {
    font-weight: bold;
    color: #2b6cb0;
}

.release-date {
    color: #718096;
    font-size: 0.9rem;
    font-style: italic;
}

.badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: 8px;
}

.badge-warning {
    background: #fed7d7;
    color: #c53030;
}

.badge-success {
    background: #c6f6d5;
    color: #2f855a;
}

.badge-info {
    background: #bee3f8;
    color: #2b6cb0;
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 768px) {
    .dzprod-update-notification {
        flex-direction: column;
        text-align: center;
    }
}