/* 고급 원가 계산기 스타일 */
.advanced-calculator {
    background: var(--bg-light);
    padding: var(--spacing-lg);
    border-radius: var(--radius-lg);
    margin-top: var(--spacing-lg);
    border: 1px solid var(--border-light);
}

/* 탭 스타일 */
.calculator-tabs {
    display: flex;
    border-bottom: 2px solid var(--border-light);
    margin-bottom: var(--spacing-lg);
}

.tab-btn {
    padding: var(--spacing-sm) var(--spacing-lg);
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    font-weight: 500;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
}

.tab-btn:hover {
    color: var(--accent-warm);
    background: rgba(138, 138, 138, 0.1);
}

.tab-btn.active {
    color: var(--accent-warm);
    border-bottom-color: var(--accent-warm);
}

/* 탭 콘텐츠 */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* 섹션 헤더 */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-md);
}

.section-header h4 {
    margin: 0;
    color: var(--primary-dark);
}

/* 재료 관리 */
.ingredients-container {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: var(--spacing-sm);
}

.ingredient-category {
    margin-bottom: var(--spacing-lg);
}

.ingredient-category h4 {
    color: var(--accent-warm);
    margin-bottom: var(--spacing-sm);
    padding-bottom: var(--spacing-xs);
    border-bottom: 1px solid var(--border-light);
}

.ingredient-items {
    display: grid;
    gap: var(--spacing-sm);
}

.ingredient-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-sm);
    background: white;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
    transition: all 0.2s ease;
}

.ingredient-item:hover {
    box-shadow: var(--shadow-sm);
    border-color: var(--accent-warm);
}

.ingredient-info {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.ingredient-name {
    font-weight: 500;
    color: var(--primary-dark);
}

.ingredient-price {
    font-size: 0.9em;
    color: var(--text-light);
}

.ingredient-actions {
    display: flex;
    gap: var(--spacing-xs);
}

.ingredient-actions button {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
    border: 1px solid var(--border-light);
    background: white;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
}

.ingredient-actions button:hover {
    background: var(--accent-warm);
    color: white;
    border-color: var(--accent-warm);
}

/* 레시피 폼 */
.recipe-form {
    display: grid;
    gap: var(--spacing-lg);
}

.form-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: var(--spacing-md);
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 500;
    margin-bottom: var(--spacing-xs);
    color: var(--primary-dark);
}

.form-group input,
.form-group select {
    padding: var(--spacing-sm);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    font-size: 1rem;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--accent-warm);
    box-shadow: 0 0 0 2px rgba(138, 138, 138, 0.2);
}

/* 레시피 아이템 */
.recipe-ingredients {
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: var(--spacing-md);
    background: white;
}

#recipe-items {
    display: grid;
    gap: var(--spacing-sm);
}

.recipe-item {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr auto;
    gap: var(--spacing-sm);
    align-items: center;
    padding: var(--spacing-sm);
    background: var(--bg-light);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
}

.recipe-item select,
.recipe-item input {
    padding: 0.5rem;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
}

.item-cost {
    font-weight: 600;
    color: var(--accent-warm);
}

.recipe-item button {
    padding: 0.25rem 0.5rem;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.8rem;
}

.recipe-item button:hover {
    background: #c0392b;
}

/* 계산 컨트롤 */
.calculation-controls {
    margin-top: var(--spacing-lg);
    padding: var(--spacing-md);
    background: var(--bg-light);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
}

.realtime-display {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--accent-warm);
    margin-bottom: var(--spacing-md);
    text-align: center;
}

.button-group {
    display: flex;
    gap: var(--spacing-md);
    justify-content: center;
}

/* 버튼 스타일 */
.btn {
    padding: var(--spacing-sm) var(--spacing-lg);
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

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

.btn-primary:hover {
    background: var(--accent-cool);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--border-light);
    color: var(--text-dark);
}

.btn-secondary:hover {
    background: var(--text-light);
    color: white;
}

.btn-success {
    background: #27ae60;
    color: white;
}

.btn-success:hover {
    background: #229954;
}

/* 원가 분석 결과 */
.cost-analysis {
    padding: var(--spacing-lg);
    background: white;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
}

.cost-breakdown h3 {
    color: var(--primary-dark);
    margin-bottom: var(--spacing-lg);
    text-align: center;
}

.cost-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-sm);
    border-radius: var(--radius-sm);
}

.cost-item.primary {
    background: var(--accent-warm);
    color: white;
    font-size: 1.2rem;
    font-weight: 600;
}

.price-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-md);
    margin-top: var(--spacing-lg);
}

.price-option {
    padding: var(--spacing-lg);
    border-radius: var(--radius-lg);
    text-align: center;
    border: 2px solid var(--border-light);
    transition: all 0.3s ease;
}

.price-option:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.price-option.low {
    border-color: #f39c12;
}

.price-option.medium.recommended {
    border-color: var(--accent-warm);
    background: linear-gradient(135deg, var(--bg-light), white);
}

.price-option.high {
    border-color: #e74c3c;
}

.markup {
    display: block;
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: var(--spacing-xs);
}

.price {
    display: block;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary-dark);
    margin-bottom: var(--spacing-xs);
}

.note {
    font-size: 0.8rem;
    color: var(--text-light);
}

.recommended .note {
    color: var(--accent-warm);
    font-weight: 500;
}

/* 요약 정보 */
.calculation-summary {
    margin-top: var(--spacing-lg);
}

.summary-card {
    background: white;
    padding: var(--spacing-lg);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
}

.summary-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: var(--spacing-md);
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-sm);
    background: var(--bg-light);
    border-radius: var(--radius-sm);
}

.stat-label {
    color: var(--text-dark);
}

.stat-value {
    font-weight: 600;
    color: var(--accent-warm);
}

/* 모달 스타일 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    padding: var(--spacing-xl);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-content h3 {
    margin-top: 0;
    margin-bottom: var(--spacing-lg);
    color: var(--primary-dark);
}

.form-actions {
    display: flex;
    gap: var(--spacing-md);
    justify-content: flex-end;
    margin-top: var(--spacing-lg);
}

.form-actions button {
    padding: var(--spacing-sm) var(--spacing-lg);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
}

.form-actions button:first-child {
    background: var(--accent-warm);
    color: white;
    border-color: var(--accent-warm);
}

.form-actions button:first-child:hover {
    background: var(--accent-cool);
}

.form-actions button:last-child {
    background: white;
    color: var(--text-dark);
}

.form-actions button:last-child:hover {
    background: var(--bg-light);
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .recipe-item {
        grid-template-columns: 1fr;
        gap: var(--spacing-xs);
    }
    
    .price-options {
        grid-template-columns: 1fr;
    }
    
    .summary-stats {
        grid-template-columns: 1fr;
    }
    
    .button-group {
        flex-direction: column;
    }
    
    .calculator-tabs {
        flex-wrap: wrap;
    }
    
    .tab-btn {
        flex: 1;
        min-width: 0;
    }
}

/* 플레이스홀더 메시지 */
.placeholder-message {
    text-align: center;
    color: var(--text-light);
    padding: var(--spacing-xl);
}

.placeholder-message p {
    font-size: 1.1rem;
    margin: 0;
}