/* Brewers Recipe Builder - Styles Frontend */

:root {
    --brb-primary: #e67e22;
    --brb-primary-dark: #d35400;
    --brb-secondary: #2c3e50;
    --brb-bg: #f8f9fa;
    --brb-border: #e9ecef;
    --brb-text: #212529;
    --brb-text-light: #6c757d;
}

.brb-frontend-builder {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Header & Stats */
.brb-recipe-header {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

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

.brb-title-input {
    width: 100%;
    font-size: 24px;
    padding: 15px;
    border: 2px solid var(--brb-border);
    border-radius: 8px;
    margin-bottom: 15px;
    transition: border-color 0.2s;
}

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

.brb-description-input {
    width: 100%;
    height: 80px;
    padding: 15px;
    border: 1px solid var(--brb-border);
    border-radius: 8px;
    resize: vertical;
}

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

/* Advanced Params */
.brb-advanced-settings-toggle {
    margin-top: 20px;
    padding: 10px;
    background: var(--brb-bg);
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    color: var(--brb-secondary);
    text-align: center;
    border: 1px dashed var(--brb-border);
    transition: all 0.2s;
}

.brb-advanced-settings-toggle:hover {
    background: #eee;
    color: var(--brb-primary);
}

.brb-advanced-params {
    display: none;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--brb-border);
    animation: fadeIn 0.3s ease;
}

.brb-advanced-params.active {
    display: grid;
}

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

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

.brb-stat-card label {
    font-weight: 600;
    color: var(--brb-text-light);
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.brb-stat-card input {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--brb-border);
    border-radius: 6px;
    font-weight: 500;
}

/* Calculated Stats Bar */
.brb-calculated-stats {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 15px;
    margin-bottom: 30px;
}

.brb-stat-item {
    background: white;
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.brb-stat-label {
    font-size: 12px;
    text-transform: uppercase;
    color: var(--brb-text-light);
    font-weight: 600;
    margin-bottom: 5px;
}

.brb-stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--brb-primary);
    line-height: 1;
}

.brb-stat-unit {
    font-size: 12px;
    color: var(--brb-text-light);
    margin-top: 2px;
}

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

/* Library */
.brb-ingredients-library {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
    height: fit-content;
    max-height: 800px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.brb-ingredients-library h2 {
    padding: 20px;
    margin: 0;
    font-size: 18px;
    border-bottom: 1px solid var(--brb-border);
    background: var(--brb-bg);
}

.brb-library-tabs {
    display: flex;
    overflow-x: auto;
    border-bottom: 1px solid var(--brb-border);
    background: white;
}

.brb-tab {
    flex: 1;
    padding: 12px 10px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-weight: 500;
    color: var(--brb-text-light);
    font-size: 13px;
    white-space: nowrap;
}

.brb-tab.active {
    border-bottom-color: var(--brb-primary);
    color: var(--brb-primary);
    background: rgba(230, 126, 34, 0.05);
}

.brb-library-content {
    padding: 15px;
    overflow-y: auto;
    max-height: 600px;
}

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

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

.brb-library-item {
    padding: 12px;
    background: white;
    border: 1px solid var(--brb-border);
    border-radius: 8px;
    margin-bottom: 8px;
    cursor: grab;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 12px;
}

.brb-library-item:hover {
    border-color: var(--brb-primary);
    transform: translateX(2px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.brb-item-icon {
    font-size: 20px;
    width: 30px;
    text-align: center;
}

.brb-item-details {
    flex: 1;
}

.brb-item-name {
    display: block;
    font-weight: 600;
    color: var(--brb-text);
}

.brb-item-info {
    display: block;
    font-size: 12px;
    color: var(--brb-text-light);
    margin-top: 2px;
}

/* Recipe Content */
.brb-recipe-content {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.brb-recipe-section {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
}

.brb-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--brb-border);
}

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

.brb-section-total {
    font-weight: 700;
    color: var(--brb-primary);
    background: rgba(230, 126, 34, 0.1);
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 14px;
}

.brb-drop-zone {
    min-height: 100px;
    border: 2px dashed var(--brb-border);
    border-radius: 8px;
    padding: 15px;
    transition: all 0.2s;
}

.brb-drop-zone.drag-over {
    border-color: var(--brb-primary);
    background: rgba(230, 126, 34, 0.05);
}

.brb-drop-placeholder {
    text-align: center;
    color: var(--brb-text-light);
    padding: 30px;
    pointer-events: none;
    font-style: italic;
}

/* Ingredient Item in Recipe */
.brb-ingredient-item {
    display: flex;
    align-items: center;
    gap: 15px;
    background: white;
    border: 1px solid var(--brb-border);
    padding: 10px;
    margin-bottom: 10px;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.brb-item-handle {
    cursor: move;
    color: var(--brb-text-light);
    padding: 0 5px;
}

.brb-item-content {
    flex: 1;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.brb-item-content input,
.brb-item-content select {
    padding: 8px;
    border: 1px solid var(--brb-border);
    border-radius: 4px;
    font-size: 14px;
}

.brb-item-content input.brb-item-name {
    flex: 2;
    min-width: 150px;
    font-weight: 500;
}

.brb-item-content input.brb-item-amount {
    width: 80px;
}

.brb-item-remove {
    background: none;
    border: none;
    color: #e74c3c;
    cursor: pointer;
    font-size: 20px;
    padding: 0 10px;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.brb-item-remove:hover {
    opacity: 1;
}

/* Actions */
.brb-actions {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    margin-top: 20px;
    padding: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 -4px 6px -1px rgba(0,0,0,0.05);
}

.brb-btn {
    padding: 12px 25px;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 16px;
}

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

.brb-btn-primary:hover {
    background: var(--brb-primary-dark);
    transform: translateY(-1px);
}

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

.brb-btn-secondary:hover {
    background: #34495e;
}

/* Recipe Display - Modernized */
.brb-recipe-display {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.brb-recipe-header-display {
    text-align: center;
    margin-bottom: 50px;
    background: white;
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.brb-recipe-title {
    font-size: 42px;
    font-weight: 800;
    color: var(--brb-secondary);
    margin: 0 0 20px 0;
}

.brb-recipe-description {
    font-size: 18px;
    color: var(--brb-text-light);
    line-height: 1.6;
    max-width: 800px;
    margin: 0 auto 30px auto;
}

.brb-recipe-meta {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--brb-border);
}

.brb-meta-item {
    font-size: 15px;
    color: var(--brb-text);
    background: var(--brb-bg);
    padding: 8px 16px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.brb-recipe-stats-display {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.brb-stat-card-display {
    background: white;
    padding: 25px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    border-top: 4px solid var(--brb-primary);
    transition: transform 0.2s;
}

.brb-stat-card-display:hover {
    transform: translateY(-5px);
}

.brb-stat-label-display {
    font-size: 13px;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
    color: var(--brb-text-light);
    font-weight: 700;
}

.brb-stat-value-display {
    font-size: 32px;
    font-weight: 800;
    color: var(--brb-secondary);
}

.brb-recipe-section-display {
    margin-bottom: 50px;
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.brb-recipe-section-display h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--brb-secondary);
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--brb-border);
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Water Profile & Advanced Details */
.brb-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
}

.brb-detail-column h3 {
    font-size: 18px;
    color: var(--brb-primary);
    margin-bottom: 15px;
}

.brb-detail-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--brb-border);
}

.brb-detail-item:last-child {
    border-bottom: none;
}

.brb-detail-label {
    color: var(--brb-text-light);
    font-weight: 500;
}

.brb-detail-value {
    font-weight: 700;
    color: var(--brb-secondary);
}

/* Responsive */
@media (max-width: 900px) {
    .brb-builder-grid {
        grid-template-columns: 1fr;
    }

    .brb-calculated-stats {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .brb-recipe-title {
        font-size: 32px;
    }

    .brb-recipe-meta {
        flex-direction: column;
        gap: 10px;
    }

    .brb-recipe-stats-display {
        grid-template-columns: repeat(2, 1fr);
    }

    .brb-step-display {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .brb-step-header {
        justify-content: center;
    }
}

@media (max-width: 600px) {
    .brb-calculated-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .brb-item-content {
        flex-direction: column;
        align-items: stretch;
    }

    .brb-item-content input.brb-item-amount {
        width: 100%;
    }
}
