/* Brewers Recipe Builder - Styles Admin */

:root {
    --brb-primary: #2563eb;
    --brb-primary-dark: #1e40af;
    --brb-secondary: #f59e0b;
    --brb-success: #10b981;
    --brb-danger: #ef4444;
    --brb-gray-50: #f9fafb;
    --brb-gray-100: #f3f4f6;
    --brb-gray-200: #e5e7eb;
    --brb-gray-300: #d1d5db;
    --brb-gray-400: #9ca3af;
    --brb-gray-500: #6b7280;
    --brb-gray-600: #4b5563;
    --brb-gray-700: #374151;
    --brb-gray-800: #1f2937;
    --brb-gray-900: #111827;
    --brb-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --brb-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --brb-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --brb-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --brb-radius: 8px;
    --brb-radius-lg: 12px;
}

.brb-editor-wrap {
    max-width: 100%;
    padding: 20px;
}

.brb-builder-container {
    background: #fff;
    border-radius: var(--brb-radius-lg);
    box-shadow: var(--brb-shadow-lg);
    padding: 30px;
    margin-top: 20px;
}

/* En-tête de la recette */
.brb-recipe-header {
    margin-bottom: 30px;
    padding-bottom: 30px;
    border-bottom: 2px solid var(--brb-gray-200);
}

.brb-header-main {
    margin-bottom: 20px;
}

.brb-title-input {
    font-size: 32px;
    font-weight: 700;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 10px 0;
    width: 100%;
    transition: border-color 0.3s;
    color: var(--brb-gray-900);
}

.brb-title-input:focus {
    outline: none;
    border-bottom-color: var(--brb-primary);
}

.brb-description-input {
    width: 100%;
    min-height: 80px;
    padding: 12px;
    border: 1px solid var(--brb-gray-300);
    border-radius: var(--brb-radius);
    font-size: 14px;
    resize: vertical;
    transition: border-color 0.3s;
}

.brb-description-input:focus {
    outline: none;
    border-color: var(--brb-primary);
}

.brb-header-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.brb-stat-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.brb-stat-card label {
    font-size: 12px;
    font-weight: 600;
    color: var(--brb-gray-600);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.brb-stat-card input {
    padding: 10px 12px;
    border: 1px solid var(--brb-gray-300);
    border-radius: var(--brb-radius);
    font-size: 14px;
    transition: border-color 0.3s;
}

.brb-stat-card input:focus {
    outline: none;
    border-color: var(--brb-primary);
}

/* Statistiques calculées */
.brb-calculated-stats {
    display: flex;
    gap: 20px;
    padding: 20px;
    background: linear-gradient(135deg, var(--brb-primary) 0%, var(--brb-primary-dark) 100%);
    border-radius: var(--brb-radius);
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.brb-stat-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
    color: white;
}

.brb-stat-label {
    font-size: 12px;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.brb-stat-value {
    font-size: 24px;
    font-weight: 700;
}

/* Grille principale */
.brb-builder-grid {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

/* Bibliothèque d'ingrédients */
.brb-ingredients-library {
    background: var(--brb-gray-50);
    border-radius: var(--brb-radius-lg);
    padding: 20px;
    height: fit-content;
    position: sticky;
    top: 20px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
}

.brb-ingredients-library h2 {
    font-size: 18px;
    margin: 0 0 15px 0;
    color: var(--brb-gray-900);
}

.brb-library-tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.brb-tab {
    padding: 8px 16px;
    border: none;
    background: white;
    border-radius: var(--brb-radius);
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: var(--brb-gray-600);
    transition: all 0.3s;
    box-shadow: var(--brb-shadow-sm);
}

.brb-tab:hover {
    background: var(--brb-gray-100);
    color: var(--brb-gray-900);
}

.brb-tab.active {
    background: var(--brb-primary);
    color: white;
}

.brb-library-section {
    display: none;
}

.brb-library-section.active {
    display: block;
}

.brb-library-item {
    padding: 12px;
    background: white;
    border-radius: var(--brb-radius);
    margin-bottom: 8px;
    cursor: grab;
    transition: all 0.3s;
    box-shadow: var(--brb-shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.brb-library-item:hover {
    transform: translateX(5px);
    box-shadow: var(--brb-shadow);
    background: var(--brb-primary);
    color: white;
}

.brb-library-item.dragging {
    opacity: 0.5;
    cursor: grabbing;
}

.brb-item-name {
    font-weight: 600;
    font-size: 14px;
}

.brb-item-info {
    font-size: 12px;
    opacity: 0.7;
}

/* Sections de recette */
.brb-recipe-content {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.brb-recipe-section {
    background: white;
    border: 2px solid var(--brb-gray-200);
    border-radius: var(--brb-radius-lg);
    padding: 20px;
    transition: border-color 0.3s;
}

.brb-recipe-section:hover {
    border-color: var(--brb-primary);
}

.brb-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--brb-gray-200);
}

.brb-section-header h3 {
    margin: 0;
    font-size: 18px;
    color: var(--brb-gray-900);
}

.brb-section-total {
    font-weight: 600;
    color: var(--brb-primary);
}

/* Zones de drop */
.brb-drop-zone {
    min-height: 100px;
    padding: 15px;
    border: 2px dashed var(--brb-gray-300);
    border-radius: var(--brb-radius);
    transition: all 0.3s;
    background: var(--brb-gray-50);
}

.brb-drop-zone.drag-over {
    border-color: var(--brb-primary);
    background: rgba(37, 99, 235, 0.1);
    border-style: solid;
}

.brb-drop-zone:empty::before {
    content: 'Glissez des ingrédients ici';
    display: block;
    text-align: center;
    color: var(--brb-gray-400);
    font-style: italic;
    padding: 20px;
}

/* Items d'ingrédients */
.brb-ingredient-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: white;
    border-radius: var(--brb-radius);
    margin-bottom: 10px;
    box-shadow: var(--brb-shadow);
    transition: all 0.3s;
    cursor: move;
}

.brb-ingredient-item:hover {
    box-shadow: var(--brb-shadow-md);
    transform: translateY(-2px);
}

.brb-ingredient-item.dragging {
    opacity: 0.5;
}

.brb-item-handle {
    cursor: grab;
    color: var(--brb-gray-400);
    font-size: 18px;
    user-select: none;
    padding: 5px;
}

.brb-item-handle:active {
    cursor: grabbing;
}

.brb-item-content {
    flex: 1;
    display: grid;
    grid-template-columns: 2fr 1fr 80px;
    gap: 10px;
    align-items: center;
}

.brb-ingredient-item[data-type="hop"] .brb-item-content {
    grid-template-columns: 2fr 1fr 80px 80px 80px;
}

.brb-item-content input,
.brb-item-content select {
    padding: 8px 10px;
    border: 1px solid var(--brb-gray-300);
    border-radius: 6px;
    font-size: 13px;
    transition: border-color 0.3s;
}

.brb-item-content input:focus,
.brb-item-content select:focus {
    outline: none;
    border-color: var(--brb-primary);
}

.brb-item-remove {
    width: 30px;
    height: 30px;
    border: none;
    background: var(--brb-danger);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.brb-item-remove:hover {
    background: #dc2626;
    transform: scale(1.1);
}

/* Étapes */
.brb-steps-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.brb-step-item {
    display: flex;
    gap: 10px;
    padding: 15px;
    background: white;
    border-radius: var(--brb-radius);
    box-shadow: var(--brb-shadow);
    transition: all 0.3s;
}

.brb-step-item:hover {
    box-shadow: var(--brb-shadow-md);
}

.brb-step-handle {
    cursor: grab;
    color: var(--brb-gray-400);
    font-size: 18px;
    user-select: none;
    padding: 5px;
}

.brb-step-content {
    flex: 1;
    display: grid;
    grid-template-columns: 150px 120px 120px 1fr;
    gap: 10px;
    align-items: start;
}

.brb-step-content textarea {
    grid-column: 1 / -1;
    min-height: 60px;
    padding: 8px 10px;
    border: 1px solid var(--brb-gray-300);
    border-radius: 6px;
    font-size: 13px;
    resize: vertical;
}

.brb-step-content select,
.brb-step-content input {
    padding: 8px 10px;
    border: 1px solid var(--brb-gray-300);
    border-radius: 6px;
    font-size: 13px;
}

.brb-step-remove {
    width: 30px;
    height: 30px;
    border: none;
    background: var(--brb-danger);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    transition: all 0.3s;
    align-self: start;
}

.brb-step-remove:hover {
    background: #dc2626;
    transform: scale(1.1);
}

/* Boutons */
.brb-actions {
    display: flex;
    gap: 15px;
    padding-top: 30px;
    border-top: 2px solid var(--brb-gray-200);
}

.brb-btn {
    padding: 12px 24px;
    border: none;
    border-radius: var(--brb-radius);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
}

.brb-btn-primary {
    background: var(--brb-primary);
    color: white;
}

.brb-btn-primary:hover {
    background: var(--brb-primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--brb-shadow-md);
}

.brb-btn-secondary {
    background: var(--brb-gray-200);
    color: var(--brb-gray-900);
}

.brb-btn-secondary:hover {
    background: var(--brb-gray-300);
}

.brb-btn-link {
    background: transparent;
    color: var(--brb-gray-600);
    padding: 12px 0;
}

.brb-btn-link:hover {
    color: var(--brb-primary);
}

.brb-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Placeholder pour drag */
.brb-placeholder {
    height: 60px;
    background: var(--brb-gray-200);
    border: 2px dashed var(--brb-primary);
    border-radius: var(--brb-radius);
    margin-bottom: 10px;
}

/* Responsive */
@media (max-width: 1200px) {
    .brb-builder-grid {
        grid-template-columns: 1fr;
    }
    
    .brb-ingredients-library {
        position: static;
        max-height: none;
    }
}

@media (max-width: 768px) {
    .brb-header-stats {
        grid-template-columns: 1fr;
    }
    
    .brb-item-content {
        grid-template-columns: 1fr;
    }
    
    .brb-step-content {
        grid-template-columns: 1fr;
    }
    
    .brb-calculated-stats {
        flex-direction: column;
    }
}
